How to use animation in Android without stopping?

<?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:repeatCount="infinite" android:repeatMode="restart" android:duration="2000" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360"> </rotate> 

The problem is that the animation is going wrong. Tobish it is reproduced. At the end stops at 500ms. And then again reproduced. Is it possible to fix it so that it does not stop at all? Tobish was ONE Whole

  • Add and Activation Code - McDaggen

3 answers 3

Described, it seems, is similar to the action of the default interpolator, which determines how the animation should play over time. By default, it is played with acceleration at the beginning and deceleration at the end. To speed did not change it is necessary to use a linear interpolator:

 android:interpolator="@android:anim/linear_interpolator" 

Useful info: http://developer.alexanderklimov.ru/android/animation/interpolator.php

  • android: interpolator = "linear_interpolator" There is no such thing in Android - Andro
  • I added it programmatically and it all worked. But why doesn't XML work? - Andro
  • @xTIGRx, corrected in response - YuriySPb
 <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="2000" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" android:repeatCount="-1" android:repeatMode="repeat"> </rotate> 

    I think that this attribute gives you a lag

     android:repeatMode="restart"