Android6.0狀態列(系統下拉狀態列的定製)

來源:互聯網
上載者:User

標籤:void   tar   git   books   sdn   androi   開始   arw   intercept   

■目標

不允許使用者從上到下下拉狀態列

■案1

截獲手勢,不處理該手勢。

SystemGesturesPointerEventListener

public void onPointerEvent(MotionEvent event) {

if (swipe == SWIPE_FROM_TOP) {

不調用手勢處理}

■案1效果

無效果。

adb log發現代碼確實走到了,說明這裡只是一個通知機制。

 

■案2

在狀態列上進行中斷手勢或者touch命令

StatusBarWindowView的onInterceptTouchEvent方法實現進行修正,直接返回true。

■案2效果

符合預期

 

■狀態列知識點總結

家庭:        屬於SystemUI層級。是特殊的系統層級的UI組件。SystemUI = 狀態列+底部導覽列+近期APP列表+截屏操作+電量警告等等

載體:        以APK形式存在

生命開始:   AMS.systemReady()方法系統就緒後,startSystemUi

2兄弟布局: PhoneWindowManager.mHasSystemNavBar  狀態列與導覽列分離(PhoneStatusBar)  vs  狀態列與導覽列合體(TabletStatusBar)

1兒子:       BaseStatusBar 藉助IStatusBarService處理請求 createAndAddWindows(各兄弟自己實現布局單元)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

http://blog.csdn.net/yin1031468524/article/details/51532663

https://wizardforcel.gitbooks.io/deepin-android-vol3/content/7.html

adb logcat PanelBar:D PhoneStatusBar:D WindowManager:D *:S

adb logcat WifiHW:D *:S 

 

SystemGesturesPointerEventListener

 

Android6.0狀態列(系統下拉狀態列的定製)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.