Transform / Animate View in Activity1 to view in Activity2

I have two ImageViews that contain the same image. Views are located in two different Activities . I need an animation that - for the user - converts Image1 to Image2.

Is it possible to create a Transformation or Animation that resizes and saves the ImageView from Activity1 to the location and size of the ImageView from Acitivity2?

I hope I have made my point of view clearer ...

Thanks!

Ron

+4
source share
2 answers

No (if I understand your question correctly). Events are independent. All you can do is pass attributes (e.g. size, bitmap, etc.) from the first ImageView and apply to the second. Or combine these two actions in one.

+2
source

You can only achieve what you are describing, with very carefully selected custom activity transitions combined with animations for ImageViews. If it is possible to create your own activity transitions, see Activity.overridePendingTransition() . See Also this official guide for general information on creating animations.

If possible, consider redesigning so that you can jump between fragments within the same action or using ViewSwitcher, for example:

 viewSwitcher.setInAnimation(this, R.anim.in_animation); viewSwitcher.setOutAnimation(this, R.anim.out_animation); viewSwitcher.showNext(); 
+1
source

Source: https://habr.com/ru/post/1442308/


All Articles