Status Update
Comments
an...@google.com <an...@google.com>
an...@google.com <an...@google.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ma...@hopper.com <ma...@hopper.com> #3
ch...@gmail.com <ch...@gmail.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
ys...@google.com <ys...@google.com> #5
I'm not sure it's compatible. But is there any value in using an existing expression of this problem, say androidx.recyclerview.widget.RecyclerView.RecycledViewPool?
Do people already use these to share items across an app? If this is during a compose migration, would this help to support RecycledViewPool as a factory for AndroidView via some extension method?
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