use app:itemIconTint in your NavigationView for icons and use app:itemTextColor for textColors Sample : <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- This is used when the Navigation Item is checked --> <item android:color="#009688" android:state_checked="true" /> <!-- This is the default text color --> <item android:color="#E91E63" /> </selector> ...

Usually, when initializing an AdapterView or RecyclerView, you want your adapter to pull the configuration for the items, rather than trying to figure out the timing of pushing configuration in. Not only does this avoid timing issues, but you usually need that code anyway to deal with stuff like item...

I don't understand why adding a Header or Footer view to a ListView is such a big deal. Sure there are some quirks with adding them directly to MvxListView, but you could do the work yourself with very little effort. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:id="@+id/header"...

You can try doing this: First Call the layout of your drawer: mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout); After that set the lock mode like so: mDrawerLayout.setDrawerLockMode(mDrawerLayout.LOCK_MODE_LOCKED_CLOSED); getActionBar().setHomeButtonEnabled(false); // This for the App Icon Then if you want to unlock your drawer again: mDrawerLayout.setDrawerLockMode(mDrawerLayout.LOCK_MODE_UNLOCKED); // It is unlocked but it is not shown....

When you call isDrawerOpen you need to specify which drawer (there can be two - one on the right and one on the left) you are trying to check. So in your case it should be: mDrawerLayout.isDrawerOpen(Gravity.LEFT) ...

Is it possible to place a View above the whole DrawerLayout? Yes. Consider the following layout: <FrameLayout> <DrawerLayout> <FrameLayout> <!-- the content comes here --> </FrameLayout> <!-- one or two drawer views comes here - displayed over content--> </DrawerLayout> <!-- any views that are here will be painted even...

For that you can store that last clicked number in one variable. Then next time do check whether current clicked position is not equal to last store position If it's not equal launch new screen and updated last clicked position else don't do nothing ...

So, I somehow found a solution to this, by reconnecting the DrawerLayout to the ActionBarDrawerToggle each time the device rotates, after recreating the layout: setContentView(R.id.my_layout_id); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerLayout.setDrawerListener(mDrawerToggle); in the onConfigurationChanged method. The only downside to that is that the drawer won't keep its state between the two...

Might be its too late to answer your Question , but it'll help the others , those who are facing the same problem as you.. Set Clickable 'true' to your included layouts i.e your left and right drawer. the clickable event consumes the touch. <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout"...

In your onCreate() after drawer layout and list are found call: mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, mDrawerList); drawerToggle.setDrawerIndicatorEnabled(false); From the Javadoc: public void setDrawerLockMode (int lockMode, View drawerView) Enable or disable interaction with the given drawer. This allows the application to restrict the user's ability to open or close the given drawer. DrawerLayout will...

Arguably, if you've got a left drawer for navigation that can be opened up with a swipe from the left, you should always have the hamburger in the top left for opening it up. Makes your navigation hierarchy sorta messy, because it doesn't obey common conventions for how the hamburger...

ActionBar is available from api level 11. To support below api level 11 you need to use AppCompat from the support library. Reference AppCompat in your android project. You need to extend ActionBarActivity. Use theme derived from Theme.AppCompat in manifest and use getSupportActionBar(). Complete example @ Navigation Drawer with backword...

Kai Brummund inspired me. Here's a port of Drawer Layout for Windows Phone 8 -> https://github.com/jgannaway/windows-phone-navigation-drawer. Note, I haven't tested this rigorously, just made sure it compiled and ran on an actual device....

The 0 resource id was already addressed by other answers: The first item in your list doesn't have a resource id. Either check the resource id is != 0 or just use setImageResource(). Why you still don't see anything is because you assign a null image bitmap two lines below...

Brother for that you need to create your own library just like Jeremy Feinstein who created SlidingMenu library ,google'android uses the concept of navigation drawer (https://developer.android.com/design/patterns/navigation-drawer.html) which is similar to the one created by Jeremy. Creating a drawer layout with the menu fixed is a tough concept and is not...

The issue comes from the android:visibility="gone" element on the LinearLayouts -- For some reason having visibility set to gone conflicts with the DrawerLayout's logic for if the view is showing or not, so it tries to hide it. Taking that out of the XML causes everything to look the same...

Make sure you have the correct dependency to the Android Design Support Library. It's easy to choose the wrong one - because it seems that Google postet two different dependency strings: At the time of this answer, the Android developer blog (and the comment by user hungryghost) had the correct...

itemBackground, itemIconTint and itemTextColor are simple xml-attributes that can be set, though you have to use a custom prefix instead of the android: one. Example <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <!-- Other layout views -->...

You would do this programmatically in your code. You will need the display width and height and then you can modify the width of your linear layout above. You get the height and width with the following: Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); displayViewWidth_ = size.x;...

Only layout is not enough to implementing working DrawerLayout. You have to additional prepare your activity. Please analyse code below: Activity //You have to use ActionBarActivity from support library public class ActivityWithSliderDrawer extends ActionBarActivity{ //you need this object to synchronise state with your activity ActionBarDrawerToggle mActionBarDrawerToggle; DrawerLayout mDrawerLayout; @Override public...

There are 2 possible ways to do that: 1) Use onDrawerSlide(View drawerView, float slideOffset) callback slideOffset changes from 0 to 1. 1 means it is completely open, 0 - closed. Once offset changes from 0 to !0 - it means it started opening process. Something like: mDrawerToggle = new ActionBarDrawerToggle(...

I might be wrong, but I think that you shouldn't initialize your global parameters before the onCreate() method is called. You're trying to initialize them with findViewById() before the contentView was even set. Based on your error log, you've got a NullPointer at mDrawerLayout, which makes me guess that the...