Fixed
Status Update
Comments
se...@google.com <se...@google.com>
il...@gmail.com <il...@gmail.com> #2
Any update on this?
The request is DiffUtil implementation along with "items" and "indexedItems" functions to support DiffUtil and animations when adding/removing items. the same as the ListAdapter with DiffUtil.
The request is DiffUtil implementation along with "items" and "indexedItems" functions to support DiffUtil and animations when adding/removing items. the same as the ListAdapter with DiffUtil.
mp...@google.com <mp...@google.com>
ap...@google.com <ap...@google.com> #3
We are working on it, but nothing to share yet. Thanks
sg...@google.com <sg...@google.com> #4
Are we allowed to post potential workarounds on issue trackers?
I created this small POC repo, definitely not a solution and probably not ideal in the long run but works for my use case and thought I'd share:
[Deleted User] <[Deleted User]> #5
I think there is not much point in coming up with workaround as this is expected to be one of the main features/supports for the DiffUtil (list diffing for adapters). Entire RecyclerView implementations depend on this.
sg...@google.com <sg...@google.com> #6
Any update on LazyList Animations
[Deleted User] <[Deleted User]> #7
Project: platform/frameworks/support
Branch: androidx-main
commit 957064e95fb19d2e6f1312ff4ca4f7407ee3ee42
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Wed Oct 06 22:38:46 2021
Lazy list item reordering animation
Relnote: """Experimental ability to animate Lazy lists item positions was added.
There is a new modifier available within LazyItemScope called `Modifier.animateItemPlacement()`.
Usage example:
var list by remember { mutableStateOf(listOf("A", "B", "C")) }
LazyColumn {
item {
Button(onClick = { list = list.shuffled() }) {
Text("Shuffle")
}
}
items(list, key = { it }) {
Text("Item $it", Modifier.animateItemPlacement())
}
}
When you provide a key via `LazyListScope.item` or `LazyListScope.items` this modifier will enable item reordering animations. Aside from item reordering all other position changes caused by events like arrangement or alignment changes will also be animated.
"""
Bug: 150812265
Test: tests for the new behavior in LazyListAnimateItemPlacementTest
Change-Id: I59e7b8fd3a4a9eb19a15a4704da150bd187a6f24
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/PopularBooksDemo.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListItemPlacementAnimator.kt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyItemScope.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListMeasure.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/foundation/foundation/api/1.1.0-beta02.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/LazyDslSamples.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyListAnimateItemPlacementTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListHeaders.kt
M compose/foundation/foundation/api/restricted_1.1.0-beta02.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/build.gradle
M compose/foundation/foundation/api/public_plus_experimental_1.1.0-beta02.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/ListDemos.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyMeasuredItem.kt
https://android-review.googlesource.com/1823296
Branch: androidx-main
commit 957064e95fb19d2e6f1312ff4ca4f7407ee3ee42
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Wed Oct 06 22:38:46 2021
Lazy list item reordering animation
Relnote: """Experimental ability to animate Lazy lists item positions was added.
There is a new modifier available within LazyItemScope called `Modifier.animateItemPlacement()`.
Usage example:
var list by remember { mutableStateOf(listOf("A", "B", "C")) }
LazyColumn {
item {
Button(onClick = { list = list.shuffled() }) {
Text("Shuffle")
}
}
items(list, key = { it }) {
Text("Item $it", Modifier.animateItemPlacement())
}
}
When you provide a key via `LazyListScope.item` or `LazyListScope.items` this modifier will enable item reordering animations. Aside from item reordering all other position changes caused by events like arrangement or alignment changes will also be animated.
"""
Bug: 150812265
Test: tests for the new behavior in LazyListAnimateItemPlacementTest
Change-Id: I59e7b8fd3a4a9eb19a15a4704da150bd187a6f24
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/PopularBooksDemo.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListItemPlacementAnimator.kt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyItemScope.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListMeasure.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListState.kt
M compose/foundation/foundation/api/1.1.0-beta02.txt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/LazyDslSamples.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyListAnimateItemPlacementTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListHeaders.kt
M compose/foundation/foundation/api/restricted_1.1.0-beta02.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/build.gradle
M compose/foundation/foundation/api/public_plus_experimental_1.1.0-beta02.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/ListDemos.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyMeasuredItem.kt
Description
Jetpack Compose component used: TopAppBar, Scaffold
Android Studio Build: #AI-223.8836.35.2231.10406996, built on June 29, 2023
Kotlin version: 1.9.10
Steps to Reproduce or Code Sample to Reproduce:
1. Set system font size to large
2. Open any screen using Scaffold with TopAppBar
Actual result: the title gets truncated