I am creating an animation in which the image is transferred from one direction to another, the animation moves half of the image on the side of the screen, but the image is fully displayed when the animation ends. I just want to show half the image after the animation.
I am currently using the full image in the image view when the animation starts, and replace it with the half image when the animation ends, but it shows a reflection of the image, which looks uncomfortable, which is my real 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); } });
android animation
Amit gupta
source share