Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to animate an imageview (when page is scrolled up) to merge in smaller imageview in Toolbar

Initially an image will be shown having upto 1/3 of screen height and full screen width. (android.support.v7.widget.)Toolbar will be gone.

I want to animate ImageView (when page is scrolled up) to be part of Toolbar and make the toolbar visible. While scrolling down reverse action should happen.

Edit: Similar animation can be found here. There is a minor change though, the image of giraffe will move on the toolbar and appear between left arrow and text "item 4". The animation has to be like Shared view or Hero view but on the same activity.

http://antonioleiva.com/collapsing-toolbar-layout/

How can this animation be done?

like image 345
Swapnil Chaudhari Avatar asked Dec 01 '25 06:12

Swapnil Chaudhari


1 Answers

Everything is simpler with the new Android Design Library

Build The Design Library Adding This Link In Your Gradle File

compile "com.android.support:design:23.1.0"

You can achieve exactly this effect by following Below Code

https://github.com/saulmm/CoordinatorBehaviorExample

http://blog.grafixartist.com/toolbar-animation-with-android-design-support-library/

like image 137
Brahmam Yamani Avatar answered Dec 02 '25 21:12

Brahmam Yamani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!