Status Update
Comments
an...@google.com <an...@google.com>
an...@google.com <an...@google.com> #2
Branch: androidx-master-dev
commit b2ae0a8c9429e6def582fda75e85f76540a31192
Author: Ralston Da Silva <ralu@google.com>
Date: Thu Jul 09 18:55:04 2020
New Focus Modifier Implementation
This is the first CL in a series of CLs which implement the new focus API. The new implementation consists of multiple modifiers each implementing a specific use case.
This CL adds FocusModifier2 and ModifiedFocusNode2 (Which will be renamed to FocusModifier and ModifiedFocusNode after the existing classes are deleted).
Bug: 160924778
Relnote: Added Modifier.focus which replaces FocusModifier.
Test: Built and launched the demo app
Change-Id: Ib852a056a0f3c76757f0fdef07e75e82bf178b8d
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/InnerPlaceable.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusModifier2.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusNodeUtils.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/ModifiedFocusNode2.kt
ma...@hopper.com <ma...@hopper.com> #3
Branch: androidx-master-dev
commit 79b361fcb1a863005e834f70a88cae274f6ca3ce
Author: Ralston Da Silva <ralu@google.com>
Date: Mon Jul 13 18:34:14 2020
Instantiate a ModifiedFocusNode2 corresponding to a Modifier.focus() modifier
Bug: 160924778
Test: Built and launched the demo app
Change-Id: Ib5e045621e36a72327acf148bb1698632ffe182f
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
ch...@gmail.com <ch...@gmail.com> #4
Branch: androidx-master-dev
commit a52a858283c3ee5af05036e1e3665784a3051f4f
Author: Ralston Da Silva <ralu@google.com>
Date: Mon Jul 13 18:19:31 2020
Add a modifier to request focus changes
Bug: 161182057, 160924778
Relnote: Added a modifier to request focus changes
Test: Built and launched the demo App.
Change-Id: I8dd73cf3ce77e112a9f97f203b8ec7a0f07bc706
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusRequester.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusRequesterModifier.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/ModifiedFocusRequesterNode.kt
ys...@google.com <ys...@google.com> #5
Branch: androidx-master-dev
commit c8c1ab4e79928727f722e5c946c7342dd9fa30f8
Author: Ralston Da Silva <ralu@google.com>
Date: Wed Jul 15 01:20:27 2020
Instantiate a ModifiedFocusNode2 corresponding to a Modifier.focus() modifier
Bug: 160924778
Test: Built and launched the demo app
Change-Id: Ide2b07ec55b65627d1a8cfedef55848807537bac
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
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