Status Update
Placement/reordering animations in lists: Available since 1.1.0
Placement/reordering animations in grids: Available since 1.2.0
Placement/reordering animations in staggered grids: Available since 1.5.x betas
Additions/removals animations: In progress
Comments
cl...@google.com <cl...@google.com>
an...@google.com <an...@google.com>
ra...@twinhealth.com <ra...@twinhealth.com> #2
Could you look into it @christofferqa?
The issue is with this class:
class MySpi : Spi {
@Volatile
private var myApi: Api? = null
// Incorrectly rewritten to return null;
override fun createApi(): Api {
return myApi ?: synchronized(this) {
myApi ?: MyApi().also { myApi = it }
}
}
}
The error seems to be that the ArgumentPropagator believes that the fieldState of myApi is ExactDynamicType(@NotNull MyApi)
while it should be ExactDynamicType(@Nullable MyApi)
It then removes the first branch (assuming myApi is not null):
return myApi ?: synchronized(this) {
myApi ?: MyApi().also { myApi = it }
}
is rewritten into:
return myApi
And then it eventually concludes that myApi is always null, replacing the code by
return null
The ArgumentPropagatorCodeScanner analyzes the assignment myApi = it
and correctly set join the state to ExactDynamicType(@NotNull MyApi)
However the ArgumentPropagator fails to understand that myApi
can be read before being written in the method, relying on the default null value, so it fails to join null
to the dynamic type.
an...@google.com <an...@google.com> #3
Yes I can take a look. Would it be possible for you to add a regression test of this issue?
ro...@gmail.com <ro...@gmail.com> #4
Project: r8
Branch: main
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 6ba9af34b15f2a0d3fe356f6e7a5a4071128aed9
Date: Wed Feb 12 09:31:01 2025
ka...@gmail.com <ka...@gmail.com> #5
Project: r8
Branch: main
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 692fff07b70f6ee5ac520b179aed5e125a0d4848
Date: Wed Feb 12 09:34:04 2025
sh...@gmail.com <sh...@gmail.com> #6
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 76cad195cf43c16aa9e7b0203e51662036587e71
Date: Thu Feb 13 10:33:29 2025
ap...@google.com <ap...@google.com> #7
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Version 8.9.28
Expand for full commit details
Version 8.9.28
Bug: b/389737060
Change-Id: I42c8d3194dc053e3a16eef8ea1c4b3aced6752d6
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 668c1778e857c1bc8e3f9308a65ddc01a6c14898
Date: Thu Feb 13 10:33:34 2025
ma...@gmail.com <ma...@gmail.com> #8
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: a76d3e8637b5280dcc972ed9fabc74bb503cc30c
Date: Thu Feb 13 10:33:24 2025
an...@google.com <an...@google.com> #9
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: a63678f7ebb3321af74c9846be9c851e4da78e4f
Date: Thu Feb 13 10:33:55 2025
ro...@gmail.com <ro...@gmail.com> #10
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Version 8.8.35
Expand for full commit details
Version 8.8.35
Bug: b/389737060
Change-Id: I2361f77b42b529f2cbdfbf60fbe4a95e405ba716
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: d280891c805561bc120f5f96841b50353e74edfe
Date: Thu Feb 13 10:34:06 2025
an...@google.com <an...@google.com> #11
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 05dd13d906b60efdf03caea7067dedf67b7c6a2e
Date: Thu Feb 13 10:34:00 2025
sh...@gmail.com <sh...@gmail.com> #12
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: d7dcc9001453052f772056337d3c120dba34fc46
Date: Thu Feb 13 10:34:31 2025
an...@google.com <an...@google.com> #13
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Version 8.7.35
Expand for full commit details
Version 8.7.35
Bug: b/389737060
Change-Id: Icfb60f565b329600b5f167a496a39a61ebff9ea6
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 1be71bdf4455bbc565502b4c3bbbae64608c57a6
Date: Thu Feb 13 10:34:38 2025
om...@gmail.com <om...@gmail.com> #14
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 7272540b4f7850ef22543defc221660359704ea2
Date: Thu Feb 13 10:34:26 2025
an...@google.com <an...@google.com> #15
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 76cad195cf43c16aa9e7b0203e51662036587e71
Date: Thu Feb 13 10:33:29 2025
sl...@gmail.com <sl...@gmail.com> #16
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: a76d3e8637b5280dcc972ed9fabc74bb503cc30c
Date: Thu Feb 13 10:33:24 2025
co...@gmail.com <co...@gmail.com> #17
This should now be fixed in R8 8.7.36, 8.8.36 and 8.9.28.
jd...@google.com <jd...@google.com> #18
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Version 8.8.36
Expand for full commit details
Version 8.8.36
Bug: b/389737060
Change-Id: I9ac9a6eda36030b2569bf6839f9b55257f0d2888
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: d228eeda266e288da18698a2fa464fc97b0303c3
Date: Thu Feb 13 12:31:37 2025
ch...@gmail.com <ch...@gmail.com> #19
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Fix call to addDataResources in test
Expand for full commit details
Fix call to addDataResources in test
This was added in 8.9.
Bug: b/389737060
Change-Id: I604550f0c0034256f71c03874eeb4798f7079f18
Files:
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 58502e8fa34f0abe33a254671faf1b74e0668c86
Date: Thu Feb 13 12:30:57 2025
ka...@gmail.com <ka...@gmail.com> #20
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Version 8.7.36
Expand for full commit details
Version 8.7.36
Bug: b/389737060
Change-Id: Ib57157e3ca8863dcb097a3aa0a1e840c546a4392
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: de384a5950a14b2244dc74819fffd0306cae7065
Date: Thu Feb 13 12:28:52 2025
an...@google.com <an...@google.com> #21
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Fix call to addDataResources in test
Expand for full commit details
Fix call to addDataResources in test
This was added in 8.9.
Bug: b/389737060
Change-Id: I04d342dc297474d141362290f9ccf22c48332446
Files:
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 981af34dd96a316d0c11972d80ce31ab301ec6c1
Date: Thu Feb 13 12:28:09 2025
ka...@gmail.com <ka...@gmail.com> #22
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Meerkat Feature Drop | 2024.3.2 Beta 1
- Android Gradle Plugin 8.10.0-beta01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
ma...@quantox.com <ma...@quantox.com> #23
The fixes for this issue are now also available in:
- Android Studio Meerkat | 2024.3.1 Patch 1
- Android Gradle Plugin 8.9.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
an...@google.com <an...@google.com> #24
Can I ask for future to file separate bugs for questions like this as any new comment it this bug is currently sending an email to everyone who +1ed this bug. Thanks!
ra...@twinhealth.com <ra...@twinhealth.com> #25
ka...@gmail.com <ka...@gmail.com> #26
People are trying to come up with hacky answers on Stackoverflow without much success or any convenience.
this might not even be in backlog...
kl...@gmail.com <kl...@gmail.com> #27
ka...@gmail.com <ka...@gmail.com> #28
kl...@gmail.com <kl...@gmail.com> #29
an...@google.com <an...@google.com> #30
il...@gmail.com <il...@gmail.com> #31
Can you please provide any status update / dates if possible?
rl...@gmail.com <rl...@gmail.com> #32
pe...@gmail.com <pe...@gmail.com> #33
jo...@google.com <jo...@google.com> #34
Hi, the Play store team is working on a feature which could greatly benefit from LazyColumn's addition/deletion animation support. Do you have an updated ETA that you can share with you? Thanks!
da...@gmail.com <da...@gmail.com> #35
ry...@google.com <ry...@google.com> #36
ka...@gmail.com <ka...@gmail.com> #37
its almost been 2 years now and even your internal teams at play store are asking for the item addition deletion animations, I was the first to bring this up in this thread first.
Is there any ETA on this ? It was a core functionality with DiffUtils which we shouldnt find workarounds as an implementation for Compose !
Could anyone from Google please share an ETA on this
an...@google.com <an...@google.com> #38
Hello. We are currently finializing the design for the underlying mechanism we will be using for the disappearance animations. Sorry, we can't give exact estimations, but I can reassure you this feature is in works
mo...@gmail.com <mo...@gmail.com> #39
ka...@gmail.com <ka...@gmail.com> #40
bro
ka...@gmail.com <ka...@gmail.com> #41
I kind of agree with the last poster, if we all "bro" the developers every year or month to bump the thread, they might feel pressured to finish the removal/addition animations. Anyways, hang in there champ, they're probably almost done with that last piece of work
se...@gmail.com <se...@gmail.com> #42
it...@gmail.com <it...@gmail.com> #43
ta...@gmail.com <ta...@gmail.com> #44
Yesterday was the 4th year open anniversary of this issue lol
it...@gmail.com <it...@gmail.com> #45
mu...@gmail.com <mu...@gmail.com> #46
ph...@gmail.com <ph...@gmail.com> #47
ap...@google.com <ap...@google.com> #49
Branch: androidx-main
commit 36578696db7997ec73d1f81ae55e6b61951e7895
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Tue Jul 04 16:14:07 2023
Item disappearance animation for lazy lists
We add support for the disappearance animation for lazy list items. The appearance animation was added as an internal api as part of aosp/2644850. We are using the new graphics layer implementation we recently added as part of aosp/2969199 and a set of preceding cls. This new graphics layer implementation is automatically counting the amount of usages for each layer, meaning that even when the layer is technically released by its main user, the underlying drawn content is not discarded until all the parent layers stop drawing it as well. It allows us to continue drawing the item being removed for the duration of disappearance animation. This logic was added in aosp/2967570.
As part of this cl we made both appearance and disappearance animation support public for LazyColumn and LazyRow. Support for other lazy layouts will be added in the next cls. Support for other types of animations is tracked in
Fixes: 150812265
Relnote: Item appearance and disappearance animation support was added into `LazyColumn` and `LazyRow`. Previously it was possible to add `Modifier.animateItemPlacement()` modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier called `Modifier.animateItem()` which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering.
Test: new LazyListItemDisappearanceAnimationTest
Change-Id: I2d7f7a376cea26c0a36a59a4586d2705ab04cab7
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/lookahead/LookaheadWithAnimateItemPlacement.kt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/LazyColumnDragAndDropDemo.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/ListDemos.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/PopularBooksDemo.kt
M compose/foundation/foundation/integration-tests/lazy-tests/src/androidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListItemAppearanceAnimationTest.kt
A compose/foundation/foundation/integration-tests/lazy-tests/src/androidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListItemDisappearanceAnimationTest.kt
M compose/foundation/foundation/integration-tests/lazy-tests/src/androidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListItemPlacementAnimationTest.kt
M compose/foundation/foundation/integration-tests/lazy-tests/src/androidTest/kotlin/androidx/compose/foundation/lazy/list/LazyListTest.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/LazyDslSamples.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyItemScope.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyItemScopeImpl.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/LazyListItemAnimator.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/LazyListMeasuredItem.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemPlacementAnimator.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemScopeImpl.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutAnimation.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemPlacementAnimator.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.kt
an...@google.com <an...@google.com> #50
Item appearance and disappearance animation support was added into LazyColumn
and LazyRow
. Previously it was possible to add Modifier.animateItemPlacement()
modifier in order to support placement (reordering) animations. We deprecated this modifier and introduced a new non-experimental modifier called Modifier.animateItem()
which allows you to support all three animation types: appearance (fade in), disappearance (fade out) and reordering.
This change is expected to be released as part of 1.7.0-alpha06
release.
Port of this modifier into lazy grids is tracked here:
To staggered grids here:
Support of other animation types aside of fade in/fade out is tracked here:
ca...@gmail.com <ca...@gmail.com> #51
Failed to transform lifecycle-livedata-core-2.8.0-alpha04.aar (androidx.lifecycle:lifecycle-livedata-core:2.8.0-alpha04) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=26, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Caused by: [CIRCULAR REFERENCE: java.lang.NullPointerException]
When I try to use 1.7.0-alpha06, any recommendation?
ry...@google.com <ry...@google.com> #52
@
lo...@gmail.com <lo...@gmail.com> #53
Hello, in the doc, under the heading "Item animations", the last sentence that references this issue should be changed, or removed:
It still says:
Aside from reorderings, item animations for additions and removals is currently in development. You can track the progress in issue
. 150812265
jo...@google.com <jo...@google.com> #54
Thank you for letting us know! We've updated the documentation page :)
Description
Placement/reordering animations in lists: Available since 1.1.0
Placement/reordering animations in grids: Available since 1.2.0
Placement/reordering animations in staggered grids: Available since 1.5.x betas
Additions/removals animations: In progress