赞
踩
简单点的 TouchEvent 事件传到流程介绍
PanelView.java onTouchEvent ACTION_DOWN schedulePeek() runPeekAnimation() setExpandedHeight ACTION_MOVE 当 !mJustPeeked 为 True 时 setExpandedHeightInternal(newHeight); 当多显示 QS 面板时: setOverExpansion(overExpansionPixels, true /* isPixels */); ACTION_CANCEL endMotionEvent(event, x, y, false /* forceCancel */); fling(vel, expand, isFalseTouch(x, y)); onTrackingStopped(expand); // 将多显示出来的 QS 面板收回去 mNotificationStackScroller.setOverScrolledPixels(0.0f, true /* onTop */, true /* animate */); NotifictionPanelView: onTouchEvent mHeadsUpTouchHelper.isTrackingHeadsUp() 当手松开时 才允许处理 QS 触摸事件. handleQsTouch onQsTouch(event); ACTION_DOWN ACTION_MOVE setQsExpansion(h + mInitialHeightOnTouch); 设置 QS 面板高度 ACTION_UP: flingQsWithCurrentVelocity() // 判断缩回高度, 满足就缩回, 缩回后控制权交给 NotificationStackScrollLayout. 第一阶段面板展开后: NotificationStackScrollLayout: onTouchEvent onScrollTouch 当 QS 面板还没有完全展开时, 负责处理按键事件 UI 显示. ACTION_DOWN boolean isBeingDragged = !mScroller.isFinished(); setIsBeingDragged(isBeingDragged); ACTION_MOVE 向下动 overScrollDown 向上动 overScrollUp ACTION_UP: shouldOverScrollFling(initialVelocity)) // 当滑动速度快时 onOverScrollFling(true, initialVelocity); -> flingSettings 回调 NotifictionPanelView. eles 滑动速度慢时 onOverScrollFling(false, initialVelocity); [补充]: 完全展开后, 触摸事件给到 QS 控件本身, 收起的动作交给 NotifictionPanelView
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。