I have layout that consist of toolbar, content, and bottom navigation view. I have managed to setting the dialog layout to be below toolbar. But i haven't found a way to do that for the Dim. I want to make Dim of dialog is start below the toolbar, so that my toolbar will not be overlayed. Is there any workaround for that? Like changing the position or give it some top margin. Thanks.
Related
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.
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.
I am implementing the Bottom App Bar (https://material.io/develop/android/components/bottom-app-bar/) and I am facing two challenges.
When using the Navigation component and navigate to a new fragment, the drawer icon turns int <- back button but it is black. Any way to change its color?
If I set the behavior to
myAppBar.hideOnScroll = true
then when I am in a Recyclerview and I scroll up, the bar gets hidden which is really nice. However, if I navigate to a new fragment, the bar remains hidden. How can I programatically show the bar again?
LE: 1. was fixed by using android:theme ThemeOverlay.MaterialComponents.Dark.ActionBar
Edit: The BottomAppBar can now be scrolled on or off the screen programatically. See https://issuetracker.google.com/issues/111925683
For now you could just set or animate the translationY property of the BottomAppBar to be 0. And perform the animations run by the BottomAppBar.Behavior on the fab: https://github.com/material-components/material-components-android/blob/841ba156fc33e721b991684c8a4bb4afdc56d90c/lib/java/com/google/android/material/bottomappbar/BottomAppBar.java#L754-L782
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.
I am working on a bottom toolbar for android by forking the SlidingUpPanel at:
https://github.com/umano/AndroidSlidingUpPanel
I want to make it always on top of every thing not defined in my sliding up panel. But when I slide it up, if there is something behind it, my layout is acting like it's transparent. How can I fix it to act like a real toolbar ?
before sliding :
after sliding :
source : http://www.4shared.com/rar/jeA2gbZy/androidslidinguppanel-master.html
Add a onClickListener to the root view of sliding up pannel.I did that and it works well, hope it works for you too.
Set a background to the button and change text color.
I dont think they are transparent but the text just has the same color and the button has a transparent background by default.