Loading packages/CredentialManager/src/com/android/credentialmanager/CredentialManagerRepo.kt +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ class CredentialManagerRepo( // TODO: handle runtime cast error providerEnabledList as List<GetCredentialProviderData>, context) // TODO: covert from real requestInfo val requestDisplayInfo = com.android.credentialmanager.getflow.RequestDisplayInfo("tribank") val requestDisplayInfo = com.android.credentialmanager.getflow.RequestDisplayInfo("the app") return GetCredentialUiState( providerEnabledList, GetScreenState.PRIMARY_SELECTION, Loading packages/CredentialManager/src/com/android/credentialmanager/common/material/ModalBottomSheet.kt +2 −3 Original line number Diff line number Diff line Loading @@ -62,7 +62,6 @@ import com.android.credentialmanager.R import com.android.credentialmanager.common.material.ModalBottomSheetValue.Expanded import com.android.credentialmanager.common.material.ModalBottomSheetValue.HalfExpanded import com.android.credentialmanager.common.material.ModalBottomSheetValue.Hidden import com.android.credentialmanager.ui.theme.LocalAndroidColorScheme import kotlinx.coroutines.CancellationException import kotlinx.coroutines.launch import kotlin.math.max Loading Loading @@ -319,7 +318,7 @@ fun ModalBottomSheetLayout( rememberModalBottomSheetState(Hidden), sheetShape: Shape = MaterialTheme.shapes.large, sheetElevation: Dp = ModalBottomSheetDefaults.Elevation, sheetBackgroundColor: Color = ModalBottomSheetDefaults.scrimColor, sheetBackgroundColor: Color = MaterialTheme.colorScheme.surface, sheetContentColor: Color = contentColorFor(sheetBackgroundColor), scrimColor: Color = ModalBottomSheetDefaults.scrimColor, content: @Composable () -> Unit Loading Loading @@ -477,5 +476,5 @@ object ModalBottomSheetDefaults { */ val scrimColor: Color @Composable get() = LocalAndroidColorScheme.current.colorSurfaceHighlight get() = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.32f) } No newline at end of file packages/CredentialManager/src/com/android/credentialmanager/common/ui/CancelButton.kt +8 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,20 @@ package com.android.credentialmanager.common.ui import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable @Composable fun CancelButton(text: String, onClick: () -> Unit) { TextButton(onClick = onClick) { TextButton( onClick = onClick, colors = ButtonDefaults.textButtonColors( contentColor = MaterialTheme.colorScheme.primary, ) ) { Text(text = text) } } No newline at end of file packages/CredentialManager/src/com/android/credentialmanager/common/ui/Cards.kt 0 → 100644 +50 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.credentialmanager.common.ui import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.layout.ColumnScope import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Shape /** * By default the card is filled with surfaceVariant color. This container card instead fills the * background color with surface corlor. */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun ContainerCard( modifier: Modifier = Modifier, shape: Shape = CardDefaults.shape, border: BorderStroke? = null, content: @Composable ColumnScope.() -> Unit, ) { Card( modifier = modifier, shape = shape, border = border, colors = CardDefaults.cardColors( containerColor = MaterialTheme.colorScheme.surface, ), content = content, ) } No newline at end of file packages/CredentialManager/src/com/android/credentialmanager/common/ui/ConfirmButton.kt +9 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,21 @@ package com.android.credentialmanager.common.ui import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @Composable fun ConfirmButton(text: String, onClick: () -> Unit) { FilledTonalButton(onClick = onClick) { FilledTonalButton( onClick = onClick, colors = ButtonDefaults.filledTonalButtonColors( containerColor = MaterialTheme.colorScheme.primaryContainer, contentColor = MaterialTheme.colorScheme.onPrimaryContainer, ) ) { Text(text = text) } } No newline at end of file Loading
packages/CredentialManager/src/com/android/credentialmanager/CredentialManagerRepo.kt +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ class CredentialManagerRepo( // TODO: handle runtime cast error providerEnabledList as List<GetCredentialProviderData>, context) // TODO: covert from real requestInfo val requestDisplayInfo = com.android.credentialmanager.getflow.RequestDisplayInfo("tribank") val requestDisplayInfo = com.android.credentialmanager.getflow.RequestDisplayInfo("the app") return GetCredentialUiState( providerEnabledList, GetScreenState.PRIMARY_SELECTION, Loading
packages/CredentialManager/src/com/android/credentialmanager/common/material/ModalBottomSheet.kt +2 −3 Original line number Diff line number Diff line Loading @@ -62,7 +62,6 @@ import com.android.credentialmanager.R import com.android.credentialmanager.common.material.ModalBottomSheetValue.Expanded import com.android.credentialmanager.common.material.ModalBottomSheetValue.HalfExpanded import com.android.credentialmanager.common.material.ModalBottomSheetValue.Hidden import com.android.credentialmanager.ui.theme.LocalAndroidColorScheme import kotlinx.coroutines.CancellationException import kotlinx.coroutines.launch import kotlin.math.max Loading Loading @@ -319,7 +318,7 @@ fun ModalBottomSheetLayout( rememberModalBottomSheetState(Hidden), sheetShape: Shape = MaterialTheme.shapes.large, sheetElevation: Dp = ModalBottomSheetDefaults.Elevation, sheetBackgroundColor: Color = ModalBottomSheetDefaults.scrimColor, sheetBackgroundColor: Color = MaterialTheme.colorScheme.surface, sheetContentColor: Color = contentColorFor(sheetBackgroundColor), scrimColor: Color = ModalBottomSheetDefaults.scrimColor, content: @Composable () -> Unit Loading Loading @@ -477,5 +476,5 @@ object ModalBottomSheetDefaults { */ val scrimColor: Color @Composable get() = LocalAndroidColorScheme.current.colorSurfaceHighlight get() = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.32f) } No newline at end of file
packages/CredentialManager/src/com/android/credentialmanager/common/ui/CancelButton.kt +8 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,20 @@ package com.android.credentialmanager.common.ui import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable @Composable fun CancelButton(text: String, onClick: () -> Unit) { TextButton(onClick = onClick) { TextButton( onClick = onClick, colors = ButtonDefaults.textButtonColors( contentColor = MaterialTheme.colorScheme.primary, ) ) { Text(text = text) } } No newline at end of file
packages/CredentialManager/src/com/android/credentialmanager/common/ui/Cards.kt 0 → 100644 +50 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.credentialmanager.common.ui import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.layout.ColumnScope import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Shape /** * By default the card is filled with surfaceVariant color. This container card instead fills the * background color with surface corlor. */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun ContainerCard( modifier: Modifier = Modifier, shape: Shape = CardDefaults.shape, border: BorderStroke? = null, content: @Composable ColumnScope.() -> Unit, ) { Card( modifier = modifier, shape = shape, border = border, colors = CardDefaults.cardColors( containerColor = MaterialTheme.colorScheme.surface, ), content = content, ) } No newline at end of file
packages/CredentialManager/src/com/android/credentialmanager/common/ui/ConfirmButton.kt +9 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,21 @@ package com.android.credentialmanager.common.ui import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @Composable fun ConfirmButton(text: String, onClick: () -> Unit) { FilledTonalButton(onClick = onClick) { FilledTonalButton( onClick = onClick, colors = ButtonDefaults.filledTonalButtonColors( containerColor = MaterialTheme.colorScheme.primaryContainer, contentColor = MaterialTheme.colorScheme.onPrimaryContainer, ) ) { Text(text = text) } } No newline at end of file