Loading packages/CredentialManager/wear/res/values/strings.xml +5 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,10 @@ <string name="dialog_sign_in_options_button">Sign-in Options</string> <!-- Title for multiple credentials folded screen. [CHAR LIMIT=NONE] --> <string name="sign_in_options_title">Sign-in Options</string> <!-- Title for multiple credentials flattened screen. [CHAR LIMIT=NONE] --> <!-- Title for multiple credentials screen. [CHAR LIMIT=NONE] --> <string name="choose_sign_in_title">Choose a sign in</string> <!-- Title for multiple credentials screen with only passkeys. [CHAR LIMIT=NONE] --> <string name="choose_passkey_title">Choose passkey</string> <!-- Title for multiple credentials screen with only passwords. [CHAR LIMIT=NONE] --> <string name="choose_password_title">Choose password</string> </resources> No newline at end of file packages/CredentialManager/wear/src/com/android/credentialmanager/CredentialSelectorViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class CredentialSelectorViewModel @Inject constructor( sealed class CredentialSelectorUiState { data object Idle : CredentialSelectorUiState() sealed class Get() : CredentialSelectorUiState() { sealed class Get : CredentialSelectorUiState() { data class SingleEntry(val entry: CredentialEntryInfo) : Get() data class SingleEntryPerAccount(val sortedEntries: List<CredentialEntryInfo>) : Get() data class MultipleEntry( Loading packages/CredentialManager/wear/src/com/android/credentialmanager/ui/screens/multiple/MultiCredentialsFoldScreen.kt +12 −4 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.credentialmanager.ui.components.SignInOptionsChip import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.compose.layout.ScalingLazyColumn import com.google.android.horologist.compose.layout.ScalingLazyColumnState import com.android.credentialmanager.model.CredentialType /** * Screen that shows multiple credentials to select from. Loading Loading @@ -113,17 +114,25 @@ fun MultiCredentialsFoldScreen( columnState = columnState, modifier = modifier.fillMaxSize(), ) { // flatten all credentials into one val credentials = state.accounts.flatMap { it.sortedCredentialEntryList } item { var title = stringResource(R.string.choose_sign_in_title) if (credentials.all{ it.credentialType == CredentialType.PASSKEY }) { title = stringResource(R.string.choose_passkey_title) } else if (credentials.all { it.credentialType == CredentialType.PASSWORD }) { title = stringResource(R.string.choose_password_title) } SignInHeader( icon = screenIcon, title = stringResource(R.string.choose_sign_in_title), title = title, modifier = Modifier .padding(top = 6.dp), ) } state.accounts.forEach { it.sortedCredentialEntryList.forEach { credential: CredentialEntryInfo -> credentials.forEach { credential: CredentialEntryInfo -> item { CredentialsScreenChip( label = credential.userName, Loading @@ -133,7 +142,6 @@ fun MultiCredentialsFoldScreen( ) } } } item { SignInOptionsChip(onSignInOptionsClicked) } item { DismissChip(onCancelClicked) } } Loading Loading
packages/CredentialManager/wear/res/values/strings.xml +5 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,10 @@ <string name="dialog_sign_in_options_button">Sign-in Options</string> <!-- Title for multiple credentials folded screen. [CHAR LIMIT=NONE] --> <string name="sign_in_options_title">Sign-in Options</string> <!-- Title for multiple credentials flattened screen. [CHAR LIMIT=NONE] --> <!-- Title for multiple credentials screen. [CHAR LIMIT=NONE] --> <string name="choose_sign_in_title">Choose a sign in</string> <!-- Title for multiple credentials screen with only passkeys. [CHAR LIMIT=NONE] --> <string name="choose_passkey_title">Choose passkey</string> <!-- Title for multiple credentials screen with only passwords. [CHAR LIMIT=NONE] --> <string name="choose_password_title">Choose password</string> </resources> No newline at end of file
packages/CredentialManager/wear/src/com/android/credentialmanager/CredentialSelectorViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class CredentialSelectorViewModel @Inject constructor( sealed class CredentialSelectorUiState { data object Idle : CredentialSelectorUiState() sealed class Get() : CredentialSelectorUiState() { sealed class Get : CredentialSelectorUiState() { data class SingleEntry(val entry: CredentialEntryInfo) : Get() data class SingleEntryPerAccount(val sortedEntries: List<CredentialEntryInfo>) : Get() data class MultipleEntry( Loading
packages/CredentialManager/wear/src/com/android/credentialmanager/ui/screens/multiple/MultiCredentialsFoldScreen.kt +12 −4 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.credentialmanager.ui.components.SignInOptionsChip import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.compose.layout.ScalingLazyColumn import com.google.android.horologist.compose.layout.ScalingLazyColumnState import com.android.credentialmanager.model.CredentialType /** * Screen that shows multiple credentials to select from. Loading Loading @@ -113,17 +114,25 @@ fun MultiCredentialsFoldScreen( columnState = columnState, modifier = modifier.fillMaxSize(), ) { // flatten all credentials into one val credentials = state.accounts.flatMap { it.sortedCredentialEntryList } item { var title = stringResource(R.string.choose_sign_in_title) if (credentials.all{ it.credentialType == CredentialType.PASSKEY }) { title = stringResource(R.string.choose_passkey_title) } else if (credentials.all { it.credentialType == CredentialType.PASSWORD }) { title = stringResource(R.string.choose_password_title) } SignInHeader( icon = screenIcon, title = stringResource(R.string.choose_sign_in_title), title = title, modifier = Modifier .padding(top = 6.dp), ) } state.accounts.forEach { it.sortedCredentialEntryList.forEach { credential: CredentialEntryInfo -> credentials.forEach { credential: CredentialEntryInfo -> item { CredentialsScreenChip( label = credential.userName, Loading @@ -133,7 +142,6 @@ fun MultiCredentialsFoldScreen( ) } } } item { SignInOptionsChip(onSignInOptionsClicked) } item { DismissChip(onCancelClicked) } } Loading