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.
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.
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 .
toolbar.setNavigationIcon(null);
It will hide the navigation icon, for reference you can check this answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With