android - 迁移到 Material 设计 - 我们应该使用工具栏还是操作栏

标签 android material-design

目前,我正在将 Holo 设计的应用程序迁移到 Material 设计的应用程序。

我发现了以下文章: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.

上面的文字对我来说似乎不太清楚。我的第一印象是这样的。

  1. ToolbarActionBar 更强大。它可以完成 ActionBar 可以做的所有事情,还提供一些其他额外的功能。
  2. Google 似乎希望推广 Toolbar 而不是 ActionBar

我想知道,我们如何决定,什么时候应该使用 ActionBar,什么时候应该使用 Toolbar

我想要实现的目标是类似于最新的 Google Play 商店应用。

抽屉导航位于操作栏下方

enter image description here

有collapseActionView

我可以将我的菜单指定为

<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

我发现了最新的 Google Play 报亭

抽屉导航覆盖操作栏

enter image description here

  1. 如果我想要操作栏上的抽屉导航盖功能,工具栏是必须的吗?
  2. 如果我只想拥有抽屉导航位于操作栏下方有collapseActionView功能,将ActionBar 足够了吗?

最佳答案

ActionBars工具栏(刚刚为您创建并添加到 contentView 中),因此区别有点无关紧要。

提醒一下,操作栏上方的抽屉导航是根据 Material Design checklist 的 Material 设计指南并且应该是您使用的唯一模型(official Android App Design Google+ community 上已经进行了很多讨论,它已经证实了这一事实,并且所有 Google 应用程序都正在转向该标准)。

关于android - 迁移到 Material 设计 - 我们应该使用工具栏还是操作栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26696385/

相关文章:

android - InputConnection.commitCorrection() 似乎无法正常工作

android - BottomSheet + ViewPager2 拖动隐藏不起作用

android - 抽屉 android,删除箭头

android - Material 设计 : buttons won't take theme color?

java - Android 在动态壁纸中播放电影文件

Android - Listview 不在 ScrollView 下滚动

android - Styleable无法解析

java - Android卡片 View 集合过滤和排序

css - 覆盖按钮的文本颜色

android - viewpager 视差滚动和滚动时折叠工具栏