[CredManUI] UI style P0 fixes
1. color of the password visibility 2. snackbar height 3. button padding Bug: 270973517 Bug: 270973412 Bug: 270973614 Test: manual (see each bug for screenshots of updated ui) Change-Id: I9a50d348d673e8b85089de29a421a9714bd9ad5a
This commit is contained in:
@@ -24,8 +24,6 @@ enum class DialogState {
|
||||
|
||||
enum class ResultState {
|
||||
COMPLETE,
|
||||
NORMAL_CANCELED,
|
||||
LAUNCH_SETTING_CANCELED
|
||||
}
|
||||
|
||||
data class DialogResult(
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.credentialmanager.common.ui
|
||||
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import com.android.credentialmanager.R
|
||||
import androidx.compose.material.Icon
|
||||
@@ -33,7 +34,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.android.credentialmanager.ui.theme.LocalAndroidColorScheme
|
||||
|
||||
@Composable
|
||||
fun ActionButton(text: String, onClick: () -> Unit) {
|
||||
@@ -42,12 +42,10 @@ fun ActionButton(text: String, onClick: () -> Unit) {
|
||||
onClick = onClick,
|
||||
colors = ButtonDefaults.textButtonColors(
|
||||
contentColor = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
),
|
||||
contentPadding = PaddingValues(start = 12.dp, top = 10.dp, end = 12.dp, bottom = 10.dp),
|
||||
) {
|
||||
LargeLabelText(
|
||||
text = text,
|
||||
modifier = Modifier.padding(vertical = 10.dp, horizontal = 12.dp),
|
||||
)
|
||||
LargeLabelText(text = text)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +67,7 @@ fun ToggleVisibilityButton(modifier: Modifier = Modifier, onToggle: (Boolean) ->
|
||||
contentDescription = if (toggleState.value)
|
||||
stringResource(R.string.content_description_show_password) else
|
||||
stringResource(R.string.content_description_hide_password),
|
||||
tint = LocalAndroidColorScheme.current.colorAccentPrimaryVariant
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.credentialmanager.common.ui
|
||||
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
@@ -33,11 +34,9 @@ fun ConfirmButton(text: String, onClick: () -> Unit) {
|
||||
colors = ButtonDefaults.filledTonalButtonColors(
|
||||
containerColor = MaterialTheme.colorScheme.primary,
|
||||
contentColor = MaterialTheme.colorScheme.onPrimary,
|
||||
)
|
||||
),
|
||||
contentPadding = PaddingValues(start = 24.dp, top = 10.dp, end = 24.dp, bottom = 10.dp),
|
||||
) {
|
||||
LargeLabelText(
|
||||
text = text,
|
||||
modifier = Modifier.padding(vertical = 10.dp, horizontal = 24.dp),
|
||||
)
|
||||
LargeLabelText(text = text)
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ fun Snackbar(
|
||||
action()
|
||||
}
|
||||
IconButton(onClick = onDismiss, modifier = Modifier.padding(
|
||||
top = 18.dp, bottom = 18.dp, start = 16.dp, end = 24.dp,
|
||||
top = 4.dp, bottom = 4.dp, start = 2.dp, end = 10.dp,
|
||||
)) {
|
||||
Icon(
|
||||
Icons.Filled.Close,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.credentialmanager.common.ui
|
||||
|
||||
import androidx.compose.foundation.layout.wrapContentHeight
|
||||
import androidx.compose.foundation.layout.wrapContentSize
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -32,7 +32,7 @@ import androidx.compose.ui.text.style.TextAlign
|
||||
@Composable
|
||||
fun HeadlineText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
textAlign = TextAlign.Center,
|
||||
@@ -46,7 +46,7 @@ fun HeadlineText(text: String, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
fun BodyMediumText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
@@ -59,7 +59,7 @@ fun BodyMediumText(text: String, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
fun BodySmallText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
@@ -72,7 +72,7 @@ fun BodySmallText(text: String, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
fun LargeTitleText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
@@ -85,7 +85,7 @@ fun LargeTitleText(text: String, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
fun SmallTitleText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
@@ -98,7 +98,7 @@ fun SmallTitleText(text: String, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
fun SectionHeaderText(text: String, modifier: Modifier = Modifier, color: Color) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = color,
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
@@ -111,7 +111,7 @@ fun SectionHeaderText(text: String, modifier: Modifier = Modifier, color: Color)
|
||||
@Composable
|
||||
fun SnackbarContentText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.inverseOnSurface,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
@@ -124,7 +124,7 @@ fun SnackbarContentText(text: String, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
fun SnackbarActionText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.inversePrimary,
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
@@ -137,7 +137,7 @@ fun SnackbarActionText(text: String, modifier: Modifier = Modifier) {
|
||||
@Composable
|
||||
fun LargeLabelTextOnSurfaceVariant(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
textAlign = TextAlign.Center,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
@@ -151,7 +151,7 @@ fun LargeLabelTextOnSurfaceVariant(text: String, modifier: Modifier = Modifier)
|
||||
@Composable
|
||||
fun LargeLabelText(text: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
modifier = modifier.wrapContentHeight(),
|
||||
modifier = modifier.wrapContentSize(),
|
||||
text = text,
|
||||
textAlign = TextAlign.Center,
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
|
||||
@@ -22,7 +22,9 @@ import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.IntentSenderRequest
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.wrapContentHeight
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
@@ -454,13 +456,13 @@ fun RemoteCredentialSnackBarScreen(
|
||||
Snackbar(
|
||||
action = {
|
||||
TextButton(
|
||||
modifier = Modifier.padding(top = 12.dp, bottom = 12.dp, start = 16.dp),
|
||||
modifier = Modifier.padding(top = 4.dp, bottom = 4.dp, start = 16.dp)
|
||||
.heightIn(min = 32.dp),
|
||||
onClick = { onClick(true) },
|
||||
contentPadding =
|
||||
PaddingValues(start = 0.dp, top = 6.dp, end = 0.dp, bottom = 6.dp),
|
||||
) {
|
||||
SnackbarActionText(
|
||||
text = stringResource(R.string.snackbar_action),
|
||||
Modifier.padding(vertical = 6.dp)
|
||||
)
|
||||
SnackbarActionText(text = stringResource(R.string.snackbar_action))
|
||||
}
|
||||
},
|
||||
onDismiss = onCancel,
|
||||
|
||||
Reference in New Issue
Block a user