Loading packages/CredentialManager/src/com/android/credentialmanager/common/ui/SectionHeader.kt +10 −4 Original line number Diff line number Diff line Loading @@ -27,8 +27,12 @@ import androidx.compose.ui.unit.dp import com.android.credentialmanager.ui.theme.LocalAndroidColorScheme @Composable fun CredentialListSectionHeader(text: String) { InternalSectionHeader(text, LocalAndroidColorScheme.current.colorOnSurfaceVariant) fun CredentialListSectionHeader(text: String, isFirstSection: Boolean) { InternalSectionHeader( text = text, color = LocalAndroidColorScheme.current.colorOnSurfaceVariant, applyTopPadding = !isFirstSection ) } @Composable Loading @@ -37,8 +41,10 @@ fun MoreAboutPasskeySectionHeader(text: String) { } @Composable private fun InternalSectionHeader(text: String, color: Color) { Row(modifier = Modifier.fillMaxWidth().wrapContentHeight().padding(top = 8.dp)) { private fun InternalSectionHeader(text: String, color: Color, applyTopPadding: Boolean = false) { Row(modifier = Modifier.fillMaxWidth().wrapContentHeight().padding( top = if (applyTopPadding) 8.dp else 0.dp )) { SectionHeaderText( text, modifier = Modifier.padding(top = 20.dp, bottom = 8.dp), Loading packages/CredentialManager/src/com/android/credentialmanager/createflow/CreateCredentialComponents.kt +3 −0 Original line number Diff line number Diff line Loading @@ -633,6 +633,7 @@ fun MoreAboutPasskeysIntroCard( } } item { Divider(thickness = 8.dp, color = Color.Transparent) MoreAboutPasskeySectionHeader( text = stringResource(R.string.public_key_cryptography_title) ) Loading @@ -641,6 +642,7 @@ fun MoreAboutPasskeysIntroCard( } } item { Divider(thickness = 8.dp, color = Color.Transparent) MoreAboutPasskeySectionHeader( text = stringResource(R.string.improved_account_security_title) ) Loading @@ -649,6 +651,7 @@ fun MoreAboutPasskeysIntroCard( } } item { Divider(thickness = 8.dp, color = Color.Transparent) MoreAboutPasskeySectionHeader( text = stringResource(R.string.seamless_transition_title) ) Loading packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +22 −5 Original line number Diff line number Diff line Loading @@ -323,12 +323,15 @@ fun AllSignInOptionCard( bottomPadding = 0.dp, ) }) { var isFirstSection = true // For username items(sortedUserNameToCredentialEntryList) { item -> PerUserNameCredentials( perUserNameCredentialEntryList = item, onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } // Locked password manager if (authenticationEntryList.isNotEmpty()) { Loading @@ -336,7 +339,9 @@ fun AllSignInOptionCard( LockedCredentials( authenticationEntryList = authenticationEntryList, onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } } // From another device Loading @@ -346,15 +351,19 @@ fun AllSignInOptionCard( RemoteEntryCard( remoteEntry = remoteEntry, onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } } // Manage sign-ins (action chips) item { ActionChips( providerInfoList = providerInfoList, onEntrySelected = onEntrySelected onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } } onLog(GetCredentialEvent.CREDMAN_GET_CRED_ALL_SIGN_IN_OPTION_CARD) Loading @@ -367,6 +376,7 @@ fun AllSignInOptionCard( fun ActionChips( providerInfoList: List<ProviderInfo>, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { val actionChips = providerInfoList.flatMap { it.actionEntryList } if (actionChips.isEmpty()) { Loading @@ -374,7 +384,8 @@ fun ActionChips( } CredentialListSectionHeader( text = stringResource(R.string.get_dialog_heading_manage_sign_ins) text = stringResource(R.string.get_dialog_heading_manage_sign_ins), isFirstSection = isFirstSection, ) CredentialContainerCard { Column(verticalArrangement = Arrangement.spacedBy(2.dp)) { Loading @@ -389,9 +400,11 @@ fun ActionChips( fun RemoteEntryCard( remoteEntry: RemoteEntryInfo, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { CredentialListSectionHeader( text = stringResource(R.string.get_dialog_heading_from_another_device) text = stringResource(R.string.get_dialog_heading_from_another_device), isFirstSection = isFirstSection, ) CredentialContainerCard { Column( Loading @@ -413,9 +426,11 @@ fun RemoteEntryCard( fun LockedCredentials( authenticationEntryList: List<AuthenticationEntryInfo>, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { CredentialListSectionHeader( text = stringResource(R.string.get_dialog_heading_locked_password_managers) text = stringResource(R.string.get_dialog_heading_locked_password_managers), isFirstSection = isFirstSection, ) CredentialContainerCard { Column( Loading @@ -433,11 +448,13 @@ fun LockedCredentials( fun PerUserNameCredentials( perUserNameCredentialEntryList: PerUserNameCredentialEntryList, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { CredentialListSectionHeader( text = stringResource( R.string.get_dialog_heading_for_username, perUserNameCredentialEntryList.userName ) ), isFirstSection = isFirstSection, ) CredentialContainerCard { Column( Loading Loading
packages/CredentialManager/src/com/android/credentialmanager/common/ui/SectionHeader.kt +10 −4 Original line number Diff line number Diff line Loading @@ -27,8 +27,12 @@ import androidx.compose.ui.unit.dp import com.android.credentialmanager.ui.theme.LocalAndroidColorScheme @Composable fun CredentialListSectionHeader(text: String) { InternalSectionHeader(text, LocalAndroidColorScheme.current.colorOnSurfaceVariant) fun CredentialListSectionHeader(text: String, isFirstSection: Boolean) { InternalSectionHeader( text = text, color = LocalAndroidColorScheme.current.colorOnSurfaceVariant, applyTopPadding = !isFirstSection ) } @Composable Loading @@ -37,8 +41,10 @@ fun MoreAboutPasskeySectionHeader(text: String) { } @Composable private fun InternalSectionHeader(text: String, color: Color) { Row(modifier = Modifier.fillMaxWidth().wrapContentHeight().padding(top = 8.dp)) { private fun InternalSectionHeader(text: String, color: Color, applyTopPadding: Boolean = false) { Row(modifier = Modifier.fillMaxWidth().wrapContentHeight().padding( top = if (applyTopPadding) 8.dp else 0.dp )) { SectionHeaderText( text, modifier = Modifier.padding(top = 20.dp, bottom = 8.dp), Loading
packages/CredentialManager/src/com/android/credentialmanager/createflow/CreateCredentialComponents.kt +3 −0 Original line number Diff line number Diff line Loading @@ -633,6 +633,7 @@ fun MoreAboutPasskeysIntroCard( } } item { Divider(thickness = 8.dp, color = Color.Transparent) MoreAboutPasskeySectionHeader( text = stringResource(R.string.public_key_cryptography_title) ) Loading @@ -641,6 +642,7 @@ fun MoreAboutPasskeysIntroCard( } } item { Divider(thickness = 8.dp, color = Color.Transparent) MoreAboutPasskeySectionHeader( text = stringResource(R.string.improved_account_security_title) ) Loading @@ -649,6 +651,7 @@ fun MoreAboutPasskeysIntroCard( } } item { Divider(thickness = 8.dp, color = Color.Transparent) MoreAboutPasskeySectionHeader( text = stringResource(R.string.seamless_transition_title) ) Loading
packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +22 −5 Original line number Diff line number Diff line Loading @@ -323,12 +323,15 @@ fun AllSignInOptionCard( bottomPadding = 0.dp, ) }) { var isFirstSection = true // For username items(sortedUserNameToCredentialEntryList) { item -> PerUserNameCredentials( perUserNameCredentialEntryList = item, onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } // Locked password manager if (authenticationEntryList.isNotEmpty()) { Loading @@ -336,7 +339,9 @@ fun AllSignInOptionCard( LockedCredentials( authenticationEntryList = authenticationEntryList, onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } } // From another device Loading @@ -346,15 +351,19 @@ fun AllSignInOptionCard( RemoteEntryCard( remoteEntry = remoteEntry, onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } } // Manage sign-ins (action chips) item { ActionChips( providerInfoList = providerInfoList, onEntrySelected = onEntrySelected onEntrySelected = onEntrySelected, isFirstSection = isFirstSection, ) isFirstSection = false } } onLog(GetCredentialEvent.CREDMAN_GET_CRED_ALL_SIGN_IN_OPTION_CARD) Loading @@ -367,6 +376,7 @@ fun AllSignInOptionCard( fun ActionChips( providerInfoList: List<ProviderInfo>, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { val actionChips = providerInfoList.flatMap { it.actionEntryList } if (actionChips.isEmpty()) { Loading @@ -374,7 +384,8 @@ fun ActionChips( } CredentialListSectionHeader( text = stringResource(R.string.get_dialog_heading_manage_sign_ins) text = stringResource(R.string.get_dialog_heading_manage_sign_ins), isFirstSection = isFirstSection, ) CredentialContainerCard { Column(verticalArrangement = Arrangement.spacedBy(2.dp)) { Loading @@ -389,9 +400,11 @@ fun ActionChips( fun RemoteEntryCard( remoteEntry: RemoteEntryInfo, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { CredentialListSectionHeader( text = stringResource(R.string.get_dialog_heading_from_another_device) text = stringResource(R.string.get_dialog_heading_from_another_device), isFirstSection = isFirstSection, ) CredentialContainerCard { Column( Loading @@ -413,9 +426,11 @@ fun RemoteEntryCard( fun LockedCredentials( authenticationEntryList: List<AuthenticationEntryInfo>, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { CredentialListSectionHeader( text = stringResource(R.string.get_dialog_heading_locked_password_managers) text = stringResource(R.string.get_dialog_heading_locked_password_managers), isFirstSection = isFirstSection, ) CredentialContainerCard { Column( Loading @@ -433,11 +448,13 @@ fun LockedCredentials( fun PerUserNameCredentials( perUserNameCredentialEntryList: PerUserNameCredentialEntryList, onEntrySelected: (BaseEntry) -> Unit, isFirstSection: Boolean, ) { CredentialListSectionHeader( text = stringResource( R.string.get_dialog_heading_for_username, perUserNameCredentialEntryList.userName ) ), isFirstSection = isFirstSection, ) CredentialContainerCard { Column( Loading