From 9c71ea26beb3fa3787e6128b0b79936b70dd88cd Mon Sep 17 00:00:00 2001 From: OneWay Date: Sun, 22 Nov 2026 18:43:24 +0800 Subject: [PATCH] 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. --- .../example/research/ui/about/AboutScreen.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/example/research/ui/about/AboutScreen.kt b/app/src/main/java/com/example/research/ui/about/AboutScreen.kt index 4bd2d3e..43a32fd 100644 --- a/app/src/main/java/com/example/research/ui/about/AboutScreen.kt +++ b/app/src/main/java/com/example/research/ui/about/AboutScreen.kt @@ -5,7 +5,8 @@ import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.tween import androidx.compose.foundation.layout.Arrangement 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.Spacer import androidx.compose.foundation.layout.fillMaxSize @@ -259,9 +260,11 @@ private fun AboutLibraryRow( } if (library.licenses.isNotEmpty()) { - FlowRow( - horizontalArrangement = Arrangement.spacedBy(6.dp), - verticalArrangement = Arrangement.spacedBy(6.dp) + FlexBox( + config = { + wrap(FlexWrap.Wrap) + gap(6.dp) + } ) { library.licenses.forEach { licenseId -> val license = licenses[licenseId] ?: return@forEach @@ -278,13 +281,15 @@ private fun AboutLibraryRow( } if (expanded && (website != null || source != null)) { - FlowRow( + FlexBox( modifier = Modifier .padding(top = 2.dp) .testTag("about_library_expanded_actions") .semantics { testTagsAsResourceId = true }, - horizontalArrangement = Arrangement.spacedBy(8.dp), - verticalArrangement = Arrangement.spacedBy(8.dp) + config = { + wrap(FlexWrap.Wrap) + gap(8.dp) + } ) { source?.let { url -> OutlinedChoiceButton(