Calvin-LL / Reorderable

Reorder items in Lists and Grids in Jetpack Compose and Compose Multiplatform with drag and drop.
Apache License 2.0
492 stars 16 forks source link

`Modifier.animateItemPlacement()` deprecated in Compose Foundation v1.7.0-alpha06 #26

Closed Calvin-LL closed 4 weeks ago

Calvin-LL commented 6 months ago

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. (I2d7f7, b/150812265)

In Compose Foundation version 1.7.0-alpha06 release notes.

Should remove Modifier.animateItemPlacement() with Modifier.animateItem() once v1.7.0 is out.

Calvin-LL commented 6 months ago

Did some math in #32

Compose Foundation 1.6.0-alpha08 to 1.6.0 took almost 3 months, the latest Compose Multiplatform 1.6.2 uses Compose Foundation 1.6.4 which is a 20-day gap. So expect Compose Foundation v1.7.0 to be in Compose Multiplatform in around 4 months at the current speed.

So that means Compose Foundation v1.7.0 will probably be out around late August - early September.

berhram commented 5 months ago

Sorry to bother you. I cloned the lib files into my project. Bumped Compose libs (Android ones because it's an Android app) to 1.7.0-beta02. Replaced animateItemPlacement() with animateItem(), but nothing changed. Did I do something wrong and there is more work to do to adapt to newer Compose versions?

Calvin-LL commented 5 months ago

Sorry to bother you. I cloned the lib files into my project. Bumped Compose libs (Android ones because it's an Android app) to 1.7.0-beta02. Replaced animateItemPlacement() with animateItem(), but nothing changed. Did I do something wrong and there is more work to do to adapt to newer Compose versions?

There are lots of places marked TODO(foundation v1.7.0) in the code for 1.7.0 that need to be made before that's fixed.

Calvin-LL commented 5 months ago

Good news! v1.7.0 is being released in June according to https://android-developers.googleblog.com/2024/05/whats-new-in-jetpack-compose-at-io-24.html, we should see v1.7.0 land in Compose Multiplatform some time in June/July.

westnordost commented 1 month ago

Looks like they have been late. But it has been released now on the 4th of September.

Calvin-LL commented 1 month ago

Unfortunately I still have to wait until it hits multiplatform. The good news is you can use the beta version of Reorderable, it uses the beta version of multiplatform which has 1.7.0.

ArthurKun21 commented 4 weeks ago

Hello

Multiplatform have hit 1.7.0 earlier

https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.7.0

Calvin-LL commented 4 weeks ago

Amazing! Thank you for letting me know. I'll update asap

Calvin-LL commented 4 weeks ago

v2.4.0 is out