refactor(about): replace FlowRow with FlexBox

FlexBox is the Compose 1.13 successor of FlowRow and covers the
same wrapping layout with explicit wrap and gap configuration.
This commit is contained in:
OneWay committed 2026-11-22 18:47:27 +08:00
1 parent f2b90026cd
commit 9c71ea26be
1 file changed
+12 -7
@@ -5,7 +5,8 @@ import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.FlexBox
import androidx.compose.foundation.layout.FlexWrap
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@@ -259,9 +260,11 @@ private fun AboutLibraryRow(
} }
if (library.licenses.isNotEmpty()) { if (library.licenses.isNotEmpty()) {
FlowRow( FlexBox(
horizontalArrangement = Arrangement.spacedBy(6.dp), config = {
verticalArrangement = Arrangement.spacedBy(6.dp) wrap(FlexWrap.Wrap)
gap(6.dp)
}
) { ) {
library.licenses.forEach { licenseId -> library.licenses.forEach { licenseId ->
val license = licenses[licenseId] ?: return@forEach val license = licenses[licenseId] ?: return@forEach
@@ -278,13 +281,15 @@ private fun AboutLibraryRow(
} }
if (expanded && (website != null || source != null)) { if (expanded && (website != null || source != null)) {
FlowRow( FlexBox(
modifier = Modifier modifier = Modifier
.padding(top = 2.dp) .padding(top = 2.dp)
.testTag("about_library_expanded_actions") .testTag("about_library_expanded_actions")
.semantics { testTagsAsResourceId = true }, .semantics { testTagsAsResourceId = true },
horizontalArrangement = Arrangement.spacedBy(8.dp), config = {
verticalArrangement = Arrangement.spacedBy(8.dp) wrap(FlexWrap.Wrap)
gap(8.dp)
}
) { ) {
source?.let { url -> source?.let { url ->
OutlinedChoiceButton( OutlinedChoiceButton(