Material Design也已經出來很久了,網絡上文章也非常多了,開發中我們也或多或少的使用過一些組件。今天我來大致訴說一下我所知道關于Material Design的東西。
組件
v4包:DrawerLayout滑動菜單、SwipeRefreshLayout下拉刷新
v7包:Toolbar頂部菜單、CardView卡片式布局
design包:NavigationView、FloatingActionButton懸浮按鈕、CoordinatorLayout、AppBarLayout、CollapsingToolbarLayout
以上是我所了解的,如果還有也希望大家告訴我。
app屬性
app:layout_anchor=""錨點
app:layout_anchorGravity=""控制位置
app:elevation=""增加陰影
app:pressedTranslationZ="10dp" 按壓后顯示效果
app:rippleColor="#ff0" 點擊后顏色
app:layout_scrollFlags="scroll|enterAlways" 設置滾動標記
app:layout_behavior="" NestedScrollView控件中,設置控件行為
app:layout_collapseMode="pin" 不被折疊,parallax被折疊
app:contentScrim="?attr/colorPrimart" 改變被折疊部分的背景色
app:layout_collapseParallMutiplier 改變視覺差
app:expandedTitleMarginStart="48dp" title距離左邊的距離
app:expandedTitleMarginEnd="64dp" title距離右邊距離
app:contentScrim="?attr/colorPrimary"折疊背景色
以上只是我所知道的而已。
動畫
4、動畫新增
(1).Touch feedback(觸摸反饋)
(2).Reveal effect(揭露效果)
(3).Activity transitions(Activity轉換效果)
(4).Curved motion(曲線效果)
(5).view state changes(視圖狀態改變)
(6).Animate Vector Drawables(可繪矢量圖)
觸摸反饋
android:background="?android:attr/selectableItemBackground"波紋有界
android:attr/selectableItemBackgroundBorderless波紋無界
結束語
今天就先匯總這些,Material Design的東西很多,我用過的只是少數而已,也不能一一道來。