Pause / reverse frame animation?

I have a frame animation that works great with AnimationDrawable. Here he is:

<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true"> <item android:drawable="@drawable/arrowframes0000" android:duration="50" /> <item android:drawable="@drawable/arrowframes0001" android:duration="50" /> ... <item android:drawable="@drawable/arrowframes0024" android:duration="50" /> <item android:drawable="@drawable/arrowframes0025" android:duration="50" /> 

I need to be able to cancel this frame animation while it is still playing, and in other circumstances shortly after its completion.

There seems to be no way to do this using AnimationDrawable.

How else can I do this to change the animation in the middle of playback? (and do it again forward in the middle of reverse playback).

+4
source share
2 answers

create another repeating animation with a reverse frame, and if you want to cancel an already running animation, stop which one you want to cancel (i.e., run it), and start duplicating the reverse (i.e. the second) animation.

+1
source

I did it for me in this way, that is, in the end, the extended β€œarrow-frame 0025” extends the duration (say, 2000), it will make it stop for 2 seconds and continue placing your drawings in descending order with the same duration (50) . This will make the full animation back and forth and save the picture as false

0
source

All Articles