Status Update
Comments
an...@google.com <an...@google.com>
an...@google.com <an...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
ma...@hopper.com <ma...@hopper.com> #3
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
ch...@gmail.com <ch...@gmail.com> #4
ys...@google.com <ys...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
as...@google.com <as...@google.com> #6
I believe RecycledViewPool
is substantially different from Compose use case, which reuses elements structurally in the node tree. While some interop between those abstractions can be useful, most of the problems described in this bug still need some solution to work around lifecycle differences between View
s and composition.
ys...@google.com <ys...@google.com> #7
OK makes sense. I'm coming at this from the point of view of Wear apps looking to move off RecyclerView to ScalingLazyColumn, so wondering what those apps will typically already have configured.
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 9380a29f6c6ec2cf4b239997927eb3ff8b36342f
Author: Andrew Bailey <anbailey@google.com>
Date: Wed Jan 11 15:24:34 2023
Add reusable AndroidView API
This CL adds an overload AndroidView that allows View objects to be
reused in different parts of the composition. The new API leverages
`ReusableComposeNode` to opt-into automatic recycling from the composer.
The new API offers hooks to allow users to prepare their Views for
reuse, and also gives more information about when the View is being
released by Compose.
Relnote: """Added an overload of `AndroidView` composable function,
which allows View instances to be reused when their node in the
composition is discarded and reused in a compatible way. This is
especially useful for LazyRows and LazyColumns of Views.
"""
Bug: 230099236
Test: ./gradlew compose:ui:ui:cAT
Test: ScrollingAndroidViewsDemo (manual)
Change-Id: I3f10db5de1b7699964274e0d25f4aad324865dca
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/testdata/AndroidViewTestActivity.kt
M compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
M compose/ui/ui/api/public_plus_experimental_1.4.0-beta02.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/viewinterop/ScrollingAndroidViewsDemo.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/res/layout/android_view_row_in_lazy_column.xml
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/AndroidViewSample.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/viewinterop/AndroidViewTest.kt
A compose/ui/ui/src/androidAndroidTest/res/values/ids.xml
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidView.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidViewHolder.android.kt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/InteropView.android.kt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/InteropViewFactoryHolder.android.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InteroperableComposeUiNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/viewinterop/InteropView.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/viewinterop/InteropViewFactoryHolder.kt
A compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/viewinterop/InteropView.skiko.kt
A compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/viewinterop/InteropViewFactoryHolder.skiko.kt
an...@google.com <an...@google.com> #9
jb...@google.com <jb...@google.com> #10
We've tried using this API on Google Fi and it seems that the AndroidView is being released quite quickly, even after adding a onReset lambda. Users don't need to scroll very far down the LazyColumn for the AndroidView to be released - I'd say somewhere in between a half screen length to a screen length.
Was the expectation that the View remains "composed" for longer than that?
Description