Layout模組化介紹

40
LAYOUT 模模模模模模模 本本本本本本本本本
  • Upload

    -
  • Category

    Software

  • view

    670
  • download

    6

TAGS:

description

Android layout模組化設計

Transcript of Layout模組化介紹

Page 1: Layout模組化介紹

LAYOUT 模組化經驗分享

本簡報僅供教學使用

Page 2: Layout模組化介紹

我是 ?

Page 3: Layout模組化介紹

參與過的專案

Page 4: Layout模組化介紹

2010~2011 晰語科技2011~2013 神乎科技2013~ 至今 邑泰科技

興趣 : 閱讀、壘球、程式

Page 5: Layout模組化介紹

一個有點慘的故事… .

Page 6: Layout模組化介紹
Page 7: Layout模組化介紹

一個人時… ..

X5Ctrl + C &Ctrl + V?

Page 8: Layout模組化介紹

五個人時… .

X5X5?Ctrl + C &Ctrl + V??Pattern?

Page 9: Layout模組化介紹

DRY = Don‘t repeat yourself

重複的程式碼 (DUPLICATED CODE)

Page 10: Layout模組化介紹

美好的日子總有結束的一天 ?

Page 11: Layout模組化介紹

修求變更

?

Page 12: Layout模組化介紹

其實問題還不少… . 如果這是一個持續了兩年的案子… 修改需要的時間 ? 修改的範圍 ?

Page 13: Layout模組化介紹

時間有限… .? 青春有限… .!我是個有效率懶惰的工程師

Page 14: Layout模組化介紹

沒有不好的做法…只有更好的做法 ! 很好那… . 該怎麼做會更好 ?

Page 15: Layout模組化介紹

團隊作戰的利基,良好的規範

Page 16: Layout模組化介紹

密技 ?! RefactorAlt + Shift + R => Rename(Windows)

Page 17: Layout模組化介紹

更好的寫法 ?style

Page 18: Layout模組化介紹

Refactor Android

Page 19: Layout模組化介紹

Style 結構

Page 20: Layout模組化介紹

更模組化 ?

Page 21: Layout模組化介紹

優化 ?

Page 22: Layout模組化介紹
Page 23: Layout模組化介紹
Page 24: Layout模組化介紹
Page 25: Layout模組化介紹

\sdk\tools\hierarchyviewer

Page 26: Layout模組化介紹
Page 27: Layout模組化介紹
Page 28: Layout模組化介紹

Theme

Manifast

Page 29: Layout模組化介紹

\sdk\platforms\android-18\data\res\values\public.xml

Page 30: Layout模組化介紹

style.xml

Page 31: Layout模組化介紹

attrs.xml

Page 32: Layout模組化介紹

theme.xml

Page 33: Layout模組化介紹
Page 34: Layout模組化介紹
Page 35: Layout模組化介紹

Custom View

Page 36: Layout模組化介紹
Page 37: Layout模組化介紹
Page 38: Layout模組化介紹

Design or Over Design?

初期需求 or 需求變更 ?神預測 ?

Page 39: Layout模組化介紹

多處引用 ?Y N

values單一元件Y N

style 沒程式互動 or attribute 

Y N

include view

免責聲明 僅供參考 後果自負 XD

Page 40: Layout模組化介紹

Q&A