在Android開發(fā)中,Android系統(tǒng)本身就有一套自己的界面標(biāo)準(zhǔn),但奈何現(xiàn)在的產(chǎn)品經(jīng)理PM都是果粉导梆。設(shè)計師也是果粉一切的交互與設(shè)計都是按照IOS的規(guī)范來的。最近因妇,我大谷歌在Android8.0后提出了android的圖標(biāo)適配方案问潭,在官方文檔中有說明。我們發(fā)現(xiàn)官方的圖標(biāo)適配中說明了android的圖標(biāo)應(yīng)該是圓形的婚被。這讓一直推崇扁平化的圓角矩形的ios一眾設(shè)計師啪啪打臉啊。作為android攻城獅的我真是感到無比的爽快梳虽。谷歌在新版本上對于設(shè)計提出了 Meterial Design 越來越多的主流App采用這種風(fēng)格的設(shè)計址芯。所以有針對性的系統(tǒng)的學(xué)習(xí)一下Material Design很有必要。
經(jīng)驗(yàn)不足窜觉,水平有限谷炸。只是整理自己用過的和學(xué)習(xí)過程中的記錄。請大神多多指教禀挫。
關(guān)于Meterial Design
Meterial Design是google在Android在5.0之后采用的新的設(shè)計語言旬陡。所謂的設(shè)計語言就是指的更多的是設(shè)計的風(fēng)格、理念语婴、原則描孟。中文直譯為“原材料設(shè)計”。
擬物設(shè)計和扁平化設(shè)計一種結(jié)合體驗(yàn)砰左。還吸取了最新一些科技理念匿醒。
層次感:View Z軸
1.對于美工:遵循MD的界面設(shè)計、圖標(biāo)合集缠导。
2.對于產(chǎn)品經(jīng)理:遵循MD界面設(shè)計廉羔、頁面的跳轉(zhuǎn)及動畫效果、交互設(shè)計僻造。
3.對于開發(fā)人員:參與原型設(shè)計憋他、輔助美工原型設(shè)計的素材準(zhǔn)備孩饼。
開發(fā)實(shí)現(xiàn)MD的設(shè)計----界面、動畫竹挡、轉(zhuǎn)場動畫等等镀娶。
詳細(xì)介紹請看:
官方網(wǎng)站: https://developer.android.com/design/index.html
國內(nèi)有翻譯網(wǎng)站: http://wiki.jikexueyuan.com/project/material-design/material-design-intro/introduction.html
MD的使用及開發(fā)
使用Meterial Design控制全局樣式
- 引入appcompat-v7
- 寫自己的全局樣式
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:textColor">@color/mytextcolor</item>
<item name="colorPrimary">@color/colorPrimary_pink</item>
<item name="colorPrimaryDark">@color/colorPrimary_pinkDark</item>
<item name="android:windowBackground">@color/background</item>
<item name="colorAccent">@color/accent_material_dark</item>
<item name="navigationBarColor">@color/colorPrimary</item> # 設(shè)置底部導(dǎo)航欄的背景顏色
</style>
- colorPrimary:主色
- colorPrimaryDark:主色--深色 一般用于狀態(tài)欄顏色 底部導(dǎo)航欄顏色
- colorAccent:代表各個空間的基調(diào)顏色---CheckBox、RadioButton此迅、ProgressBar等
- android:textColor:當(dāng)前所有的文本顏色
Meterial Design 兼容性控件的使用
在appcompat-v7 里面有很多為兼容而生的控件
- android.support.v7.app.AlertDialog 對話框兼容控件
- 進(jìn)度條樣式設(shè)置
style="@style/Widget.AppCompat.ProgressBar.Horizontal" - SwipeRefreshLayout下拉刷新
- PopupWindow
ListPopupWindow
PopupMenu - android.support.v7.widget.LinearLayoutCompat
給包裹在里面的所有子控件添加間隔線
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
app:divider="@drawable/abc_list_divider_mtrl_alpha"
app:showDividers="beginning|middle"
android:orientation="vertical" >
v7 RecyclerView
- RecyclerView是谷歌在高級版本提出的一個替代ListView汽畴、GridView的控件
- 高度解耦
- 自帶了性能優(yōu)化 ViewHolder