Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to hide navigation drawer indicator while using appcompat21

I am using the toolbar widget as the ActionBar following Cris Banes Guide. In my use case, i needed to hide the navigation drawer in the activity while swiping to another fragment contained inside ViewPager. Previously, I was using the following properties while using the ActionBar Widget to hide the navigation Drawer. This seemed to work properly. getActionBar().setDisplayHomeAsUpEnabled(false); getActionBar().setHomeButtonEnabled(false);

though now changing to AppCompat21 when using

getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setHomeButtonEnabled(false);

This Doesn't seem to hide the navigation drawer in the actionBar. Am I missing something in this regard any help is appreciated.

like image 679
harshitpthk Avatar asked Mar 02 '15 04:03

harshitpthk


People also ask

How do I change the color of my navigation icon?

This works for me for changing icon color from the menu xml file which you drag in the app:menu attribute of the NavigationView widget. Use app:iconTint attribute to set the icon color.

What is NavigationView in Android?

com.google.android.material.navigation.NavigationView. Represents a standard navigation menu for application. The menu contents can be populated by a menu resource file. NavigationView is typically placed inside a DrawerLayout .


1 Answers

toolbar.setNavigationIcon(null);

It will hide the navigation icon, for reference you can check this answer

like image 184
RobinHood Avatar answered Oct 15 '22 18:10

RobinHood