I am using gesture listener in my sample app, and in it;s onFling() method I want to perform both Rotate and Translate Animation.
individual both work fine, but when I Integrate it in Animation Set , it's not work in proper .
Please suggest me how can I Handle this.
Following is code of my onFling method :
onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
translateAnimation = new TranslateAnimation(0,x2,0,y2); // x2=e2.getX() and y2=e2.getY()
translateAnimation.setDuration(3000);
rotateAnimation = new RotateAnimation(0, 90, RotateAnimation.RELATIVE_TO_SELF, RotateAnimation.RELATIVE_TO_SELF);
rotateAnimation.setStartOffset(1400);
rotateAnimation.setInterpolator(new AccelerateInterpolator());
animationSet.addAnimation(translateAnimation);
animationSet.addAnimation(rotateAnimation);
animationSet.setAnimationListener(this);
animationSet.setDuration(3000);
lastView.startAnimation(animationSet);
}
Thanking you lot