+ 2

xml animations

Hi! I got two animations. One I want to show one time and the other one infinite... It's probably easy, but I don't know how to do that... That's my xml-file: <?xml version="1.0" encoding="utf-8"?> http://schemas.android.com/apk/res/android" android:oneshot="false"> Todo: RUN one time: stop Todo: RUN Infinite:

9th Nov 2020, 11:44 AM
Fu Foy
Fu Foy - avatar
1 Answer
+ 5
Animation animation=AnimationUtils.loadAnimation(getApplicationContex(),R.anim.your_anim); //Run only one time animation.setRepeatCount(1); Your view.startAnimation(animation); //Run infinite animation.setRepeatCount(Animation.INFINITE); Your view.startAnimation(animation); hint: also can be done through xml, Android:repeatCount="infinite".
9th Nov 2020, 4:50 PM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar