Material Design,中文名:材料设计语言,是由Google推出的全新的设计语言,谷歌表示,这种设计语言旨在为手机、平板电脑、台式机和“其他平台”提供更一致、更广泛的“外观和感觉”。
回顾上篇demo:http://blog.csdn.net/king1425/article/details/53445455
android.support.design.widget.TextInputLayout 强大带提示的MD风格的EditText
android.support.design.widget.FloatingActionButton MD风格的圆形按钮,来自于ImageView
android.support.design.widget.Snackbar 类似Toast,添加了简单的单个Action
android.support.design.widget.TabLayout 选项卡
android.support.design.widget.NavigationView DrawerLayout的SlideMenu
android.support.design.widget.CoordinatorLayout 超级FrameLayout
android.support.design.widget.AppBarLayout MD风格的滑动Layout
android.support.design.widget.CollapsingToolbarLayout 可折叠MD风格ToolbarLayout
谷歌原生的两个小demo:
(1)
FloatingActionButton,Snackbar,NavigationView,DrawerLayout,Toolbar,ActionBarDrawerToggle
效果图如下
XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
**app_bar_main.XML**
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.lava.toolbar.firsttoolbar.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@styl