How can I increase margin between two particular groups? in Navigation Drawer - android

In Navigation drawer If we want to make changes we can create theme in styles then use it , For example textsize? if we increase text size of item it will apply all items text but i want to create margin between particular group
This is a sample from which i want to change my app drawer like this.
please help me...

Simple solution according to me is that you should get item with no title.
Add this to your navigation drawer list:
<item
android:title="" />
Don't forget to disable the click on this item; otherwise, the navigation drawer will close. When clicked at this blank space.

Related

Add title under the icon of navigation drawer

I want to add title under the icon that as default appears when i create the navigation drawer .
like in red border
Its not possible if you use normal ActionBarToggle, you can provide your own custom layout in toolbar and add menu icon to it but back animation will not work. Also you will have to handle click events on the menu your self

Customize Navigation Drawer and Drawer items

How to customize Navigation Drawer menu items like the picture :
and need to disable some drawer items on login status. if user is not login the disabled menu items text color will grey and the background of item color will changed. And non disabled items color will white how to implement Navigation Drawer
Please help me to solve this problem.
you can edit these files inside your project to costumize it as you wished:
layout/nav_header_main.xml
layout/app_bar_main.xml
menu/activity_main_drawer.xml

Keeping Custom Selector Color in Navigation Drawer

Instead of continuing the search on how to do this I thought I would pose the question here and see if I had any luck. I am working on an Android app that uses a navigation drawer and I want a custom color when the user touches one of the items in the drawer (not the default light blue). I have three XML files, one for shape/color when not pressed, one for when pressed, and a selector. All of these work great and when a touch on an item in the navigation drawer takes place it shows red like I want. But when the navigation drawer is slid out again the selected item once again shows the default color of light blue. Does anyone know how to keep this custom color selection persistent?
Thank you very much. I certainly appreciate any help!

Android Actionbar PopupMenu with Custom Item Layouts

I am working on an Android application where I have to design a menu which will populate from the action bar, like this:
I have tried my best but was not able to produce it using the Android controls.
The solutions I have tried are:
With Actionbar, add a menu item with a group with selectable="all", that produces the layout I need but when I click a checkbox for selecting it, the whole menu hides and selection is not done, moreover the menu icon in actionbar does not have the bottom right white arrow.
Tried creating a custom ActionProvider and added the menu items using class's OnPrepareSubMenu method but had the same issue.
I just need a push in the right direction and I can do the rest, suggestions are more than welcome.
Thank you :)
Use popupWindow.
In that you can make any custom layout and set it as content of your popupwindow and also you can specify an ANCHOR in your case it would be
R.id.your_menu_item
set a listener and listen the changes.

Navigation Drawer Problems

in my android project, I have set up a navigation drawer. Now, on swiping, the drawer works fine but I have a few problems that I'd liked solved.
There is no drawer icon to the left side of my launcher icon in the action bar. How do you implement that. Also when I click on the action bar icon, the navigation drawer does not slide in.
I would like to change the color of the text of my ListView inside my navigation drawer. I tried changing android:textColor in the xml layout but it didn't work.
I have the drawer_shadow.9.png drawable of the navigation drawer and I tried implementing it using the setDrawerShadow(drawable, gravity); method but it didn't seem to work. In the two parameters I added the drawable and the ListView R.id for the gravity.
That's just about it. Let me know if you need any more info. Thanks in advance.
There is no drawer icon to the left side of my launcher icon in the action bar. How do you implement that. Also when I click on the action bar icon, the navigation drawer does not slide in.
Use ActionBarDrawerToggle.
I would like to change the color of the text of my ListView inside my navigation drawer. I tried changing android:textColor in the xml layout but it didn't work.
If the "xml layout" is the one for the row, it should work. If the "xml layout" is the one for the drawer (where your ListView is), it should not work.
In the two parameters I added the drawable and the ListView R.id for the gravity.
From elsewhere in the DrawerLayout documentation, I think your interpretation of the second parameter is off:
Gravity.LEFT to move the left drawer or Gravity.RIGHT for the right. GravityCompat.START or GravityCompat.END may also be used.

Categories

Resources