diff --git a/src/main/kotlin/com/looker/droidify/ui/compose/pages/app_detail/components/ChipGrid.kt b/src/main/kotlin/com/looker/droidify/ui/compose/pages/app_detail/components/ChipGrid.kt index e0e3cfc1..2fd8bb1a 100644 --- a/src/main/kotlin/com/looker/droidify/ui/compose/pages/app_detail/components/ChipGrid.kt +++ b/src/main/kotlin/com/looker/droidify/ui/compose/pages/app_detail/components/ChipGrid.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.looker.droidify.ui.compose.utils.CustomChip @@ -17,10 +18,7 @@ fun PermissionGrid( modifier: Modifier = Modifier, permissions: List ) { - StaggeredGrid( - modifier = modifier.horizontalScroll(rememberScrollState()), - rows = 2 - ) { + StaggeredGrid(modifier = modifier.horizontalScroll(rememberScrollState())) { permissions.forEach { CustomChip(modifier = Modifier.padding(horizontal = 2.dp), text = it) } @@ -32,10 +30,11 @@ fun AntiFeaturesGrid( modifier: Modifier = Modifier, antiFeatures: List ) { - StaggeredGrid( - modifier = modifier.horizontalScroll(rememberScrollState()), - rows = 2 - ) { + val scrollState = rememberScrollState() + LaunchedEffect(Unit) { + scrollState.animateScrollTo(4) + } + StaggeredGrid(modifier = modifier.horizontalScroll(scrollState)) { antiFeatures.forEach { CustomChip( modifier = Modifier.padding(horizontal = 2.dp), diff --git a/src/main/kotlin/com/looker/droidify/ui/compose/utils/Grid.kt b/src/main/kotlin/com/looker/droidify/ui/compose/utils/Grid.kt index 80ff3f8d..8f39ace5 100644 --- a/src/main/kotlin/com/looker/droidify/ui/compose/utils/Grid.kt +++ b/src/main/kotlin/com/looker/droidify/ui/compose/utils/Grid.kt @@ -8,7 +8,7 @@ import kotlin.math.max @Composable fun StaggeredGrid( modifier: Modifier = Modifier, - rows: Int = 3, + rows: Int = 2, content: @Composable () -> Unit ) { Layout(