How to remove Navigation drawer icon - android

How to remove pointed icon in Navigation Drawer, I just playing with Navigation Drawer, I just wanted to maintain only one icon.

I had same issue and I solved with adding this line in onCreate():
getActionBar().setDisplayHomeAsUpEnabled(false);
it will hide icon from navigation drawer.

Which implementation are you using for the Navigation Drawer?
Also, why do you want to remove it? You could keep the icon there and use an actual icon instead of one trying to show that it is a menu next to your "Home" text.

Is it a bit too late for answer?
1 way to remove the 3 stripes from the app is
replace the ic_drawer.png in every drawable folder with nothing (eg. with transparent icon)
You also can replace with any icon you want too.

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

how to set navigation drawer in bottom to up

I want create navigation drawer in the bottom , when click button open navigation in bottom to up
like this in link
http://imgh.us/Screenshot_2015-08-13-21-27-20_1.png
The default Navigation drawer does not work that way. Consider using
https://github.com/wunderlist/android-sliding-layer-lib
It allows you to configure a view/layout(with your content) that can slide into your screen from any direction.
This answer may be too late for the original asker, but you could get this effect by using a Sliding Drawer. It has since been deprecated, however, there are some nice open source alternatives around, like the ones in the links below:
https://github.com/umano/AndroidSlidingUpPanel
https://github.com/wunderlist/android-sliding-layer-lib
https://github.com/Ali-Rezaei/SlidingDrawer

Adding a custom navigation drawer action bar icon

I've implemented a navigation drawer, and it has the standard 3 lines going across.
I've been looking around for methods to change that icon, but I haven't found much luck. I really only want to make the lines more spaced out and longer (like in the playstore).
Any suggestions?
If I understand correctly, you're looking to change the
icon
There is a Navigation Drawer Indicator Generator in the Android Asset Studio.
The icon is available for download in the Android training lesson Creating a Navigation Drawer.
As far as I can tell, you can follow that tutorial and swap in whatever icon you'd like.

Setting Navigation Icon on Android ActionBar

So I'm working on adding ActionBarSherlock and the Navigation Drawer to a project that previously implemented a custom (very poorly written) "action bar". Instead of using fragments and a backstack of activities for navigation, some activities show and hide different layouts. (That is, suppose I am in a list mode and then select a button to go into an edit screen. The app currently hides the list layout and shows another layout.).
So I've added actionbar sherlock and a navigation drawer to all the activities. I want to be able to programmatically switch the navigation icon from the 3 lines to the arrow when certain buttons are pressed.
I can't figure out how to do this though. Any ideas?
Thanks!
The solution to this problem is to use the method:
setDrawerIndicatorEnabled(boolean enable)
inside the ActionBarDrawerToggle class.
After:
drawer.setDrawerListener(toggle);
Use this code:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.select);
It depends how wedded you are to built-in actionbar artifacts. You can always redraw the current actionbar by inflating a layout of your choosing, then calling
getSherlockActivity().getSupportActionBar().setDisplayShowTitleEnabled(false);
getSherlockActivity().getSupportActionBar().setDisplayShowHomeEnabled(false);
getSherlockActivity().getSupportActionBar().setDisplayShowCustomEnabled(true);
// Inflate and do whatever you need to your view...
getSherlockActivity().getSupportActionBar().setCustomView(abView);
getSherlockActivity().getSupportActionBar().show();
When you want to go back to your standard (assuming you're using a DrawerLayout to do your navigation drawer), you can just set make a call to setDisplayShowCustomEnabled(false) (re-enable showHome and showTitle as you please).
As far as I know, customization of the back button can only be done via themes. Besides, swapping the drawer icon for the back icon (within the same Activity) doesn't make sense, since users would still be able to access the navigation drawer by sliding the left most edge to the right. It just wouldn't make sense.
If you absolutely need the back icon, then it would make the most sense to make that screen a new Activity since you would indeed be adding another "level" to the stack, which is what the back icon represents.

Benefits of native ActionBar vs custom implementation?

I would like to try and use the native Google ActionBar class for my application however, I would like to be able to change the left most image dynamically, disable the icon and center the title. I was wondering if this is possible of if I should implement my own ActionBar?
My reason for wanting to change the left most image (IE the navigation drawer indicator) is because I am using the navigation drawer but on some screens would like to display the up indicator instead.
Looking through the documentation for the ActionBarDrawerToggle, there is a method to enable/disable the navigation drawer icon (setDrawerIndicatorEnabled), when disabled it reverts to the home-as-up indicator.
Another option is to recreate the drawer in those specific screens you want the icon different and specify the new icon in the creation of the drawer, not sure if this would work though.
http://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html
Here is the android guide which explains how to do this, but allow me to give a brief overview.
You do not have to have the app icon as the leftmost icon so in certain pages you can disable it by specifying another "android:logo" item in the XML file, or by simply diabling it entirely.
The android logo, which is what you are talking about as the "leftmost item", can have an onClickListener() set for it which is how you can change it simply to an uparrow image which you can download from google.

Categories

Resources