I have some problems with AppBarLayout and CollapsingToolbarLayout. This is what currently happens:
https://www.youtube.com/watch?v=z4yD8rmjSjU
The downwards scr
Customisation of CoordinatorLayout
behaviour is hard. You want the orange bar to appear immediately but ImageView only after the content is scrolled to the top, but these views belong to one parent CollapsingToolbarLayout
and both get either the behaviour you have now or the opposite with enterAlwaysCollapsed
flag. I see no way to separate the behaviour for these views without messing with CoordinatorLayout/CollapsingToolbarLayout Java API.
If simpler behaviour is not an option and noone here points out a simple solution, I suggest trying a relatively new MotionLayout
instead of dancing with CollapsingToolbarLayout
internals, you will save yourself a lot of time in the end. It will be a little harder at start but it provides clear ways for customisation. Here's a very good article that shows how to build a UX similar to CoordinatorLayout
but using MotionLayout
. And the second part of this article with some additional customisations.