Non-standard back button in Action Bar Android - android

I've seen in several apps a non-standard back button (image #2) in the action bar,
Normally when I config a navigation drawer or the setDisplayHomeAsUpEnabled it just looks like image #1
How can i accomplish the non-standard style?

That is not a back button. It is sometimes called a "hamburger icon", and it is specifically used for indicating the presence of DrawerLayout navigation. You can find more information in the Android documentation. You can see more about the icon's functionality here.

Related

Is Android Navigation drawer supposed to be over ActionBar?

As the title suggests, my app uses a side menu using navigation drawer. I got inspired by this official google doc and its nav drawer can be toggled either by swipe from left to right or by clicking on modified home icon on top left of ActionBar.
When nav drawer is drawn, the drawer icon in Actionbar is replaced by back button which in change closes the drawer and returns actionbar to its original state.
But this is where I find problems. As in this different official google doc about material design it is clearly stated that drawer should be over actionbar covering it.
I checked e.g. gmail app uses the latter, i.e. drawer over ActionBar.
Should I follow guidelines #1 or #2?
"The wonderful think about standards is that there are so many to choose from." — Admiral Grace Hopper
I'll start by pointing out that the first link you referenced that talks about closing the drawer by clicking the icon is pre-Material Design. So my choice would be to go with the Material Design-specific recommendation.
Now take a look at this:
The Many Faces Of Google's Hamburger Navigation Drawer | Android Police
Material Navigation Drawer isn't even consistent within Google's own apps.
I think some UX people feel that there should still be a single-touch way to close the drawer in addition to the swipe. Looks like even the dev teams within Google can't come to a consensus.
So consider all your options, then do what makes the most sense for your app.

Navigation Drawer with Action Bar

I am looking for creating an dvd library in android, The design is having navigation drawer for quick navigation, and one action bar which is having only new DVD list count i.e. 4 in image(which is dynamically updated).
Let me share you
First Thing which make confusion for me
why do i need action BAR ? (to just display new items and navigation drawer icon)
I am not sure on which pattern i should follow. I need your input for this. If I need to go with this approach how to achieve custom action bar with navigation drawer on activity.
IMO there's no reason not to adhere to the actionbar pattern.
You anyway need a place where to trigger the open/close of the drawer from. Having the actionbar matches the guidelines and makes the usage of the app intuitive for the user (as it is already used to the pattern).
Also having the actionbar allows you to brand your app more (by keeping keeping the app logo always visible and styling the action bar with your brand colors) and to keep consistency in case you need to add actions in one of the low-level screens (or in the main one, maybe in a future release)
To add the counter to the action bar, see the actionview section at http://developer.android.com/guide/topics/ui/actionbar.html

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.

using action bar sherlock

i'm pretty confused on how to use action bar sherlock.. i've 'installed' it successfully in my apps (I can already see the bar at the top of my apps), but how do I 'configure' it? for example i use this
<item name="abDisplayOptions">useLogo|showHome|homeAsUp|showTitle</item>
so I can see the apps logo in the action bar, the 'back' button at the left side of the logo, but I don't know where should I put the code (and what code to write) to enable the 'back' buttons on action bar, clicking on logo will bring the user to the apps home, and other things such as put a search icon on the action bar and so on.. i tried looking at the actionbarsherlock google groups but I don't know what to search to help me...
Just check the samples here : https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos
And the corresponding code here : https://github.com/JakeWharton/ActionBarSherlock

How to create a back item in ActionBar?

I would like the home item look like the back button in the ActionBar in Android 3.0 app. The look is similar to Market app (see the screenshot below marked in red):
I know there is a standard method to add an "up" affordance to the home button in action bar. But haven't seen a standard way to add a back arrow.
Is there a standard way to do it (maybe subclassing of ActionBar/Activity etc.)? If anyone has an example or has done something like this - it would be very nice if you could share it. Thank you.
UPD: if I use setDisplayHomeAsUpEnabled(true), it adds an up affordance as this - see a tiny up arrow on the left:
Maybe there is a way to style this "up" arrow to be a "back" arrow?
But haven't seen a standard way to add a back arrow.
That is the "up" affordance. Call setDisplayHomeAsUpEnabled(true) on your ActionBar to toggle it on.

Categories

Resources