Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 839b35c68209a419ce836de416fac56ef9bca96b
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Wed Jul 08 18:55:13 2020
Add RemeasurementModifier
LazyColumnItems are currently directly using layoutNode.requestRemeasure() and owner.measureAndLayout() which is unfortunate and to avoid it I introduced a special type of RemeasurementModifier which is responsible of providing an instance of new simple abstraction:
interface Remeasurement {
fun forceRemeasure()
}
Which is performing the synchronous remeasuring even if a node is not dirty. I see us potentially adding something else remeasuring related here, so interface seems more future-proof comparing to just a lambda.
I don't expect people using this modifier unless they do something complex as LazyColumnItems so we don't need a fluent syntax for it.
This change will allow migrating LazyColumnItems to SubcomposeLayout I am currently working on as with this abstraction we will not have an access to the LayoutNode anymore.
Fixes: 160791058
Relnote: RemeasurementModifier added. it allows to synchronously remeasure the layout. In general you never need it as remeasure/relayout is happening automatically, but we use it inside LazyColumnItems during the scroll.
Test: new test
Change-Id: I5f33173ba1f76153139fa086fef4e2a86d010282
M ui/ui-core/api/0.1.0-dev16.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev16.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev16.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/layout/Helpers.kt
A ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/layout/RemeasurementModifierTest.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/RemeasurementModifier.kt
M ui/ui-foundation/src/commonMain/kotlin/androidx/ui/foundation/lazy/LazyItems.kt
M ui/ui-foundation/src/commonMain/kotlin/androidx/ui/foundation/lazy/LazyItemsState.kt
https://android-review.googlesource.com/1358086
Branch: androidx-master-dev
commit 839b35c68209a419ce836de416fac56ef9bca96b
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Wed Jul 08 18:55:13 2020
Add RemeasurementModifier
LazyColumnItems are currently directly using layoutNode.requestRemeasure() and owner.measureAndLayout() which is unfortunate and to avoid it I introduced a special type of RemeasurementModifier which is responsible of providing an instance of new simple abstraction:
interface Remeasurement {
fun forceRemeasure()
}
Which is performing the synchronous remeasuring even if a node is not dirty. I see us potentially adding something else remeasuring related here, so interface seems more future-proof comparing to just a lambda.
I don't expect people using this modifier unless they do something complex as LazyColumnItems so we don't need a fluent syntax for it.
This change will allow migrating LazyColumnItems to SubcomposeLayout I am currently working on as with this abstraction we will not have an access to the LayoutNode anymore.
Fixes: 160791058
Relnote: RemeasurementModifier added. it allows to synchronously remeasure the layout. In general you never need it as remeasure/relayout is happening automatically, but we use it inside LazyColumnItems during the scroll.
Test: new test
Change-Id: I5f33173ba1f76153139fa086fef4e2a86d010282
M ui/ui-core/api/0.1.0-dev16.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev16.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev16.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/layout/Helpers.kt
A ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/layout/RemeasurementModifierTest.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/RemeasurementModifier.kt
M ui/ui-foundation/src/commonMain/kotlin/androidx/ui/foundation/lazy/LazyItems.kt
M ui/ui-foundation/src/commonMain/kotlin/androidx/ui/foundation/lazy/LazyItemsState.kt
Description