How to create bended Collapsing Toolbar Layout? - android

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.

Related

Scrollable Collapsing Toolbar in Compose

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.

Is possible have to different menu in Action Bar? (Kotlin)

I have an app, which have an action menu item on the right (2).
I need an ulterior menu in the left(1) or a button in the action bar, is that possible?
I attach a image.
enter image description here
You may create a custom toolbar. The standard height of a toolbar is 89dp.
To create a custom toolbar you should make your activity view container RelativeLayout. Then create a custom toolbar view (it may also be RelativeLayout) which height is 89dp. Then add your toolbar to the main container and set alignParentTop to true. So you have a custom flexible toolbar and you can add any view to it.
This way is very comfortable to use any custom views on your toolbar.
I also faced the same situation of customizing action bar. After a lot of searching I got the solution which is Toolbar.
Checkout: https://developer.android.com/training/appbar/setting-up
I think from now on, you should start using Toolbar as the default action bar for your apps. It provides high level of customization and material design features.

How do I achieve this kind of layout in Android?

What is it called and what kind of library should I use so I can make one like it?
That can be created by using collapsingtoolbar layout along with FAB a.k.a Floating action button . ImageView is placed inside collapsingtoolbar.
For more information see this answer :
Collapsing toolbar with FAB

Add caret below AppBarLayout

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 to have the options menu over the custom toolbar?

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.

Categories

Resources