Loading packages/CredentialManager/src/com/android/credentialmanager/createflow/CreateCredentialComponents.kt +50 −44 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ fun ProviderSelectionCard( } } } if (disabledProviderList != null) { if (disabledProviderList != null && disabledProviderList.isNotEmpty()) { item { MoreOptionsDisabledProvidersRow( disabledProviders = disabledProviderList, Loading Loading @@ -431,7 +431,6 @@ fun MoreOptionsSelectionCard( } } } if (disabledProviderList != null) { item { MoreOptionsDisabledProvidersRow( disabledProviders = disabledProviderList, Loading @@ -439,7 +438,6 @@ fun MoreOptionsSelectionCard( onDisabledPasswordManagerSelected, ) } } // TODO: handle the error situation that if multiple remoteInfos exists enabledProviderList.forEach { if (it.remoteEntry != null) { Loading Loading @@ -748,7 +746,7 @@ fun PrimaryCreateOptionRow( }, contentDescription = null, tint = LocalAndroidColorScheme.current.colorAccentPrimaryVariant, modifier = Modifier.padding(horizontal = 18.dp).size(32.dp) modifier = Modifier.padding(start = 10.dp).size(32.dp) ) }, label = { Loading @@ -759,7 +757,7 @@ fun PrimaryCreateOptionRow( TextOnSurfaceVariant( text = requestDisplayInfo.title, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) TextSecondary( text = if (requestDisplayInfo.subtitle != null) { Loading @@ -770,27 +768,27 @@ fun PrimaryCreateOptionRow( stringResource(R.string.passkey_before_subtitle) }, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } TYPE_PASSWORD_CREDENTIAL -> { TextOnSurfaceVariant( text = requestDisplayInfo.title, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) TextSecondary( // This subtitle would never be null for create password text = requestDisplayInfo.subtitle ?: "", style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else -> { TextOnSurfaceVariant( text = requestDisplayInfo.title, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp, bottom = 16.dp), modifier = Modifier.padding(top = 16.dp, bottom = 16.dp, start = 5.dp), ) } } Loading @@ -810,7 +808,7 @@ fun MoreOptionsInfoRow( onClick = onOptionSelected, icon = { Image( modifier = Modifier.padding(horizontal = 16.dp).size(32.dp), modifier = Modifier.padding(start = 10.dp).size(32.dp), bitmap = providerInfo.icon.toBitmap().asImageBitmap(), contentDescription = null ) Loading @@ -820,12 +818,18 @@ fun MoreOptionsInfoRow( TextOnSurfaceVariant( text = providerInfo.displayName, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) if (createOptionInfo.userProviderDisplayName != null) { TextSecondary( text = createOptionInfo.userProviderDisplayName, style = MaterialTheme.typography.bodyMedium, // TODO: update the logic here for the case there is only total count modifier = if ( createOptionInfo.passwordCount != null || createOptionInfo.passkeyCount != null ) Modifier.padding(start = 5.dp) else Modifier .padding(bottom = 16.dp, start = 5.dp), ) } if (createOptionInfo.passwordCount != null && Loading @@ -839,7 +843,7 @@ fun MoreOptionsInfoRow( createOptionInfo.passkeyCount ), style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else if (createOptionInfo.passwordCount != null) { TextSecondary( Loading @@ -849,7 +853,7 @@ fun MoreOptionsInfoRow( createOptionInfo.passwordCount ), style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else if (createOptionInfo.passkeyCount != null) { TextSecondary( Loading @@ -859,7 +863,7 @@ fun MoreOptionsInfoRow( createOptionInfo.passkeyCount ), style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else if (createOptionInfo.totalCredentialCount != null) { // TODO: Handle the case when there is total count Loading @@ -873,9 +877,10 @@ fun MoreOptionsInfoRow( @OptIn(ExperimentalMaterial3Api::class) @Composable fun MoreOptionsDisabledProvidersRow( disabledProviders: List<ProviderInfo>, disabledProviders: List<ProviderInfo>?, onDisabledPasswordManagerSelected: () -> Unit, ) { if (disabledProviders != null && disabledProviders.isNotEmpty()) { Entry( onClick = onDisabledPasswordManagerSelected, icon = { Loading @@ -890,18 +895,19 @@ fun MoreOptionsDisabledProvidersRow( TextOnSurfaceVariant( text = stringResource(R.string.other_password_manager), style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp, start = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) // TODO: Update the subtitle once design is confirmed TextSecondary( text = disabledProviders.joinToString(separator = ", ") { it.displayName }, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp, start = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } } ) } } @OptIn(ExperimentalMaterial3Api::class) @Composable Loading Loading
packages/CredentialManager/src/com/android/credentialmanager/createflow/CreateCredentialComponents.kt +50 −44 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ fun ProviderSelectionCard( } } } if (disabledProviderList != null) { if (disabledProviderList != null && disabledProviderList.isNotEmpty()) { item { MoreOptionsDisabledProvidersRow( disabledProviders = disabledProviderList, Loading Loading @@ -431,7 +431,6 @@ fun MoreOptionsSelectionCard( } } } if (disabledProviderList != null) { item { MoreOptionsDisabledProvidersRow( disabledProviders = disabledProviderList, Loading @@ -439,7 +438,6 @@ fun MoreOptionsSelectionCard( onDisabledPasswordManagerSelected, ) } } // TODO: handle the error situation that if multiple remoteInfos exists enabledProviderList.forEach { if (it.remoteEntry != null) { Loading Loading @@ -748,7 +746,7 @@ fun PrimaryCreateOptionRow( }, contentDescription = null, tint = LocalAndroidColorScheme.current.colorAccentPrimaryVariant, modifier = Modifier.padding(horizontal = 18.dp).size(32.dp) modifier = Modifier.padding(start = 10.dp).size(32.dp) ) }, label = { Loading @@ -759,7 +757,7 @@ fun PrimaryCreateOptionRow( TextOnSurfaceVariant( text = requestDisplayInfo.title, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) TextSecondary( text = if (requestDisplayInfo.subtitle != null) { Loading @@ -770,27 +768,27 @@ fun PrimaryCreateOptionRow( stringResource(R.string.passkey_before_subtitle) }, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } TYPE_PASSWORD_CREDENTIAL -> { TextOnSurfaceVariant( text = requestDisplayInfo.title, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) TextSecondary( // This subtitle would never be null for create password text = requestDisplayInfo.subtitle ?: "", style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else -> { TextOnSurfaceVariant( text = requestDisplayInfo.title, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp, bottom = 16.dp), modifier = Modifier.padding(top = 16.dp, bottom = 16.dp, start = 5.dp), ) } } Loading @@ -810,7 +808,7 @@ fun MoreOptionsInfoRow( onClick = onOptionSelected, icon = { Image( modifier = Modifier.padding(horizontal = 16.dp).size(32.dp), modifier = Modifier.padding(start = 10.dp).size(32.dp), bitmap = providerInfo.icon.toBitmap().asImageBitmap(), contentDescription = null ) Loading @@ -820,12 +818,18 @@ fun MoreOptionsInfoRow( TextOnSurfaceVariant( text = providerInfo.displayName, style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) if (createOptionInfo.userProviderDisplayName != null) { TextSecondary( text = createOptionInfo.userProviderDisplayName, style = MaterialTheme.typography.bodyMedium, // TODO: update the logic here for the case there is only total count modifier = if ( createOptionInfo.passwordCount != null || createOptionInfo.passkeyCount != null ) Modifier.padding(start = 5.dp) else Modifier .padding(bottom = 16.dp, start = 5.dp), ) } if (createOptionInfo.passwordCount != null && Loading @@ -839,7 +843,7 @@ fun MoreOptionsInfoRow( createOptionInfo.passkeyCount ), style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else if (createOptionInfo.passwordCount != null) { TextSecondary( Loading @@ -849,7 +853,7 @@ fun MoreOptionsInfoRow( createOptionInfo.passwordCount ), style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else if (createOptionInfo.passkeyCount != null) { TextSecondary( Loading @@ -859,7 +863,7 @@ fun MoreOptionsInfoRow( createOptionInfo.passkeyCount ), style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } else if (createOptionInfo.totalCredentialCount != null) { // TODO: Handle the case when there is total count Loading @@ -873,9 +877,10 @@ fun MoreOptionsInfoRow( @OptIn(ExperimentalMaterial3Api::class) @Composable fun MoreOptionsDisabledProvidersRow( disabledProviders: List<ProviderInfo>, disabledProviders: List<ProviderInfo>?, onDisabledPasswordManagerSelected: () -> Unit, ) { if (disabledProviders != null && disabledProviders.isNotEmpty()) { Entry( onClick = onDisabledPasswordManagerSelected, icon = { Loading @@ -890,18 +895,19 @@ fun MoreOptionsDisabledProvidersRow( TextOnSurfaceVariant( text = stringResource(R.string.other_password_manager), style = MaterialTheme.typography.titleLarge, modifier = Modifier.padding(top = 16.dp, start = 16.dp), modifier = Modifier.padding(top = 16.dp, start = 5.dp), ) // TODO: Update the subtitle once design is confirmed TextSecondary( text = disabledProviders.joinToString(separator = ", ") { it.displayName }, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 16.dp, start = 16.dp), modifier = Modifier.padding(bottom = 16.dp, start = 5.dp), ) } } ) } } @OptIn(ExperimentalMaterial3Api::class) @Composable Loading