https://kotlinlang.org logo
#compose
Title
# compose
u

ursus

02/24/2024, 2:07 AM
I have a
Copy code
sealed class Foo {
   data object Loading
   data class Loaded(val counter: Int)
}
I display it via
Copy code
AnumatedContent(foo) {
   when (it) {
     is Loading -> ProgressBar()
     is Loaded -> Form(it.counter)
}
Now, when I change state from
Foo.Loaded(0)
to
Foo.Loaded(1)
I get a animation. I don't want that. I only want to animate changes between Loading and Loaded Is there some equals lambda parameter I can pass in to modify the equaljty calculation?
a

Albert Chang

02/24/2024, 3:41 AM
Check
contentKey
parameter.
☝️ 1
u

ursus

02/24/2024, 2:27 PM
Great, thanks!
4 Views