1. Animation Jump: Set the position at the end of the animation
Animation.animationlistener listener =NewAnimation.animationlistener () {@Override Public voidOnanimationstart (Animation Animation) {//imageview.setvisibility (view.visible);} @Override Public voidonanimationend (Animation Animation) {flp.setmargins (0,0, 0,viewutil.getdimenvalue (context, "y200")); Imageview.setlayoutparams (FLP); } @Override Public voidonanimationrepeat (Animation Animation) {}};
2. Animation moves slowly: Set the position when the animation starts
Onanimationstart () method inside set, eg:
Animation Translateanim =animationutils.loadanimation (Context, Resourceutil.getanimid (context,"Splash_img_translate_anim")); Fadeinscaletranslateanim.setanimationlistener (listener); Translateanim.setanimationlistener (NewAnimation.animationlistener () {@Override Public voidOnanimationstart (Animation Animation) {flp.setmargins (0,0, 0, Viewutil.getdimenvalue (context, "y50")); Imageview.setlayoutparams (FLP); } @Override Public voidonanimationend (Animation Animation) {} @Override Public voidonanimationrepeat (Animation Animation) {}});
Android Translate animation jumps and moves slowly