diff options
6 files changed, 28 insertions, 31 deletions
diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/DialogResult.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/DialogResult.kt index 6d07df70e7bf..297143309d14 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/common/DialogResult.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/common/DialogResult.kt @@ -24,8 +24,6 @@ enum class DialogState { enum class ResultState { COMPLETE, - NORMAL_CANCELED, - LAUNCH_SETTING_CANCELED } data class DialogResult( diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ActionButton.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ActionButton.kt index b94840f369e1..04a2c07da388 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ActionButton.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ActionButton.kt @@ -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, ) } }
\ No newline at end of file diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ConfirmButton.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ConfirmButton.kt index 8f48f6bf7b23..c09a692ce9fc 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ConfirmButton.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/ConfirmButton.kt @@ -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) } }
\ No newline at end of file diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt index 8061da79a5ae..514ff90be8d7 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt @@ -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, diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/Texts.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/Texts.kt index 8f7c37efe787..8af729ecdc25 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/Texts.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/Texts.kt @@ -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, diff --git a/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt b/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt index 54f8e5cea798..92a6c390e276 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt @@ -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, |