How to resume and pause ObjectAnimator in Android for API Levels below 19?

后端 未结 3 1793
Happy的楠姐
Happy的楠姐 2021-02-14 05:20

I am aware that API level 19 supports pause() and resume() on ObjectAnimators. But in my project at API level 14, I have an ObjectAnimator which is applied to an Image view to r

3条回答
  •  北海茫月
    2021-02-14 05:59

    What you are doing is that it will just restart your animation, instead you can create a custom class for animation with pause and resume method.

    You need to first check if the device is 19 api and above if it is then use the native pauses and resume of the object animator else use the regular Animation designed from api 1, you can follow this thread for pause and resume below api 19.

提交回复
热议问题