From 788735fbdae81013553689d32f9b5ca828b1d76c Mon Sep 17 00:00:00 2001 From: Iamlooker Date: Sun, 24 Apr 2022 13:51:12 +0530 Subject: [PATCH] Cleanup --- .../ui/compose/pages/app_detail/components/ChipGrid.kt | 7 +------ .../kotlin/com/looker/droidify/ui/compose/utils/Chip.kt | 6 +++++- 2 files changed, 6 insertions(+), 7 deletions(-) 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 2fd8bb1a..e7dd83f5 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,7 +5,6 @@ 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 @@ -30,11 +29,7 @@ fun AntiFeaturesGrid( modifier: Modifier = Modifier, antiFeatures: List ) { - val scrollState = rememberScrollState() - LaunchedEffect(Unit) { - scrollState.animateScrollTo(4) - } - StaggeredGrid(modifier = modifier.horizontalScroll(scrollState)) { + StaggeredGrid(modifier = modifier.horizontalScroll(rememberScrollState())) { antiFeatures.forEach { CustomChip( modifier = Modifier.padding(horizontal = 2.dp), diff --git a/src/main/kotlin/com/looker/droidify/ui/compose/utils/Chip.kt b/src/main/kotlin/com/looker/droidify/ui/compose/utils/Chip.kt index ae4d933c..1111fdeb 100644 --- a/src/main/kotlin/com/looker/droidify/ui/compose/utils/Chip.kt +++ b/src/main/kotlin/com/looker/droidify/ui/compose/utils/Chip.kt @@ -14,6 +14,10 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp // TODO: Rename + +/** + * Basically a OutlineChip without spamming "ExperimentalMaterialApi" + */ @OptIn(ExperimentalMaterialApi::class) @Composable fun CustomChip( @@ -41,4 +45,4 @@ fun CustomChip( ) { Text(text = text, color = borderColor) } -} \ No newline at end of file +}