Status Update
Comments
el...@gmail.com <el...@gmail.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.
to...@gmail.com <to...@gmail.com> #3
Our team is also affected by this. Please keep us in the loop if you add this support into FlowRow!
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #4
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
ra...@google.com <ra...@google.com>
da...@gmail.com <da...@gmail.com> #5
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
ra...@google.com <ra...@google.com> #6
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
na...@google.com <na...@google.com> #7
amazing! thank you!
he...@gmail.com <he...@gmail.com> #8
You're very welcome!
na...@google.com <na...@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
he...@gmail.com <he...@gmail.com> #10
Issue is fixed with 1.5.0-alpha04
pa...@geocaching.com <pa...@geocaching.com> #11
mr...@gmail.com <mr...@gmail.com> #12
pl...@google.com <pl...@google.com> #13
To the authors of
mr...@gmail.com <mr...@gmail.com> #14
FATAL EXCEPTION: main Process: sampleapp.tv.debug, PID: 10202 java.lang.IllegalStateException: Check failed. at androidx.compose.ui.focus.FocusTargetModifierNode.fetchFocusProperties$ui_release(FocusTargetModifierNode.kt:197) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:189) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:192) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.findChildCorrespondingToFocusEnter--OM-vw8(TwoDimensionalFocusSearch.kt:103) at androidx.compose.ui.focus.FocusRequester.focus$ui_release(FocusRequester.kt:74) at androidx.compose.ui.focus.FocusRequester.requestFocus(FocusRequester.kt:63) at androidx.tv.material3.NavigationDrawerKt$DrawerSheet$2$1.invokeSuspend(NavigationDrawer.kt:249) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7898) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@fc1e6d, androidx.compose.runtime.BroadcastFrameClock@1ec5aa2, StandaloneCoroutine{Cancelling}@8c2333, AndroidUiDispatcher@ad6b6f0]
mr...@gmail.com <mr...@gmail.com> #15
In my case its happening when using a NavigationDrawer from androidx.tv.material3. reproduction steps are easy, let the Navigation drawer gain focus and then move the focus to something else, try go back to Navigation drawer and boom!
pa...@geocaching.com <pa...@geocaching.com> #16
Good news - The crash is now resolved for us. We had been declaring each Compose dependency individually in our build.gradle. I updated all of our Compose dependencies to the latest available versions, including androidx.compose.ui:ui:1.5.0-alpha04. This did not resolve the issue for us. Finally, I switched over to using the Compose BoM (2023.04.01), and that fixed it! Interestingly, that version of the BoM is using version 1.4.2 of Compose UI. I hope this may help others who are still experiencing the crash.
pr...@google.com <pr...@google.com> #17
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-foundation:1.0.0-alpha07
ir...@gmail.com <ir...@gmail.com> #18
```kotlin
Box(
modifier = Modifier
.clickable(false) {}
) {
SelectionContainer {
Text(
text = value,
fontSize = 18.sp,
color = MaterialTheme.colors.normalTextColor,
overflow = TextOverflow.Ellipsis,
maxLines = 2
)
}
}
```
bb...@jeniusbank.com <bb...@jeniusbank.com> #19
To add to .clickable(enabled = true)
then the user long presses to highlight text, and the state is changed to false
, or if you change the text in some way (ex. from another button) an exception is thrown. This is the same exception that is thrown when long pressing and the .clickable
is set to false
java.lang.IllegalStateException: Cannot read CompositionLocal because the Modifier node is not currently attached.
Using a combinedClickable
in the same manner crashes with the same exceptions.
Description
1.4.0
1.8.10
Unfortunately I have not managed to create a reproducible example or certain steps to recreate this. I will update more details in response if I can find out more details.
Stack trace 1
In this case
moveFocus
was called by the framework in response to a key press.Stack trace 2
In this case
LocalFocusManager.current.moveFocus(FocusDirection.Enter)
was manually called from application code.Both traces seem to have
twoDimensionalFocusSearch
in the stack only once, which to my understanding would indicate the focus search is beginning from the root of the hierarchy. I am not yet familiar with the Modifier Node architecture, but this would seem to indicate that the root node is for some reason detached from the layout?