Hello, How could I achieve animated content using...
# compose
n
Hello, How could I achieve animated content using Compose? (without custom layout)

https://miro.medium.com/max/1200/1*CE9Szh6jkPZA3jcnC4xBsQ.gif

g
f
without custom layout
Why? Custom layouts are the best thing on Compose! They are really easy to work with. Learn to use them and you won't regret it 😏
k
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]l3/src/commonMain/kotlin/androidx/compose/material3/TabRow.kt has reference code on how to animate and place the indicator. Take a look at
Modifier.tabIndicatorOffset
and how it integrates with the state of the currently selected tab.
t
I use a variation inspired by the code from the medium article you took that animation from and it works perfectly fine and is easy to maintain once you take time to read the article and understand how things works.https://fvilarino.medium.com/creating-an-animated-selector-in-jetpack-compose-669066dfc01b
i
The Crane sample slides an outline as a selection indicator that is pretty similar https://github.com/android/compose-samples/tree/main/Crane
c
@Zach Klippenstein (he/him) [MOD] also had something like this shared on his twitter (which I can't find right now) sorry for the ping.
z
you can’t find it because my twitter account no longer exists, unfortunately
c
DAMN YOU ELONNNNNNN
d
z
Lol wtf I couldn’t even find that in my own gists yesterday. Fixed the name
d
I just google everytime I need it 😁 ¯\_(ツ)_/¯
215 Views