2
votes

Currently, I'm in the process of migrating a holo designed app to material designed app.

I came across the following article : http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html

In this release, Android introduces a new Toolbar widget. This is a generalization of the Action Bar pattern that gives you much more control and flexibility. Toolbar is a view in your hierarchy just like any other, making it easier to interleave with the rest of your views, animate it, and react to scroll events. You can also set it as your Activity’s action bar, meaning that your standard options menu actions will be display within it.

The above text doesn't seem clear to me. My first impression is that.

  1. Toolbar is more powerful than ActionBar. It can do all what ActionBar can do, yet provide some other extra functionality.
  2. Google seems to want to promote Toolbar over ActionBar

I was wondering, how can we decide, whether when should we use ActionBar, and when should we use Toolbar.

What I want to achieve is something similar to latest Google Play Store app.

Navigation drawer is under action bar

enter image description here

There is collapseActionView

I can specific my menu as

<item 
    android:id="@+id/menu_search"
    android:title="@string/menu_search"
    android:showAsAction="always|collapseActionView"
    android:actionLayout="@layout/collapsible_searchtext"
    android:icon="?attr/actionBarSearchIcon"/>   

enter image description here

I came across latest Google Play Newsstand

Navigation drawer covers over action bar

enter image description here

  1. If I want feature Navigation drawer covers over action bar, is Toolbar is a must?
  2. If I want to have only feature Navigation drawer is under action bar and There is collapseActionView, willl ActionBar be sufficient enough?
1

1 Answers

3
votes

ActionBars are ToolBars (just created and added to the contentView for you) so the difference is a little immaterial.

Just a reminder that Nav drawer over the action bar is the Material design guidelines per the Material Design checklist and should be the only model you use (much discussion has occured on the official Android App Design Google+ community which has confirmed that fact and that all Google apps are moving to that standard).