I am creating an animation in which an image translate from one direction to another, animation moves half of the image out side the screen but image shows full when animation ends. I just want to show half of the image after animation.
Currently I am using full image in the image view when animation starts and replace it with the half image when animation ends but it shows an image change reflection which looks awkward which is my actual problem.
Below is my xml and class file.
animation code
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration = "2000"
android:fillBefore="true"
android:fillEnabled="true"
android:fromXDelta = "-300%"
android:fromYDelta="200%"
android:toXDelta="60%">
</translate>
animimv5.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
imv5.setBackgroundResource(R.drawable.img5);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
imv5.setBackgroundResource(R.drawable.img5_2);
}
});