Skip to content

Commit 33a3e36

Browse files
committed
Deprecated FlowLayouts from accompanist
1 parent f3faec8 commit 33a3e36

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

app-nia-catalog/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,5 @@ android {
6767
dependencies {
6868
implementation(project(":core:designsystem"))
6969
implementation(project(":core:ui"))
70-
implementation(libs.accompanist.flowlayout)
7170
implementation(libs.androidx.activity.compose)
7271
}

app-nia-catalog/src/main/java/com/google/samples/apps/niacatalog/ui/Catalog.kt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package com.google.samples.apps.niacatalog.ui
1818

1919
import androidx.compose.foundation.layout.Arrangement
20+
import androidx.compose.foundation.layout.ExperimentalLayoutApi
21+
import androidx.compose.foundation.layout.FlowRow
2022
import androidx.compose.foundation.layout.WindowInsets
2123
import androidx.compose.foundation.layout.add
2224
import androidx.compose.foundation.layout.asPaddingValues
@@ -36,7 +38,6 @@ import androidx.compose.runtime.setValue
3638
import androidx.compose.ui.Modifier
3739
import androidx.compose.ui.res.painterResource
3840
import androidx.compose.ui.unit.dp
39-
import com.google.accompanist.flowlayout.FlowRow
4041
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaButton
4142
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip
4243
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaIconToggleButton
@@ -54,6 +55,7 @@ import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
5455
/**
5556
* Now in Android component catalog.
5657
*/
58+
@OptIn(ExperimentalLayoutApi::class)
5759
@Composable
5860
fun NiaCatalog() {
5961
NiaTheme {
@@ -75,7 +77,7 @@ fun NiaCatalog() {
7577
}
7678
item { Text("Buttons", Modifier.padding(top = 16.dp)) }
7779
item {
78-
FlowRow(mainAxisSpacing = 16.dp) {
80+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
7981
NiaButton(onClick = {}) {
8082
Text(text = "Enabled")
8183
}
@@ -89,7 +91,7 @@ fun NiaCatalog() {
8991
}
9092
item { Text("Disabled buttons", Modifier.padding(top = 16.dp)) }
9193
item {
92-
FlowRow(mainAxisSpacing = 16.dp) {
94+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
9395
NiaButton(
9496
onClick = {},
9597
enabled = false,
@@ -112,7 +114,7 @@ fun NiaCatalog() {
112114
}
113115
item { Text("Buttons with leading icons", Modifier.padding(top = 16.dp)) }
114116
item {
115-
FlowRow(mainAxisSpacing = 16.dp) {
117+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
116118
NiaButton(
117119
onClick = {},
118120
text = { Text(text = "Enabled") },
@@ -138,7 +140,7 @@ fun NiaCatalog() {
138140
}
139141
item { Text("Disabled buttons with leading icons", Modifier.padding(top = 16.dp)) }
140142
item {
141-
FlowRow(mainAxisSpacing = 16.dp) {
143+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
142144
NiaButton(
143145
onClick = {},
144146
enabled = false,
@@ -168,7 +170,7 @@ fun NiaCatalog() {
168170
item { Text("Dropdown menus", Modifier.padding(top = 16.dp)) }
169171
item { Text("Chips", Modifier.padding(top = 16.dp)) }
170172
item {
171-
FlowRow(mainAxisSpacing = 16.dp) {
173+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
172174
var firstChecked by remember { mutableStateOf(false) }
173175
NiaFilterChip(
174176
selected = firstChecked,
@@ -197,7 +199,7 @@ fun NiaCatalog() {
197199
}
198200
item { Text("Icon buttons", Modifier.padding(top = 16.dp)) }
199201
item {
200-
FlowRow(mainAxisSpacing = 16.dp) {
202+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
201203
var firstChecked by remember { mutableStateOf(false) }
202204
NiaIconToggleButton(
203205
checked = firstChecked,
@@ -270,7 +272,7 @@ fun NiaCatalog() {
270272
}
271273
item { Text("View toggle", Modifier.padding(top = 16.dp)) }
272274
item {
273-
FlowRow(mainAxisSpacing = 16.dp) {
275+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
274276
var firstExpanded by remember { mutableStateOf(false) }
275277
NiaViewToggleButton(
276278
expanded = firstExpanded,
@@ -296,7 +298,7 @@ fun NiaCatalog() {
296298
}
297299
item { Text("Tags", Modifier.padding(top = 16.dp)) }
298300
item {
299-
FlowRow(mainAxisSpacing = 16.dp) {
301+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
300302
NiaTopicTag(
301303
followed = true,
302304
onClick = {},

feature/foryou/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ android {
2727
}
2828

2929
dependencies {
30-
implementation(libs.accompanist.flowlayout)
3130
implementation(libs.kotlinx.datetime)
3231
implementation(libs.androidx.activity.compose)
3332
}

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ secrets = "2.0.1"
5353
turbine = "0.12.1"
5454

5555
[libraries]
56-
accompanist-flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist" }
5756
accompanist-systemuicontroller = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist" }
5857
accompanist-testharness = { group = "com.google.accompanist", name = "accompanist-testharness", version.ref = "accompanist" }
5958
android-desugarJdkLibs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "androidDesugarJdkLibs" }

0 commit comments

Comments
 (0)