Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Return the view to the original position and move again (Android)

I’m trying to move an image back to its original position and then move it 200 pixels. Each line of this program works fine separately, but these two lines don’t work together.

When I use two lines like below, the image does not move and stays in place

binding.BannerUp.animate().translationY(0).setDuration(0);
binding.BannerUp.animate().translationY(200).setDuration(2000);

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

try this:

binding.BannerUp.setTranslationX(0);
binding.BannerUp.animate().translationY(200).setDuration(2000);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading