I have a circle at the center of the screen inside which there's an ImageView
+ TextView
. I have another two ImageView
+TextView
, one at the top and another at bottom of the screen.
My requirement is :
I want a copy of the top ImageView
+TextView
and a copy of the bottom ImageView
+TextView
to move in animation into the center of the circle, thereby changing the value of the textView inside the circle.
For example:
Say top textView has value 200 and bottom textview has value 300. I want a portion of those values (say 100 or 150) to animate and move into the circle, but the original values 200 and 300 should remain on the same position.
I've tried using TranslateAnimation
. However I face issues finding the x and y coordinates of the center circle. It is not exactly going to the center of the circle. Also original view's
position is not retained.
TranslateAnimation animation = new
TranslateAnimation(startLayout.getX(),endLayout.getX(),
startLayout.getY(),endLayout.getY);
animation.setDuration(1000);
animation.setFillAfter(false);
startView.startAnimation(animation);
startLayout is the linearlayout in which ImageView and TextView reside. Please help! Thanks!