简体   繁体   中英

Collapsing toolbar with shared element transition

I would like to have a shared element that goes from one fragment to second fragments collapsing toolbar. I guess the base activity should have the collapsing toolbar.

Here is image for better imagination:

动画

I guess if you are handling fragments through viewpager ,you could listen to addOnPageChangeListener and depending on the page you are just pass the element from one fragment to another,and the toolbar containing the shared element could also be made visibl depending upon the current page.

And if you are just replacing the fragment try saving the element and on replacing the old fragment set the element on toolbar. Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM