Remove the 8dp padding between more option bar and the first subheader
Bug: 277648290 Test: manual (see bug for screenshots) Change-Id: Ib64ff66d075c37dfd77b50b0e8f867f3a2ec0006
This commit is contained in:
@@ -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
|
||||
@@ -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),
|
||||
|
||||
@@ -633,6 +633,7 @@ fun MoreAboutPasskeysIntroCard(
|
||||
}
|
||||
}
|
||||
item {
|
||||
Divider(thickness = 8.dp, color = Color.Transparent)
|
||||
MoreAboutPasskeySectionHeader(
|
||||
text = stringResource(R.string.public_key_cryptography_title)
|
||||
)
|
||||
@@ -641,6 +642,7 @@ fun MoreAboutPasskeysIntroCard(
|
||||
}
|
||||
}
|
||||
item {
|
||||
Divider(thickness = 8.dp, color = Color.Transparent)
|
||||
MoreAboutPasskeySectionHeader(
|
||||
text = stringResource(R.string.improved_account_security_title)
|
||||
)
|
||||
@@ -649,6 +651,7 @@ fun MoreAboutPasskeysIntroCard(
|
||||
}
|
||||
}
|
||||
item {
|
||||
Divider(thickness = 8.dp, color = Color.Transparent)
|
||||
MoreAboutPasskeySectionHeader(
|
||||
text = stringResource(R.string.seamless_transition_title)
|
||||
)
|
||||
|
||||
@@ -322,12 +322,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()) {
|
||||
@@ -335,7 +338,9 @@ fun AllSignInOptionCard(
|
||||
LockedCredentials(
|
||||
authenticationEntryList = authenticationEntryList,
|
||||
onEntrySelected = onEntrySelected,
|
||||
isFirstSection = isFirstSection,
|
||||
)
|
||||
isFirstSection = false
|
||||
}
|
||||
}
|
||||
// From another device
|
||||
@@ -345,15 +350,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)
|
||||
@@ -366,6 +375,7 @@ fun AllSignInOptionCard(
|
||||
fun ActionChips(
|
||||
providerInfoList: List<ProviderInfo>,
|
||||
onEntrySelected: (BaseEntry) -> Unit,
|
||||
isFirstSection: Boolean,
|
||||
) {
|
||||
val actionChips = providerInfoList.flatMap { it.actionEntryList }
|
||||
if (actionChips.isEmpty()) {
|
||||
@@ -373,7 +383,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)) {
|
||||
@@ -388,9 +399,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(
|
||||
@@ -412,9 +425,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(
|
||||
@@ -432,11 +447,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(
|
||||
|
||||
Reference in New Issue
Block a user