Reputation: 7306
I search but cant find out any infromation how to freeze last state of animation like rotation or else.
I think than animation it's change some pictures with show's last state.
I have next xml animation file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="true">
<rotate android:fromDegrees="0" android:toDegrees="300"
android:duration="5000" android:pivotX="50%" android:pivotY="50%"
android:startOffset="10"
>
</rotate>
</set>
As you can see parameter toDegress it's setted to 300. I use this animation xml to rotate text with next code
Animation animation1 = AnimationUtils.loadAnimation(this,
R.anim.myanimation);
animation1.setAnimationListener(this);
View animatedView1 = findViewById(R.id.rotatetext);
animatedView1.startAnimation(animation1);
But then animation stops text not rotated state no 300 degrees, it's returns to 0 degress.
How i can do what animation freeze on last frame?
Keep It Simple Stupid
Read,read and read documentation
When set to true, the animation transformation is applied after the animation is over. The default value is false. If fillEnabled is not set to true and the animation is not set on a View, fillAfter is assumed to be true.
Must be a boolean value, either "true" or "false".
Upvotes: 0
Views: 930
Reputation: 98
You can implement an AnimationListener and set to your animation object. write some code to change the View's state in the method onAnimationEnd().
Upvotes: 2