Fixed
Status Update
Comments
ry...@google.com <ry...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 96f50779ed5822528f976074db6cd72975ea037a
Author: Ryan Mentley <ryanmentley@google.com>
Date: Fri Oct 29 22:12:37 2021
PoolingContainer library
This adds an androidx.customview:customview-poolingcontainer artifact that is
depended on by both Compose and RecyclerView, through which AbstractComposeView
and RecyclerView discover each other and communicate about when the Compose
view should dispose its composition.
This mechanism is independent of both Compose and RecyclerView, and
could be used for any recycling container or child with heavy resources
that should be retained across recycling.
Relnote: "Add a new PoolingContainer library that allows for listening
to dispose events of a container that manages its children outside the View
hierarchy. This will later be added as a dependency of Compose and RecyclerView"
Test: New PoolingContainerTest
Bug: 196371929
Change-Id: I0e3f61f2a38f28a3fa9e5cbd50dbfb10c0871984
M settings.gradle
A customview/customview-poolingcontainer/build.gradle
A customview/customview-poolingcontainer/OWNERS
A customview/customview-poolingcontainer/api/current.txt
A customview/customview-poolingcontainer/src/androidTest/AndroidManifest.xml
A customview/customview-poolingcontainer/src/main/res/values/ids.xml
M libraryversions.toml
M jetifier/jetifier/migration.config
A customview/customview-poolingcontainer/api/public_plus_experimental_current.txt
A customview/customview-poolingcontainer/src/androidTest/kotlin/androidx/customview/poolingcontainer/PoolingContainerTest.kt
A customview/customview-poolingcontainer/src/main/AndroidManifest.xml
M docs-tip-of-tree/build.gradle
A customview/customview-poolingcontainer/api/res-current.txt
M customview/customview/build.gradle
A customview/customview-poolingcontainer/src/main/java/androidx/customview/poolingcontainer/PoolingContainer.kt
A customview/customview-poolingcontainer/api/restricted_current.txt
https://android-review.googlesource.com/1835206
Branch: androidx-main
commit 96f50779ed5822528f976074db6cd72975ea037a
Author: Ryan Mentley <ryanmentley@google.com>
Date: Fri Oct 29 22:12:37 2021
PoolingContainer library
This adds an androidx.customview:customview-poolingcontainer artifact that is
depended on by both Compose and RecyclerView, through which AbstractComposeView
and RecyclerView discover each other and communicate about when the Compose
view should dispose its composition.
This mechanism is independent of both Compose and RecyclerView, and
could be used for any recycling container or child with heavy resources
that should be retained across recycling.
Relnote: "Add a new PoolingContainer library that allows for listening
to dispose events of a container that manages its children outside the View
hierarchy. This will later be added as a dependency of Compose and RecyclerView"
Test: New PoolingContainerTest
Bug: 196371929
Change-Id: I0e3f61f2a38f28a3fa9e5cbd50dbfb10c0871984
M settings.gradle
A customview/customview-poolingcontainer/build.gradle
A customview/customview-poolingcontainer/OWNERS
A customview/customview-poolingcontainer/api/current.txt
A customview/customview-poolingcontainer/src/androidTest/AndroidManifest.xml
A customview/customview-poolingcontainer/src/main/res/values/ids.xml
M libraryversions.toml
M jetifier/jetifier/migration.config
A customview/customview-poolingcontainer/api/public_plus_experimental_current.txt
A customview/customview-poolingcontainer/src/androidTest/kotlin/androidx/customview/poolingcontainer/PoolingContainerTest.kt
A customview/customview-poolingcontainer/src/main/AndroidManifest.xml
M docs-tip-of-tree/build.gradle
A customview/customview-poolingcontainer/api/res-current.txt
M customview/customview/build.gradle
A customview/customview-poolingcontainer/src/main/java/androidx/customview/poolingcontainer/PoolingContainer.kt
A customview/customview-poolingcontainer/api/restricted_current.txt
Description
Currently, ComposeViews will dispose their compositions when detached from the window. In RecyclerView, this is slightly suboptimal, because ideally, we would only do so when the ViewHolder is being recycled, or when the RecyclerView is going away. See internal design doc for more information.
We should provide a simple solution (probably a recyclerview-compose artifact) that addresses this.