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

鍍金池/ 教程/ Android/ Best Practices for User Input
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
各個安卓版本引入的主要新特性
Building Apps with Connectivity &amp; the Cloud
List.toArray()再強(qiáng)轉(zhuǎn)是一定會失敗的
深入Android frameworks
Google dev 100 days系列視頻
Building Apps with Contacts &amp; Sign-In
關(guān)系型數(shù)據(jù)庫設(shè)計范式
《App研發(fā)錄》一書
REST API設(shè)計
Google IO 2015摘要
自定義View/ViewGroup以及高性能實現(xiàn)自定義UI
安卓系統(tǒng)點擊事件處理
《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)隊的建議
安卓性能優(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項目架構(gòu)
MVP(Model-View-Presenter)模式
<a rel="nofollow" href="http://www.infoq.com/cn/es6-in-depth/"">
《Android源碼設(shè)計模式解析與實戰(zhàn)》一書
Rx在Android中的最佳實踐
函數(shù)調(diào)用時,傳遞參數(shù)應(yīng)該是不可變的(Immutable)
ProGuard
面向?qū)ο罅笤瓌t(SOLID+)
深入理解Java虛擬機(jī)
深入Java深淺拷貝、immutable、unmodifiable
Best Practices for User Input
UI上的一些高效方式/最佳實踐
<a rel="nofollow" href="https://blog.stylingandroid.com/ripples-
Best Practices for User Interface
安卓測試驅(qū)動開發(fā)/安卓測試驗證
暗時間:學(xué)會正確思考
技術(shù)筆記
Aspect Oriented Programming(AOP)
Best Practices for Background Jobs
安卓系統(tǒng)動效專題
Feed系統(tǒng)的設(shè)計
Data binding(MVVM,Model-View-ViewModel)
Effective Java一書筆記
<a rel="nofollow" href="http://developer.android.com/training/in
Rx (Reactive eXtention)
MultiDex專題
一些很棒的點子
WebRTC

Best Practices for User Input

Using Touch Gestures

  • 手勢檢測
    • 監(jiān)聽touch事件
    • 根據(jù)當(dāng)前及歷史touch事件,判斷是否符合支持的手勢
    • 使用MotionEventCompat的輔助方法從MotionEvent類中讀取信息, 使用GestureDetectorCompat進(jìn)行兼容性的手勢檢測
    • MotionEvent類包含了觸點id(多點觸控支持),位置,壓力等眾多信息, 用于進(jìn)行手勢檢測
    • 使用GestureDetector/GestureDetectorCompat類進(jìn)行手勢檢測, 傳入GestureDetector.OnGestureListener實現(xiàn)類,在View/Activity的 onTouchEvent中把MotionEvent對象傳入detector,系統(tǒng)將會在特定手勢 觸發(fā)時調(diào)用回調(diào),例如:fling, long press等
    • 示例代碼
  • 移動追蹤
    • 會有一個touch slop的概念,觸點在屏幕上移動超過一定距離才會被認(rèn)為是移動
    • 常見的手勢檢測方式有:起止點,移動方向,歷史軌跡,移動速度等
    • 速度追蹤可以使用VelocityTrackerVelocityTrackerCompat類, 代碼示例
  • 為滾動手勢添加動效
    • 大多數(shù)情況下,內(nèi)容所需區(qū)域大于view大小的,都應(yīng)該使用ScrollView或者 ListView/RecyclerView,把滾動的處理交給系統(tǒng)
    • 但也有特殊情況,例如實現(xiàn)滾動手勢時,如果有同樣的效果,體驗會更好, 此時就需要使用Scroller或者OverScroller
    • 更建議使用OverScroller,因為它的兼容性更好,此外,對于內(nèi)容的滾動需求, 應(yīng)該使用ScrollView或者HorizontalScrollView
    • scroller和安卓平臺獨立,只用于記錄位置隨著滾動的變化,使用者需要按照一定 的頻率去獲取位置并應(yīng)用到view上,以得到平滑的滾動效果
    • 滾動的不同類型
      • dragging,滾動內(nèi)容的過程中手指不離開屏幕,只需重寫 GestureDetector.OnGestureListener::onScroll()方法即可
      • flinging,滾動內(nèi)容的時候,快速滾動后手指離開屏幕,內(nèi)容仍需保持一定速度繼續(xù)滾動, 但是逐漸減速直至停止,這種情況下需要重寫GestureDetector.OnGestureListener:: onFling()且結(jié)合scroller
    • fling結(jié)合scroller的示例
  • 多點觸控
    • onTouchEvent回調(diào)的MotionEvent對象中,包含了多觸點的信息
    • 額外觸點的按下、抬起事件:ACTION_POINTER_DOWN, ACTION_POINTER_UP
  • 拖拽和縮放
    • 3.0以上版本有View.OnDragListener可供使用,包括drag drop 陰影等
    • 使用ScaleGestureDetector來進(jìn)行view的縮放支持
  • ViewGroup的點擊事件
    • 使用onInterceptTouchEvent()函數(shù)攔截對子View的點擊事件
    • 使用ViewConfiguration類獲取系統(tǒng)定義的一系列常量:間距,速度,時間等
    • 使用TouchDelegate類,擴(kuò)展子View的點擊熱區(qū),使其點擊熱區(qū)大于子View的邊界

Handling Keyboard Input

  • EditText等輸入控件可以通過inputType屬性設(shè)置輸入類型,一方面控制輸入法的輸入模式, 另一方面限制輸入內(nèi)容
  • 拼寫檢查、自動糾正以及Input Method Action
    • android:inputType="textCapSentences|textAutoCorrect"
    • android:imeOptions="actionSend", actionSearch
    • editText.setOnEditorActionListener
  • 鍵盤可見性變化

    • manifest中可以配置Activity啟動時就顯示鍵盤:android:windowSoftInputMode="stateVisible"
    • 代碼主動顯示鍵盤

      public void showSoftKeyboard(View view) {
          if (view.requestFocus()) {
              InputMethodManager imm = (InputMethodManager)
                      getSystemService(Context.INPUT_METHOD_SERVICE);
              imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
          }
      }   
    • 此外,manifest中通過windowSoftInputMode來控制鍵盤彈起時Layout的變化: adjustResize, adjustPan, adjustUnspecified, adjustNothing
    • 此外,在activity的mode不為adjustNothing時,KeyboardVisibilityEvent庫可以檢測鍵盤彈出和收起事件,也提供了 手動彈出和收起的方法
  • 鍵盤導(dǎo)航:主要用于外接鍵盤的操作,并非跳轉(zhuǎn),而是焦點移動
    • tab鍵:View的android:nextFocusForward屬性,指定當(dāng)前View在獲得焦點狀態(tài)下,按下tab鍵, 焦點移動的下一個View的id
    • 方向鍵:android:nextFocusUp, android:nextFocusDown, android:nextFocusLeft, android:nextFocusRight
  • 直接響應(yīng)鍵盤按鍵:Activity等類實現(xiàn)了KeyEvent.Callback接口可以監(jiān)聽鍵盤事件

Supporting Game Controllers

  • Activity/View的輸入事件回調(diào)有對游戲手柄等專業(yè)設(shè)備的支持