When I click on the button, 4 images placed in the center should move from center to 4 corners.
How it is possible by using
You can use the translationX and translationY property of the ObjectAnimator to achieve this.
You need to get the new position you want to move to. (endX,endY) It's better to use functions to arrive at this rather than hardcoding, to avoid making the animation look weird on different devices.
After that's done, Follow this...
ObjectAnimator transX = ObjectAnimator.ofFloat(yourView,"x",startPos,endPos); ObjectAnimator transY = ObjectAnimator.ofFloat(yourView,"y",startPos,endPos); AnimatorSet animSetXY = new AnimatorSet(); animSetXY.playTogether(transX, transY); animSetXY.start();
You can personalise your animator by using
Hope this helps.