在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ Android/ Best Practices for User Interface
Launch mode 和 Intent flags專題
Canvas & Drawables
UTAustinX_UT.9.01x: Effective Thinking Through Mathematics
《JavaScript 語言精粹》
Memory leak專題
React基礎(chǔ)
《Test Driven Development: By Example》一書
Developer tools
安卓開發(fā)技能樹
<a rel="nofollow" href="https://mp.weixin.qq.com/s?__biz=MzA3NDM
Best Practices for Interaction and Engagement
各個(gè)安卓版本引入的主要新特性
Building Apps with Connectivity &amp; the Cloud
List.toArray()再強(qiáng)轉(zhuǎn)是一定會(huì)失敗的
深入Android frameworks
Google dev 100 days系列視頻
Building Apps with Contacts &amp; Sign-In
關(guān)系型數(shù)據(jù)庫設(shè)計(jì)范式
《App研發(fā)錄》一書
REST API設(shè)計(jì)
Google IO 2015摘要
自定義View/ViewGroup以及高性能實(shí)現(xiàn)自定義UI
安卓系統(tǒng)點(diǎn)擊事件處理
《50 Android Hacks》一書
Building Apps with Content Sharing
Flux基礎(chǔ)
<a rel="nofollow" href="http://developer.android.com/training/in
依賴注入(以Dagger 2為例)
Java同步機(jī)制
Java對象內(nèi)存的使用情況
JSR133(Java memory model)
Google官方Material Design手冊(<a rel="nofollow" href="http://develop
Futurice公司安卓團(tuán)隊(duì)的建議
安卓性能優(yōu)化
  • 1.
Best Practices for Performance
<a rel="nofollow" href="http://www.vogella.com/tutorials/Android
<a rel="nofollow" href="http://blog.danlew.net/2014/11/19/styles
Handling Runtime Changes
<a rel="nofollow" href="http://www.vogella.com/tutorials/Android
Building Apps with Graphics &amp; Animation
<a rel="nofollow" href="http://tools.android.com/tech-docs/new-b
Android項(xiàng)目架構(gòu)
MVP(Model-View-Presenter)模式
<a rel="nofollow" href="http://www.infoq.com/cn/es6-in-depth/"">
《Android源碼設(shè)計(jì)模式解析與實(shí)戰(zhàn)》一書
Rx在Android中的最佳實(shí)踐
函數(shù)調(diào)用時(shí),傳遞參數(shù)應(yīng)該是不可變的(Immutable)
ProGuard
面向?qū)ο罅笤瓌t(SOLID+)
深入理解Java虛擬機(jī)
深入Java深淺拷貝、immutable、unmodifiable
Best Practices for User Input
UI上的一些高效方式/最佳實(shí)踐
<a rel="nofollow" href="https://blog.stylingandroid.com/ripples-
Best Practices for User Interface
安卓測試驅(qū)動(dòng)開發(fā)/安卓測試驗(yàn)證
暗時(shí)間:學(xué)會(huì)正確思考
技術(shù)筆記
Aspect Oriented Programming(AOP)
Best Practices for Background Jobs
安卓系統(tǒng)動(dòng)效專題
Feed系統(tǒng)的設(shè)計(jì)
Data binding(MVVM,Model-View-ViewModel)
Effective Java一書筆記
<a rel="nofollow" href="http://developer.android.com/training/in
Rx (Reactive eXtention)
MultiDex專題
一些很棒的點(diǎn)子
WebRTC

Best Practices for User Interface

Designing for Multiple Screens

  • 支持不同屏幕尺寸
    • layout中盡量使用wrap_contentmatch_parent,而不是固定的數(shù)值
    • 資源文件可以定義不同的Qualifier,根據(jù)屏幕尺寸(dp值,最小寬高dp值,large等),dpi級別,屏幕朝向等等
    • Nine-patch Bitmaps

Adding the App Bar

  • 使用Toolbar,setSupportActionBar設(shè)置tool bar,getSupportActionBar可以返回一個(gè)ActionBar對象(盡管設(shè)置的是tool bar),可以對app bar進(jìn)行相關(guān)操作
  • app bar的action通過option menu進(jìn)行設(shè)置,響應(yīng)在onOptionsItemSelected回調(diào)中
  • up navigation:在manifest中聲明parent activity,同時(shí)設(shè)置getSupportActionBar().setDisplayHomeAsUpEnabled(true);;如此設(shè)置之后就無需在代碼中進(jìn)行響應(yīng)操作了;
  • action view和action provider:例如search view

Showing Pop-Up Messages

  • Snackbar,和Toast類似,但是更符合material design
  • 自動(dòng)消失,可以加入action button
  • 使用在CoordinatorLayout中,還能讓其他View在其顯示時(shí)自動(dòng)上移,協(xié)同顯示

Creating Custom Views

  • 設(shè)計(jì)良好的自定義view首先應(yīng)該是一個(gè)設(shè)計(jì)良好的類,高效利用cpu和內(nèi)存等
  • 且應(yīng)該遵循安卓的標(biāo)準(zhǔn)
  • 提供xml屬性,可以在layout中配置view
  • accessibility && compatibility
  • onDraw函數(shù)中進(jìn)行自定義繪制
  • onSizeChanged函數(shù)中響應(yīng)尺寸的變化,layout的變化
  • onLayout, onMeasure
  • 響應(yīng)輸入事件:點(diǎn)擊、滑動(dòng)、fling等,onTouchEvent
  • TouchEvent的信息比較原始,通??梢允褂孟到y(tǒng)提供的幫助類提供的高級API:GestureDetector
  • fling事件的處理需要結(jié)合Scroller,動(dòng)畫等方式,以達(dá)到真實(shí)世界的物理運(yùn)動(dòng)效果
  • 優(yōu)化view的效率
    • 減小循環(huán)被調(diào)用的函數(shù)的執(zhí)行時(shí)間,例如onDraw;減少其中的內(nèi)存分配;
    • 在初始化,或者動(dòng)畫開始前進(jìn)行對象的創(chuàng)建,避免在動(dòng)畫過程中進(jìn)行內(nèi)存分配;
    • 減少invalidate()的調(diào)用,但是要注意,當(dāng)view的內(nèi)容發(fā)生變化需要更新時(shí),必須要調(diào)用,否則不會(huì)生效;
    • 減少requestLayout()的調(diào)用,它可能會(huì)導(dǎo)致多次遍歷整個(gè)view樹;同時(shí)也應(yīng)該使得布局扁平化,不要太深的嵌套;
    • 如果ui過于復(fù)雜,可以考慮自定義ViewGroup以對ui進(jìn)行加速處理;這時(shí)ViewGroup的子view是滿足特定條件的,可以減少measure, layout的必要;

Creating Backward-Compatible UIs

  • 通過抽象出接口,來定義UI的API,再根據(jù)不同的系統(tǒng)版本,選擇不同的實(shí)現(xiàn),以達(dá)到兼容的目的;
  • 新版系統(tǒng)直接proxy到新的系統(tǒng)API,舊的版本采取自定義實(shí)現(xiàn)方式;

Implementing Accessibility

...

Managing the System UI

  • 包括狀態(tài)欄(頂部),導(dǎo)航欄(底部虛擬按鍵區(qū)域)
  • API 14+,讓status bar可見性為gone,指定theme為@style/Theme.AppCompat.Light.NoActionBar.FullScreen或者@android:style/Theme.Holo.NoActionBar.Fullscreen

      <style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
          <item name="windowNoTitle">true</item>
          <item name="windowActionBar">false</item>
          <item name="android:windowFullscreen">true</item>
          <item name="android:windowContentOverlay">@null</item>
      </style>
  • API 14+,讓navigation bar可見性為gone

      View decorView = getWindow().getDecorView();
      // Hide both the navigation bar and the status bar.
      // SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
      // a general rule, you should design your app to hide the status bar whenever you
      // hide the navigation bar.
      int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                  | View.SYSTEM_UI_FLAG_FULLSCREEN;
      decorView.setSystemUiVisibility(uiOptions);
  • 注意,上述方式有以下問題
    • 用戶點(diǎn)擊任何區(qū)域,都會(huì)導(dǎo)致navigation bar出現(xiàn),且保持可見(屬性被清除);
    • 一旦屬性被清除,需要重新設(shè)置,使得navigation bar重新隱藏;
    • 所以需要decorView.setOnSystemUiVisibilityChangeListener,監(jiān)聽system ui可見性變化,在可見時(shí),通過postDelayed,再次隱藏之;
  • API 19+,以后,引入了SYSTEM_UI_FLAG_IMMERSIVESYSTEM_UI_FLAG_IMMERSIVE_STICKY,前者同樣存在上述問題;
  • 更完整的可以參考最新版AndroidStudio(2.0 preview 7)創(chuàng)建的FullscreenActivity模板;
  • 響應(yīng)system ui可見性的變化

      View decorView = getWindow().getDecorView();
      decorView.setOnSystemUiVisibilityChangeListener
              (new View.OnSystemUiVisibilityChangeListener() {
          @Override
          public void onSystemUiVisibilityChange(int visibility) {
              // Note that system bars will only be "visible" if none of the
              // LOW_PROFILE, HIDE_NAVIGATION, or FULLSCREEN flags are set.
              if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
                  // TODO: The system bars are visible. Make any desired
                  // adjustments to your UI, such as showing the action bar or
                  // other navigational controls.
              } else {
                  // TODO: The system bars are NOT visible. Make any desired
                  // adjustments to your UI, such as hiding the action bar or
                  // other navigational controls.
              }
          }
      });

Material Design for Developers

更多參見material design專題,包括:

  • material theme及其定制;
  • CardView, RecyclerView, item animation;
  • Custom shadows and view clipping;
  • Vector drawables, tint, palette;
  • Custom animations: ripple, reveal, activity transition, shared element transition, curved motion, Animate View State Changes, Animate Vector Drawables;

兼容性維護(hù):

  • 各種backport;
  • Define Alternative Styles;
  • Provide Alternative Layouts;
  • Support Library;