Merge "[CredManUI] UI style P0 fixes" into udc-dev am: 7c6bfeca10
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21614502 Change-Id: Ida60b0a3c1a305a0f8267f465304b34392cf8fc0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -24,8 +24,6 @@ enum class DialogState {
|
|||||||
|
|
||||||
enum class ResultState {
|
enum class ResultState {
|
||||||
COMPLETE,
|
COMPLETE,
|
||||||
NORMAL_CANCELED,
|
|
||||||
LAUNCH_SETTING_CANCELED
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data class DialogResult(
|
data class DialogResult(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.credentialmanager.common.ui
|
package com.android.credentialmanager.common.ui
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import com.android.credentialmanager.R
|
import com.android.credentialmanager.R
|
||||||
import androidx.compose.material.Icon
|
import androidx.compose.material.Icon
|
||||||
@@ -33,7 +34,6 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.android.credentialmanager.ui.theme.LocalAndroidColorScheme
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ActionButton(text: String, onClick: () -> Unit) {
|
fun ActionButton(text: String, onClick: () -> Unit) {
|
||||||
@@ -42,12 +42,10 @@ fun ActionButton(text: String, onClick: () -> Unit) {
|
|||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
colors = ButtonDefaults.textButtonColors(
|
colors = ButtonDefaults.textButtonColors(
|
||||||
contentColor = MaterialTheme.colorScheme.primary,
|
contentColor = MaterialTheme.colorScheme.primary,
|
||||||
)
|
),
|
||||||
|
contentPadding = PaddingValues(start = 12.dp, top = 10.dp, end = 12.dp, bottom = 10.dp),
|
||||||
) {
|
) {
|
||||||
LargeLabelText(
|
LargeLabelText(text = text)
|
||||||
text = text,
|
|
||||||
modifier = Modifier.padding(vertical = 10.dp, horizontal = 12.dp),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +67,7 @@ fun ToggleVisibilityButton(modifier: Modifier = Modifier, onToggle: (Boolean) ->
|
|||||||
contentDescription = if (toggleState.value)
|
contentDescription = if (toggleState.value)
|
||||||
stringResource(R.string.content_description_show_password) else
|
stringResource(R.string.content_description_show_password) else
|
||||||
stringResource(R.string.content_description_hide_password),
|
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
|
package com.android.credentialmanager.common.ui
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material3.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
import androidx.compose.material3.FilledTonalButton
|
import androidx.compose.material3.FilledTonalButton
|
||||||
@@ -33,11 +34,9 @@ fun ConfirmButton(text: String, onClick: () -> Unit) {
|
|||||||
colors = ButtonDefaults.filledTonalButtonColors(
|
colors = ButtonDefaults.filledTonalButtonColors(
|
||||||
containerColor = MaterialTheme.colorScheme.primary,
|
containerColor = MaterialTheme.colorScheme.primary,
|
||||||
contentColor = MaterialTheme.colorScheme.onPrimary,
|
contentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
)
|
),
|
||||||
|
contentPadding = PaddingValues(start = 24.dp, top = 10.dp, end = 24.dp, bottom = 10.dp),
|
||||||
) {
|
) {
|
||||||
LargeLabelText(
|
LargeLabelText(text = text)
|
||||||
text = text,
|
|
||||||
modifier = Modifier.padding(vertical = 10.dp, horizontal = 24.dp),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ fun Snackbar(
|
|||||||
action()
|
action()
|
||||||
}
|
}
|
||||||
IconButton(onClick = onDismiss, modifier = Modifier.padding(
|
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(
|
Icon(
|
||||||
Icons.Filled.Close,
|
Icons.Filled.Close,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package com.android.credentialmanager.common.ui
|
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.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -32,7 +32,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|||||||
@Composable
|
@Composable
|
||||||
fun HeadlineText(text: String, modifier: Modifier = Modifier) {
|
fun HeadlineText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
@@ -46,7 +46,7 @@ fun HeadlineText(text: String, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun BodyMediumText(text: String, modifier: Modifier = Modifier) {
|
fun BodyMediumText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
@@ -59,7 +59,7 @@ fun BodyMediumText(text: String, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun BodySmallText(text: String, modifier: Modifier = Modifier) {
|
fun BodySmallText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
style = MaterialTheme.typography.bodySmall,
|
style = MaterialTheme.typography.bodySmall,
|
||||||
@@ -72,7 +72,7 @@ fun BodySmallText(text: String, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun LargeTitleText(text: String, modifier: Modifier = Modifier) {
|
fun LargeTitleText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
style = MaterialTheme.typography.titleLarge,
|
style = MaterialTheme.typography.titleLarge,
|
||||||
@@ -85,7 +85,7 @@ fun LargeTitleText(text: String, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun SmallTitleText(text: String, modifier: Modifier = Modifier) {
|
fun SmallTitleText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
@@ -98,7 +98,7 @@ fun SmallTitleText(text: String, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun SectionHeaderText(text: String, modifier: Modifier = Modifier, color: Color) {
|
fun SectionHeaderText(text: String, modifier: Modifier = Modifier, color: Color) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = color,
|
color = color,
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
@@ -111,7 +111,7 @@ fun SectionHeaderText(text: String, modifier: Modifier = Modifier, color: Color)
|
|||||||
@Composable
|
@Composable
|
||||||
fun SnackbarContentText(text: String, modifier: Modifier = Modifier) {
|
fun SnackbarContentText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.inverseOnSurface,
|
color = MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
@@ -124,7 +124,7 @@ fun SnackbarContentText(text: String, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun SnackbarActionText(text: String, modifier: Modifier = Modifier) {
|
fun SnackbarActionText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.inversePrimary,
|
color = MaterialTheme.colorScheme.inversePrimary,
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
@@ -137,7 +137,7 @@ fun SnackbarActionText(text: String, modifier: Modifier = Modifier) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun LargeLabelTextOnSurfaceVariant(text: String, modifier: Modifier = Modifier) {
|
fun LargeLabelTextOnSurfaceVariant(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
@@ -151,7 +151,7 @@ fun LargeLabelTextOnSurfaceVariant(text: String, modifier: Modifier = Modifier)
|
|||||||
@Composable
|
@Composable
|
||||||
fun LargeLabelText(text: String, modifier: Modifier = Modifier) {
|
fun LargeLabelText(text: String, modifier: Modifier = Modifier) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier.wrapContentHeight(),
|
modifier = modifier.wrapContentSize(),
|
||||||
text = text,
|
text = text,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ import androidx.activity.result.ActivityResult
|
|||||||
import androidx.activity.result.IntentSenderRequest
|
import androidx.activity.result.IntentSenderRequest
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.heightIn
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.wrapContentHeight
|
import androidx.compose.foundation.layout.wrapContentHeight
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
@@ -454,13 +456,13 @@ fun RemoteCredentialSnackBarScreen(
|
|||||||
Snackbar(
|
Snackbar(
|
||||||
action = {
|
action = {
|
||||||
TextButton(
|
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) },
|
onClick = { onClick(true) },
|
||||||
|
contentPadding =
|
||||||
|
PaddingValues(start = 0.dp, top = 6.dp, end = 0.dp, bottom = 6.dp),
|
||||||
) {
|
) {
|
||||||
SnackbarActionText(
|
SnackbarActionText(text = stringResource(R.string.snackbar_action))
|
||||||
text = stringResource(R.string.snackbar_action),
|
|
||||||
Modifier.padding(vertical = 6.dp)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onDismiss = onCancel,
|
onDismiss = onCancel,
|
||||||
|
|||||||
Reference in New Issue
Block a user