Android - Benefit of using actionbar over a view? - android

Recently I've heard the recommendation of using actionbar to manage user actions and navigation in the app.
However to implement this and have my app be compatible with lower versions I have to use actionbarsherlock, also I'll have to change some themes, so it comes to my mind: All this looks like a lot of effort when I could just add a custom view to my activities' layout as they need it.
Is there a real benefit in performance or something when using action bar?

I think it's more about user experience. The action bar makes an interface consistent across applications. Here is the quote from developer.android.com
"You should use the action bar in most activities that need to prominently present user actions or global navigation, because the action bar offers users a consistent interface across applications and the system gracefully adapts the action bar's appearance for different screen configurations".
The developer site also says the primary goals of the action bar are to:
Provide a dedicated space for identifying the application brand and user location.
Provide consistent navigation and view refinement across different applications.
Make key actions for the activity (such as "search", "create", "share", etc.) prominent and accessible to the user in a predictable way.

Related

Difference between Action bar and just a custom layout in Android

What is the point of action bars in android if you can just use a custom linear layout and use that? You can add more robust functionality, you can do much more than with the regular app bar, it's less hassle to use. I can only see the advantage when you tie your action bar to the activity, but most of the apps now have different action bars or no action bars at all for different screens.
Why would one choose one over another, or what even is the use case of action bars
As written in the google documentation https://developer.android.com/training/appbar
"The app bar, also known as the action bar, is one of the most important design elements in your app's activities because it provides a visual structure and interactive elements that are familiar to users. [Pay attention to the point 'familiar to users'] Using the app bar makes your app consistent with other Android apps, allowing users to quickly understand how to operate your app and have a great experience. The key functions of the app bar are as follows:
A dedicated space for giving your app an identity and indicating the user's location in the app.
Access to important actions in a predictable way, such as search.
Support for navigation and view switching (with tabs or drop-down lists)."
To your question.
Yes, it is a valid point that custom action bars provide very robust and diverse functionality, but the point here lies in UI/UX part of the software development.
As you saw in the documentation
Familiarity to users
Consistency in design
Users are not comfortable with design changes as in general, because
Most of them do not even care about the design they just have to do what they have to do.
They have to again familiarize themselves to the new design so that they could remember it and navigate through the user interface faster.
So keeping software development aside for a while it becomes a bit difficult for the end-user.
Also, It might be that the default UI elements work better with the operating system [Cache, CPU, etc. ]
This is related to our design , I think when design is sync with Action bar then it is better to use it but if we have flexible design we have to use custom Toolbar.
Some of benefits of an Action bar that cause developers select it at first :
-Makes important actions accessible in a predictable way (such as Search).
-Supports consistent navigation and view switching within apps.(If you use navigation component is very simple to use Action bar)
-Reduces clutter by providing an action overflow for rarely used actions.
-Provides a dedicated space for giving your app an identity.
And finaly Should you replace ActionBar with ToolBar? YES and NO. YES if you want the flexible header that comes with the Toolbar, NO if you don not need those flexible header. by flexibility, you can do things like adding background image, animations,...

how to allow multiple selection of items in list view and show options like in whatsapp

If you use the whatsapp, you notice that you can do a long click on any message to select it. Then to select more messages, a normal click would suffice. Also at the top of the app, certain options become visible like copy, paste, share etc. On touching the back key, the selections are no longer highlighted.
It is very similar to the behaviour of selecting text in any android app, which happens automatically and does not require any kind of coding. Researching on this, I have been led to believe i need to use some combination of CheckedTextViews, selectors, onItemClickListeners etc. to achieve this behaviour.
So before i do attempt to implement this, I would like to ask if this kind of functionality is already available in the android framework?
Researching on this, I have been led to believe i need to use some combination of CheckedTextViews, selectors, onItemClickListeners etc. to achieve this behaviour.
That depends upon your implementation.
I would like to ask if this kind of functionality is already available in the android framework?
Well, that depends upon your precise definition of "this kind of functionality".
Generally speaking, what you are seeing is a contextual action bar (a.k.a., action mode). Here are a series of apps demonstrating the use of a contextual action bar, including one that supports using a long-press on a row to initiate the action mode.

What is the current method of implementing an options menu in an application?

I am relatively new to android development and I'm having a good time so far. My application is functional and I'm ready to add a few options for the user. There seems to be a wealth of information on the ways to do this and I'm having trouble sorting through it and determining which way is the current "accepted" method of providing options to the user.
Does anyone have a great resource to share?
It really depends on the particular app, existing UX, branding and a ton of other design considerations.
In general, starting from scratch, a good starting point (though not universally!) would be the action bar. It gives the user access to ways of manipulating the data on screen, as well as a way of consistently presenting secondary functionality (the overflow menu). Design docs, implementation docs.
I would heartily recommend going through the Patterns section of the design documentation, as it explains the rationale behind many of the core design decisions.
P.S. The reason I'm eager to underline that it's not universal is apps with established UX and user expectations. Examples include Facebook, Path, Google Maps. They all have their reasons for not sticking strictly to the action bar paradigms but they work with it as much as they can.
This Menu Doc page is particularly helpful. But basically if it is API < 11 then you use the hard menu button for an options menu. After 10 the menu items will show in either the ActionBar as action items or in the overflow button. But can still be located in a hard menu button if one exists.
You also always have the option of a contextual menu, primarily with a long click, for things like certain menus depending on the View that is triggered. So maybe show an edit, delete, save menu for a list item.

Android Action Bar Design

I have to design the following for Action Bar.
can we design it without customization.
Please let me know what is the best approach to design it.
EDIT: My application will support Android ICE-cream sandwich and higher versions, so I am not using ActionBarSherlock library.
Thanks
The action bar is a window feature that identifies the application and user location, and provides user actions and navigation modes. You should use the action bar in most activities that need to prominently present user actions or global navigation, because the action bar offers users a consistent interface across applications and the system gracefully adapts the action bar's appearance for different screen configurations
check this Answer. It may help you.

Proper user experience for ActionBar on phones with Menu buttons?

I have an app that's built for Android 2.2, so I'm not using the 3.0+ built-in ActionBar class but rather building my own custom ActionBar implementation using Google's older UI recommendation that was introduced a couple of years ago.
All of my screens have between 1 and 3 actions that can be performed, so they all fit very nicely into the ActionBar UI (which Google recommends has a maximum of three buttons). The problem now is that none of my screens have a regular options menu and so they do nothing when the user presses the hardware Menu button.
According to Google's interface guidelines, this is correct behavior. If your activity doesn't have an options menu then it should do nothing when the Menu button is pressed. I've found during user testing, however, that users are quite perplexed when they press Menu and nothing happens (and every single user has tried, usually multiple times). They say that they appreciate the actions being exposed on the screen through the ActionBar, but at the same time they want the Menu button to do something.
I've been looking at Google's first party apps and it looks like they just always have enough options available to be able to load up the options menu with stuff after the ActionBar is full. Google+ seems to use the Menu button in the traditional way for overflow options on phones that have one, and they show a dropdown menu in the ActionBar for phones that don't. That would work if I had more than three actions but I currently don't.
It seems that the only way to meet my user's expectations is to put some junk options that have no value into the Options Menu just so that something happens when they push the button. I really don't want to do that. Does anybody know of a good way to deal with this problem? Should I just leave the menu button alone and expect people to figure out that it doesn't do anything?
I think it's safe to assume that most users don't know the menu button exists and having all of the actionable items displayed on screen is best. User testing by Google has revealed this and it is why they have chosen to eliminate the menu and go with the built-in action bar starting with Android 3.0 and culminating in the recent 4.0 release.
Something to think about would be added a single "About" item to the pre-3.0 options menu/post-3.0 overflow menu. This could just popup a dialog with simple info about the application (e.g., version, licensing, link to website, author, etc.). This way there is something there should they happen to press the menu button but it is not required in order to properly use each activity to its fullest potential.
I have an app that's built for Android 2.2, so I'm not using the 3.0+ built-in ActionBar class but rather building my own custom ActionBar implementation using Google's older UI recommendation that was introduced a couple of years ago.
As an author of an action bar library this sentence disturbs me. It's fairly trivial to use a custom action bar implementation on pre-3.0 and the native one post-3.0. Take a look at Google's Action Bar Compat sample.
...or, you know, you could also go with a library like ActionBarSherlock that does this for you! </shamelessPlug>

Categories

Resources