I knew Sliding Drawer is deprecated. So I imported Sliding Drawer Class to my own package and I customized it to satisfy my requirements. Now the scenario is, I want to add a shadow that wraps both handle and content of the sliding drawer. If I add shadow for handle and content separately (by giving image with shadow as background for both handle and content),then the shadow makes a gap between the handle and content. That is not my requirement. Please guide me through this.
navigationDrawer.setDrawerShadow(R.drawable.someDrawable,GravityCompat.Start);
You will need to use a drawable for the shadow. Use the setDrawerShadow method on the navigationDrawer object.
Related
I want something that should look like this.
The content moving aside for the nav drawer
You need to make a custom Drawer, the regular Drawer doesn't support that functionality. You also cannot use the drawer property of Scaffold. You would have to make a completely dynamic page.
In this video tutorial Fluttery creates a completely custom Drawer, so you might wanna have a look at it for some instructions:
https://www.youtube.com/watch?v=6CEjnCVdgRM&t=7s
I have to create a navigation drawer with a custom menu item.
I know I can create a ListView with custom item layout or use third-party libs etc., but I feel that would be an overkill for this little modification, because the 'default' working method is almost perfect for me.
I have to draw a little rectangle with different color to every menu item.
Can I achieve this with default components somehow?
Finally I've successfully solved the problem by using Mike Penz's MaterialDrawer library with custom drawer item and custom item layout.
I want create navigation drawer in the bottom , when click button open navigation in bottom to up
like this in link
http://imgh.us/Screenshot_2015-08-13-21-27-20_1.png
The default Navigation drawer does not work that way. Consider using
https://github.com/wunderlist/android-sliding-layer-lib
It allows you to configure a view/layout(with your content) that can slide into your screen from any direction.
This answer may be too late for the original asker, but you could get this effect by using a Sliding Drawer. It has since been deprecated, however, there are some nice open source alternatives around, like the ones in the links below:
https://github.com/umano/AndroidSlidingUpPanel
https://github.com/wunderlist/android-sliding-layer-lib
https://github.com/Ali-Rezaei/SlidingDrawer
Is there a quick way to render the shadow that the navigation drawer creates on the inside of the draw, rather than over the main content? Kinda to make it look like the drawer is under the main content, rather than over.
I thought there might be an easy way to do it using setDrawerShadow() but I don't know.
Use a SlidingMenu or Implementing a custom sliding menu.
I would like to try and use the native Google ActionBar class for my application however, I would like to be able to change the left most image dynamically, disable the icon and center the title. I was wondering if this is possible of if I should implement my own ActionBar?
My reason for wanting to change the left most image (IE the navigation drawer indicator) is because I am using the navigation drawer but on some screens would like to display the up indicator instead.
Looking through the documentation for the ActionBarDrawerToggle, there is a method to enable/disable the navigation drawer icon (setDrawerIndicatorEnabled), when disabled it reverts to the home-as-up indicator.
Another option is to recreate the drawer in those specific screens you want the icon different and specify the new icon in the creation of the drawer, not sure if this would work though.
http://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html
Here is the android guide which explains how to do this, but allow me to give a brief overview.
You do not have to have the app icon as the leftmost icon so in certain pages you can disable it by specifying another "android:logo" item in the XML file, or by simply diabling it entirely.
The android logo, which is what you are talking about as the "leftmost item", can have an onClickListener() set for it which is how you can change it simply to an uparrow image which you can download from google.