Theme modification.

This commit is contained in:
Thomas Andres Gomez 2021-05-07 17:20:50 +02:00
parent 080d2e2b49
commit 586da03460
6 changed files with 25 additions and 26 deletions

View file

@ -47,7 +47,6 @@ fun Image(
alignment = alignment,
contentScale = contentScale,
alpha = alpha,
colorFilter = colorFilter,
)
}
}

View file

@ -57,10 +57,6 @@ fun DetailPageComposable(book: BookUio) {
Row(modifier = Modifier.padding(bottom = 16.dp)) {
Button(
modifier = Modifier.weight(1f),
colors = ButtonDefaults.textButtonColors(
backgroundColor = Teal200,
contentColor = Color.Black,
),
onClick = { }) {
Text(text = "EPUB")
}
@ -68,19 +64,11 @@ fun DetailPageComposable(book: BookUio) {
modifier = Modifier
.weight(1f)
.padding(horizontal = 8.dp),
colors = ButtonDefaults.textButtonColors(
backgroundColor = Teal200,
contentColor = Color.Black,
),
onClick = { }) {
Text(text = "MOBI")
}
Button(
modifier = Modifier.weight(1f),
colors = ButtonDefaults.textButtonColors(
backgroundColor = Teal200,
contentColor = Color.Black,
),
onClick = { }) {
Text(text = "SEND")
}

View file

@ -6,7 +6,9 @@ import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.material.ButtonDefaults.textButtonColors
import androidx.compose.material.ButtonDefaults.outlinedButtonColors
import androidx.compose.material.TextFieldDefaults.outlinedTextFieldColors
import androidx.compose.material.TextFieldDefaults.textFieldColors
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.sharp.Visibility
import androidx.compose.material.icons.sharp.VisibilityOff
@ -86,7 +88,7 @@ fun LoginScreenComposable(
) {
Button(
modifier = Modifier.padding(end = 8.dp),
colors = textButtonColors(),
colors = outlinedButtonColors(),
onClick = {
// TODO:
navigationViewModel.navigateTo(NavigationViewModel.Screen.MainScreen)
@ -105,7 +107,7 @@ fun LoginScreenComposable(
Button(
modifier = Modifier.fillMaxWidth(),
colors = ButtonDefaults.outlinedButtonColors(),
colors = outlinedButtonColors(),
onClick = {
// TODO:
navigationViewModel.navigateTo(NavigationViewModel.Screen.MainScreen)
@ -125,10 +127,11 @@ private fun LoginField(viewModel: AuthenticationViewModel, modifier: Modifier =
TextField(
modifier = modifier,
value = login.value ?: "",
onValueChange = { viewModel.updateLogin(it) },
label = { Text(text = stringResource(id = R.string.authentication_login)) },
colors = outlinedTextFieldColors(),
maxLines = 1,
singleLine = true,
onValueChange = { viewModel.updateLogin(it) },
)
}
@ -139,6 +142,9 @@ private fun PasswordField(viewModel: AuthenticationViewModel, modifier: Modifier
TextField(
modifier = modifier,
value = password.value ?: "",
onValueChange = { viewModel.updatePassword(it) },
label = { Text(text = stringResource(id = R.string.authentication_password)) },
colors = outlinedTextFieldColors(),
maxLines = 1,
singleLine = true,
visualTransformation = if (passwordVisibility) VisualTransformation.None else PasswordVisualTransformation(),
@ -150,8 +156,6 @@ private fun PasswordField(viewModel: AuthenticationViewModel, modifier: Modifier
)
}
},
label = { Text(text = stringResource(id = R.string.authentication_password)) },
onValueChange = { viewModel.updatePassword(it) }
)
}

View file

@ -5,4 +5,8 @@ import androidx.compose.ui.graphics.Color
val Purple200 = Color(0xFFBB86FC)
val Purple500 = Color(0xFF6200EE)
val Purple700 = Color(0xFF3700B3)
val Teal200 = Color(0xFF03DAC5)
val Teal200 = Color(0xFF03DAC5)
val Green600 = Color(0xFF43a047)
val Green600L = Color(0XFF76d275)
val Green600D = Color(0XFF00701a)

View file

@ -6,17 +6,18 @@ import androidx.compose.material.Surface
import androidx.compose.material.darkColors
import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
private val DarkColorPalette = darkColors(
primary = Purple200,
primaryVariant = Purple700,
secondary = Teal200
primary = Green600,
primaryVariant = Green600D,
onPrimary = Color.White,
)
private val LightColorPalette = lightColors(
primary = Purple500,
primaryVariant = Purple700,
secondary = Teal200
primary = Green600,
primaryVariant = Green600D,
onPrimary = Color.White,
)
@Composable