From 80d4783cc58f84bec854b93100ed7c2bab60128c Mon Sep 17 00:00:00 2001 From: Shrisha Udupa Date: Fri, 14 Feb 2025 13:40:06 +0100 Subject: Fix time overlap issue in Sign-in Options screen of Credential Manager There is an issue of time overlapping with other content as the user scrolls in Sign-in options screen of Address book app in Credential Manager. This change fixes the issue by changing the columnState of MultiCredentialsFlattenScreen from being set to be laid out directly below the time text to being passed as a parameter through the scrollable just like the other screens. Bug: 377251580 Test: Open Address Book -> Login -> Sign-in options. Scroll through the screen and check that the time text at the top doesn't overlap with other content in the screen. Screenrecording of the fix attached in the bug. Change-Id: I9bf964a6783dfb088f9f74ee063de7d75386e8f8 --- .../wear/src/com/android/credentialmanager/ui/WearApp.kt | 1 + .../ui/screens/multiple/MultiCredentialsFlattenScreen.kt | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/WearApp.kt b/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/WearApp.kt index d6e19a6193fd..a75aeaff0c48 100644 --- a/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/WearApp.kt +++ b/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/WearApp.kt @@ -104,6 +104,7 @@ fun WearApp( scrollable(Screen.MultipleCredentialsScreenFlatten.route) { MultiCredentialsFlattenScreen( credentialSelectorUiState = (remember { uiState } as MultipleEntry), + columnState = it.columnState, flowEngine = flowEngine, ) } diff --git a/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/screens/multiple/MultiCredentialsFlattenScreen.kt b/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/screens/multiple/MultiCredentialsFlattenScreen.kt index 932b3456bfb8..96cadab3916a 100644 --- a/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/screens/multiple/MultiCredentialsFlattenScreen.kt +++ b/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/screens/multiple/MultiCredentialsFlattenScreen.kt @@ -36,7 +36,7 @@ import com.android.credentialmanager.model.get.CredentialEntryInfo import com.android.credentialmanager.ui.components.CredentialsScreenChipSpacer import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.rememberColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnState import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults import androidx.compose.ui.text.style.TextAlign import androidx.wear.compose.material.MaterialTheme as WearMaterialTheme @@ -45,6 +45,7 @@ import androidx.wear.compose.material.MaterialTheme as WearMaterialTheme * Screen that shows multiple credentials to select from, grouped by accounts * * @param credentialSelectorUiState The app bar view model. + * @param columnState ScalingLazyColumn configuration to be be applied * @param modifier styling for composable * @param flowEngine [FlowEngine] that updates ui state for this screen */ @@ -52,15 +53,14 @@ import androidx.wear.compose.material.MaterialTheme as WearMaterialTheme @Composable fun MultiCredentialsFlattenScreen( credentialSelectorUiState: MultipleEntry, + columnState: ScalingLazyColumnState, flowEngine: FlowEngine, ) { val selectEntry = flowEngine.getEntrySelector() Row { Spacer(Modifier.weight(0.052f)) // 5.2% side margin ScalingLazyColumn( - columnState = rememberColumnState( - ScalingLazyColumnDefaults.belowTimeText(horizontalAlignment = Alignment.Start), - ), + columnState = columnState, modifier = Modifier.weight(0.896f).fillMaxSize(), // 5.2% side margin ) { -- cgit v1.2.3-59-g8ed1b