FAQ Database Discussion Community


How to set shared checkable behavior across all groups in NavigationView?

android,navigation-drawer,android-support-library,material-design,navigationview
I've created two groups with unique ids (I need a divider) and they both have checkableBehavior set to single. This allows multiple items from different groups to be checked at once, and that's exactly what I'm trying to avoid. I'd like to have one item checked at maximum, across all...

Change color of NavigationView's divider and deactive itemiconTint attributte

android,navigationview
I have manage to show divider in navigation view using different group id as mentioned in this question. but i want to know how to change the color of the divider and deactive itemiconTint attributte. Thank in advance EDIT: I ask question in comment and @Moinkhan has answer it. so...

NavigationView throwing error: No resource identifier found for attribute 'menu' in package

android,material-design,drawerlayout,androiddesignsupport,navigationview
I am trying to add NavigationView in my layout as below: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin">...

How to position menu items in Navigation View?

android,navigationview
My question is related to recently released Navigation View from Design Support Library. I want to position Log In at the bottom of the Navigation View, how I can do this? My menu XML right now, look like this : <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/navigation_sub_item_1" android:icon="@drawable/ic_action_event"...

How I can remove the unnecessary top padding of the Navigation view?

android,android-support-library,android-design-library,navigationview
There's an unnecessary top padding between the header and the first item shown in this picture. How it can be removed? you can find the source code here: https://github.com/chrisbanes/cheesesquare...

Change Navigation View Item Color Dynamicly Android

android,drawerlayout,androiddesignsupport,navigationview
I'd like to build a navigation drawer where each item has a different selection color (the icon tint and text color) as the google play store has: I'm not sure how they've solved this, I think they use different activities with different drawers. I want to use fragments and I...

How to customize item background and item text color inside NavigationView?

android,material-design,drawerlayout,android-design-library,navigationview
I wanna achieve something like this shown in the Material Design Docs. colorControlHighlight is used for the Background on checked items. I need to customize: background unchecked text color checked text color unchecked ...

How to create a simple divider in the new NavigationView?

android,navigation-drawer,android-support-library,android-design-library,navigationview
Google introduced the NavigationView in the Design Support Library version 22.2.0 with which you can create a drawer very easily using a menu resource. How can I create a simple divider line between two items? Grouping the items didn't work. Creating a sub items section does create a divider line,...

NavigationView menu items with counter on the right

android,navigation-drawer,material-design,androiddesignsupport,navigationview
The new NavigationView in the new Design Support Library works really great. They uses "menu-items" to display the options. But how can I achieve to display a count to the right of the menu item? Like in this picture: Or like in the GMail app....

Android : Using NavigationView as a BaseActivity

android,androiddesignsupport,navigationview
I'm working on design support library and I would like to have "Same Navigation Drawer in different Activities". I tried extending MainActivity with following code, but doesn't work. MainActivity.java public class MainActivity extends AppCompatActivity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mDrawer = (NavigationView) findViewById(R.id.main_drawer); mDrawer.setNavigationItemSelectedListener(this); mDrawerLayout = (DrawerLayout)...

How to set custom typeface to items in NavigationView?

android,android-design-library,navigationview
With the new NavigationView, we are able to set a drawer's items through a menu resource in XML. With that, we can set each item with something like <item android:id="@+id/drawer_my_account" android:icon="@drawable/ic_my_account" android:title="@string/drawer_my_account" /> But now, I want to set a custom typeface to each of those items in my drawer,...

How can I change separator color in NavigationView?

android,navigation-drawer,navigationview
I'm trying to use NavigationView to implement NavigationDrawer. I have added the separator by setting group id in menu. However I can't see the separator. I guess it is because the separator color is same as the background. So I want to change the separator color. But I find no...

Customising NavigationView - Adding dynamic headerView, Android Support Design Library

android,navigation-drawer,android-design-library,androiddesignsupport,navigationview
I tried the navigationView from the new android support design library. I want to have a dynamic headerview. Basically, my headerview will show something like quote of the day. I have like around 10 quotes and i want to randomly select a quote and display in a textview in the...

How do I change the color of the ActionBar hamburger icon?

android,icons,dark,navigationview
I'm using NavigationView from android design support library and toolbar and everything works fine, but I want to know how to make the hamburger icon dark (right now it appears white). Also I wanna adjust distance from screen edge to ActionBar Title. So how do I do this? Thanks for...

NavigationView onClick from xml causes errors

android,navigation-drawer,android-resources,android-design-library,navigationview
Using NavigationView from the newly released Android support design library, if a navigation header layout includes an onClick (in the xml), onClick event crashes app. OnClick can be added programmatically via view.onClickListener (instead of xml), and then clicking works fine. But for some reason, whenever xml onClick is used, there...

Add a ListView or RecyclerView to new NavigationView

android,listview,recyclerview,navigationview
I am using the new NavigationView from revision 22.2.0 of the support library by Google. It works perfectly fine to generate a navigation drawer populated using a menu res. I was wondering is it possible to add a ListView or RecyclerView to the navigation drawer so that it can be...