Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dd8d63a authored by Helen Qin's avatar Helen Qin Committed by Automerger Merge Worker
Browse files

Merge "Remove the 8dp padding between more option bar and the first subheader"...

Merge "Remove the 8dp padding between more option bar and the first subheader" into udc-dev am: bcf660e6 am: 728b0336

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22561153



Change-Id: I8c575dc4786b668c61414786f89f904986540bb7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bae89afc 728b0336
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -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),
+3 −0
Original line number Diff line number Diff line
@@ -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)
            )
+22 −5
Original line number Diff line number Diff line
@@ -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()) {
@@ -336,7 +339,9 @@ fun AllSignInOptionCard(
                LockedCredentials(
                    authenticationEntryList = authenticationEntryList,
                    onEntrySelected = onEntrySelected,
                    isFirstSection = isFirstSection,
                )
                isFirstSection = false
            }
        }
        // From another device
@@ -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)
@@ -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()) {
@@ -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)) {
@@ -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(
@@ -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(
@@ -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(