Fixed
Status Update
Comments
ma...@marcardar.com <ma...@marcardar.com> #2
I'm also interested in this. Perhaps there could be some equivalent to TextOverflow
for how to handle when not all items fit, but with a Composable
arg for the ellipsis.
ti...@google.com <ti...@google.com>
ma...@google.com <ma...@google.com>
uo...@google.com <uo...@google.com>
sa...@google.com <sa...@google.com> #3
Our team is also affected by this. Please keep us in the loop if you add this support into FlowRow!
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit eed1e666ab45070e18718653c99fc4aee50315d6
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Thu Nov 23 03:13:50 2023
Enhance FlowRow/Column & Introduce ContextualFlowRow with MaxLines & Overflow
This update enhances FlowRow and FlowColumn with support for maxLines and an overflow parameter, improving layout flexibility. It also introduces the ContextualFlowRow, utilizing SubcomposeLayout for efficient handling of large number of items by composing only those within the viewport.
Key Additions: maxLines/maxHeight/maxWidth overflow support in FlowRow/FlowColumn for improved item management. ContextualFlowRow/ContextualFlowColumn for efficient lazy initialization perfect for large number of items
Bug: 293577082
Test: Tested
Relnote: "Introducing ContextualFlowRow & Enhanced FlowRow/Column with MaxLines and Overflow. We are excited to announce enhancements to the experimental FlowRow and FlowColumn, now featuring maxLines and overflow support, alongside the debut of ContextualFlowRow and ContextualFlowColumn. This update is designed to provide performance optimal components, where ContextualFlow* is perfect for large number of items making using of a small maxLines config and dynamic +N see more buttons, and FlowRow and FlowColumn is perfect for small number of items, less than 100 items. Important: To maintain existing behavior in FlowRow or FlowColumn where all items are composed regardless of if they fit the cross axis max, set overflow to FlowRowOverflow.Visible or FlowColumnOverflow.Visible during initialization. Explore ContextualFlowRowSample and FlowRowSample for examples of these new features in action."
Change-Id: Ib913509969a79ff002eafb0075e6722a7a118531
M compose/foundation/foundation-layout/api/current.txt
M compose/foundation/foundation-layout/api/restricted_current.txt
M compose/foundation/foundation-layout/build.gradle
A compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/ContextualFlowLayout.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayout.kt
A compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayoutBuildingBlocks.kt
A compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayoutOverflow.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnImpl.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnMeasurementHelper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/MultiContentMeasurePolicy.kt
https://android-review.googlesource.com/2846115
Branch: androidx-main
commit eed1e666ab45070e18718653c99fc4aee50315d6
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Thu Nov 23 03:13:50 2023
Enhance FlowRow/Column & Introduce ContextualFlowRow with MaxLines & Overflow
This update enhances FlowRow and FlowColumn with support for maxLines and an overflow parameter, improving layout flexibility. It also introduces the ContextualFlowRow, utilizing SubcomposeLayout for efficient handling of large number of items by composing only those within the viewport.
Key Additions: maxLines/maxHeight/maxWidth overflow support in FlowRow/FlowColumn for improved item management. ContextualFlowRow/ContextualFlowColumn for efficient lazy initialization perfect for large number of items
Bug: 293577082
Test: Tested
Relnote: "Introducing ContextualFlowRow & Enhanced FlowRow/Column with MaxLines and Overflow. We are excited to announce enhancements to the experimental FlowRow and FlowColumn, now featuring maxLines and overflow support, alongside the debut of ContextualFlowRow and ContextualFlowColumn. This update is designed to provide performance optimal components, where ContextualFlow* is perfect for large number of items making using of a small maxLines config and dynamic +N see more buttons, and FlowRow and FlowColumn is perfect for small number of items, less than 100 items. Important: To maintain existing behavior in FlowRow or FlowColumn where all items are composed regardless of if they fit the cross axis max, set overflow to FlowRowOverflow.Visible or FlowColumnOverflow.Visible during initialization. Explore ContextualFlowRowSample and FlowRowSample for examples of these new features in action."
Change-Id: Ib913509969a79ff002eafb0075e6722a7a118531
M compose/foundation/foundation-layout/api/current.txt
M compose/foundation/foundation-layout/api/restricted_current.txt
M compose/foundation/foundation-layout/build.gradle
A compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/ContextualFlowLayout.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayout.kt
A compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayoutBuildingBlocks.kt
A compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayoutOverflow.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnImpl.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/RowColumnMeasurementHelper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/MultiContentMeasurePolicy.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 4c048675c6a0ecf03ff264945289559d4b19c8af
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Sat Dec 02 09:48:08 2023
Created tests for FlowRow and ContextualFlowRow with maxLines
Bug: 293577082
Test: Tested in topic
Change-Id: I25946921d5169a6b6595f7d189f49b4846e5fac6
A compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/ContextualFlowRowColumnTest.kt
M compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/FlowRowColumnTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/layout/LookaheadScopeTest.kt
https://android-review.googlesource.com/2856485
Branch: androidx-main
commit 4c048675c6a0ecf03ff264945289559d4b19c8af
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Sat Dec 02 09:48:08 2023
Created tests for FlowRow and ContextualFlowRow with maxLines
Bug: 293577082
Test: Tested in topic
Change-Id: I25946921d5169a6b6595f7d189f49b4846e5fac6
A compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/ContextualFlowRowColumnTest.kt
M compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/FlowRowColumnTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/layout/LookaheadScopeTest.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit fa4ea5b238c4e46144c955ffdf456c1041e61f01
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Wed Nov 29 05:54:51 2023
Created samples for FlowRow and ContextualFlowRow with maxLines
Bug: 293577082
Test: Tested in topic
Change-Id: I9c10084c67eb78d24fb23df6ae11db192f230c7c
A compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/ContextualFlowColumnDemo.kt
A compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/ContextualFlowRowDemo.kt
M compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/LayoutDemos.kt
M compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/SimpleFlowColumnDemo.kt
M compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/SimpleFlowRowDemo.kt
A compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/ContextualFlowColumnSample.kt
A compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/ContextualFlowRowSample.kt
M compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/FlowColumnSample.kt
M compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/FlowRowSample.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/ContextualFlowLayout.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayout.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayoutOverflow.kt
https://android-review.googlesource.com/2850142
Branch: androidx-main
commit fa4ea5b238c4e46144c955ffdf456c1041e61f01
Author: Faithful Uchenna Okoye <uokoye@google.com>
Date: Wed Nov 29 05:54:51 2023
Created samples for FlowRow and ContextualFlowRow with maxLines
Bug: 293577082
Test: Tested in topic
Change-Id: I9c10084c67eb78d24fb23df6ae11db192f230c7c
A compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/ContextualFlowColumnDemo.kt
A compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/ContextualFlowRowDemo.kt
M compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/LayoutDemos.kt
M compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/SimpleFlowColumnDemo.kt
M compose/foundation/foundation-layout/integration-tests/layout-demos/src/main/java/androidx/compose/foundation/layout/demos/SimpleFlowRowDemo.kt
A compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/ContextualFlowColumnSample.kt
A compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/ContextualFlowRowSample.kt
M compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/FlowColumnSample.kt
M compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/FlowRowSample.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/ContextualFlowLayout.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayout.kt
M compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/FlowLayoutOverflow.kt
uo...@google.com <uo...@google.com>
co...@protonmail.com <co...@protonmail.com> #7
amazing! thank you!
uo...@google.com <uo...@google.com> #8
You're very welcome!
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation-layout:1.7.0-alpha03
androidx.compose.foundation:foundation-layout-android:1.7.0-alpha03
androidx.compose.foundation:foundation-layout-desktop:1.7.0-alpha03
androidx.compose.ui:ui:1.7.0-alpha03
androidx.compose.ui:ui-android:1.7.0-alpha03
androidx.compose.ui:ui-desktop:1.7.0-alpha03
Description
Maybe FlowRow can have this built into it?