不積跬步無以至千里
一.前摘
最新的手機項目上鎖屏狀態中下拉狀態欄雖然已經下拉了很大距離但是狀態欄還是會收回去,而且頻繁的下拉還是彈回去,所以這裏是個很不好的體驗。我這裏是安裝自己公司的壁紙鎖屏後出現的此問題,僅供參考。
二.分析
其實這裏出現這種情形應該和上一篇博客上滑解鎖困難容易失敗的分析與解決方案,他們的原因是一樣,詳情可以看一下上一篇文章。
這裏我們說一下狀態欄的下拉展開怎麼控制的?
代碼路徑:
app/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
1.整個panelview的攔截(小祕書)
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
//這裏是Qs爲完全展開以及當前打開編輯界面的時候,其實就是處於QuickSettings的編輯界面
if (mBlockTouches || mQsFullyExpanded && mQs.onInterceptTouchEvent(event)) {
return false;
}
initDownStates(event);
// Do not let touches go to shade or QS if the bouncer is visible,
// but still let user swipe down to expand the panel, dismissing the bouncer.