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

鍍金池/ 教程/ Android/ Best Practices for User Input
Launch mode 和 Intent flags專(zhuān)題
Canvas & Drawables
UTAustinX_UT.9.01x: Effective Thinking Through Mathematics
《JavaScript 語(yǔ)言精粹》
Memory leak專(zhuān)題
React基礎(chǔ)
《Test Driven Development: By Example》一書(shū)
Developer tools
安卓開(kāi)發(fā)技能樹(shù)
<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()再?gòu)?qiáng)轉(zhuǎn)是一定會(huì)失敗的
深入Android frameworks
Google dev 100 days系列視頻
Building Apps with Contacts &amp; Sign-In
關(guān)系型數(shù)據(jù)庫(kù)設(shè)計(jì)范式
《App研發(fā)錄》一書(shū)
REST API設(shè)計(jì)
Google IO 2015摘要
自定義View/ViewGroup以及高性能實(shí)現(xiàn)自定義UI
安卓系統(tǒng)點(diǎn)擊事件處理
《50 Android Hacks》一書(shū)
Building Apps with Content Sharing
Flux基礎(chǔ)
<a rel="nofollow" href="http://developer.android.com/training/in
依賴(lài)注入(以Dagger 2為例)
Java同步機(jī)制
Java對(duì)象內(nèi)存的使用情況
JSR133(Java memory model)
Google官方Material Design手冊(cè)(<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)》一書(shū)
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
安卓測(cè)試驅(qū)動(dòng)開(kāi)發(fā)/安卓測(cè)試驗(yàn)證
暗時(shí)間:學(xué)會(huì)正確思考
技術(shù)筆記
Aspect Oriented Programming(AOP)
Best Practices for Background Jobs
安卓系統(tǒng)動(dòng)效專(zhuān)題
Feed系統(tǒng)的設(shè)計(jì)
Data binding(MVVM,Model-View-ViewModel)
Effective Java一書(shū)筆記
<a rel="nofollow" href="http://developer.android.com/training/in
Rx (Reactive eXtention)
MultiDex專(zhuān)題
一些很棒的點(diǎn)子
WebRTC

Best Practices for User Input

Using Touch Gestures

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

Handling Keyboard Input

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

    • manifest中可以配置Activity啟動(dòng)時(shí)就顯示鍵盤(pán):android:windowSoftInputMode="stateVisible"
    • 代碼主動(dòng)顯示鍵盤(pán)

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

Supporting Game Controllers

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