I'd like to know how to make the drawer background to be come dimmer when the drawer is open. I have a transparent Drawer Menu(listView). When the drawer is opened, and for example I have a listview also under a one Menu, the two listviews overlaps. Android has a default dimming of the screen, but I'd like it to be even darker.
Android uses this kind of format: Color.DKGRAY
Update:
public void setScrimColor (int color)
Set a color to use for the scrim that obscures primary content while a drawer is open.
Parameters
color Color to use in 0xAARRGGBB format.
mDrawerLayout.setDrawerShadow(new ColorDrawable(0xff00DDED), GravityCompat.START);
or
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
You can use setScrimColor(int color)
method. As default color is used 0x99000000
. If you want to use color specified in resources you can call:
setScrimColor(getResources().getColor(R.color.some_color))
You will have to write a custom class that extends DrawerLayout. Then you can override some methods such as onDrawerOpen() etc.
In there you can set the background of the main layout. If you're interested in the implementation of DrawerLayout, check it on Grepcode here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With