Skip to content Skip to sidebar Skip to footer

How To Stop Animation From Repeating - Layout Animation

I'm trying to animate(fade out+pop-in) a couple of text views inside a relative layout on a button click. But after all the text views are done animating, the animation is repeatin

Solution 1:

After running your code in the emulator I think the Animation did finish but the Views kept popping in because a View animation does not make the final state permanent unless you request it by writing (in the Kotlin code)

animation.fillAfter = true

or by adding android:fillAfter as attribute to the xml file in res/anim

See also the documentation on android:fillAfter respectively setFillAfter()

Post a Comment for "How To Stop Animation From Repeating - Layout Animation"