I was trying find a ready solution for it but couldn't.
The idea is to make the expanded toolbar with big title and when the content is not fit on the screen make it scrollable. The scroll behaviour is like this:
Expanded toolbar should be disappeared under a regular fix toolbar (height = 56.dp). Regular fix toolbar zIndex should be higher than disappearing expanded toolbar. No Motion effect. The big title from the disappearing toolbar should start to appear in the collapsed toolbar center (See attached screenshots)
In the toolbar body I should be able to work with ConstaintLayout component.
Mentioning this because when I was trying my custom solutions I had issues with height calculations right after I use ConstraintLayout.
I would really appreciate everyone for help.
Related
I had tried by using collapsing toolbar it is not worked since it had fixed toolbar height.
I want to achieve something like this on picture:
I want to have TabLayout(Left) 200DP, and Burger icon for Navigation Drawer(Right).
Problem is that AppBarLayout don't support Horizontal orientation property. Just vertical.
I would like to import toolbar and TabLayout on same view. I saw on some apps that it's possible.
I managed to get 200DP TabLayout. Other than that - nope. Tried to put all into CoordinatorLayout and overlay icon over the AppBarlayout. On designer that looks same like on picture that I posted. When I run it - I don't see that layout overlaying AppBarLayout. I assume that AppBarLayout is above it.
Anyone have idea about this?
I'm trying to do what's highlighted on the image, but no luck so far.
Any suggestions on how could I do this? This raises some questions regarding the elevation, which is the main problem.
The Toolbar is set up properly and the rest (white space) will be views that are also set up inside the AppBarLayout.
How can we create a collapsing toolbar layout like Yahoo News Digest application ?
Have you tried adding app:behavior_overlapTop="50dp" to your scrolling view? (This is the default behavior. Code can be found here.)
Apparently, it should support that attribute to make the scrolling view overlap your app bar.
Start by implementing the square collapsing toolbar as you can find in many other guides and then set that parameter.
If that does not work, you could write your own Behavior I guess, inspiring from the one I linked you (which is the default AppBarLayout behavior that allow the coordinator layout to collapse the top part.
To make the image not square you need to use a semi-transparent image or edit it by code.
I have a similar problem as found on this specific question.
I'm using a Toolbar from the v7 support library, and a custom layout. If I have no options menu, I have a result similar to what OP has on the question linked above:
However if I have an options menu, it shifts the toolbar a little bit to the left (start). I would like to have it over the toolbar.
Is it possible? The only way I could hack it is by adding a negative right (end) margin to the toolbar layout, however this moves the menu outside of the screen…
Initially, the whole Toolbar contained several views, so they had to share the width with the action menu.
Now instead I wrapped the Toolbar and the other views in a container (a FrameLayout), so that they overlap without sharing the width. I just need to be careful with the margin at the top so that the other views don't overlap with action icons.