How to drive MotionLayout animation while scrolling…like Google Chrome

六月ゝ 毕业季﹏ 提交于 2021-02-11 04:03:18

问题


I think we all know this behavior of Google Chrome on Android where you scroll down and the menu bar disappears.

This is no problem with "OnSwipe" in a motion scene file.

The problems I have are regarding the reversed behavior where you can scroll up somewhere in the middle of a page and while doing that the menu bar appears again.

I tried this with a NestedScrollView in a MotionLayout and for me it seams like I can only drive the MotionLayout's animation when the NestedScrollView isn't scrolling. When I reached the top of the scrollview my fake menu bar appeared again.

Is there any way to drive the animation while scrolling? Or do you have an example how this Chrome's behaubir can be achieved with MotionLayout?

All the best, Chris

来源:https://stackoverflow.com/questions/61105979/how-to-drive-motionlayout-animation-while-scrolling-like-google-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!