0

I'm trying to move one view with animation to another, but so far nothing works. I have two views in RelativeLayout and one view should replace the other as follows: I try it but it doesnt work:

TranslateAnimation translateAnimation = new TranslateAnimation(0, second_view.getX(), 0, second_view.getY());
view.startAnimation(translateAnimation);

view_screenshot_image

Amit Gupta
  • 633
  • 1
  • 8
  • 19
  • Hi! Welcome to StackOverflow :) For me your question isn't clear enough. Which Framework do you use? What have you already tried to do in order to solve the problem? – Remy May 06 '20 at 07:41
  • Anyway after seen you have added tags :) Does this helps: https://stackoverflow.com/questions/1660150/move-imageview-around-inside-relativelayout – Remy May 06 '20 at 07:44
  • If it's not compulsory to use Relative layout then you can use Constraint Layouts. See this link: https://robinhood.engineering/beautiful-animations-using-android-constraintlayout-eee5b72ecae3 – Aanal Shah May 06 '20 at 07:49
  • @Remy i need a specific smooth motion animation. I try this but it doesnt work TranslateAnimation translateAnimation = new TranslateAnimation(0, second_view.getX(), 0, second_view.getY()); view.startAnimation(translateAnimation); – Orest Paliy May 06 '20 at 08:13

0 Answers0