Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +15 −5 Original line number Diff line number Diff line Loading @@ -227,6 +227,16 @@ public abstract class PanelView extends FrameLayout { mUnlockFalsingThreshold = res.getDimensionPixelSize(R.dimen.unlock_falsing_threshold); } private void addMovement(MotionEvent event) { // Add movement to velocity tracker using raw screen X and Y coordinates instead // of window coordinates because the window frame may be moving at the same time. float deltaX = event.getRawX() - event.getX(); float deltaY = event.getRawY() - event.getY(); event.offsetLocation(deltaX, deltaY); mVelocityTracker.addMovement(event); event.offsetLocation(-deltaX, -deltaY); } public void setTouchAndAnimationDisabled(boolean disabled) { mTouchDisabled = disabled; if (mTouchDisabled) { Loading Loading @@ -307,7 +317,7 @@ public abstract class PanelView extends FrameLayout { mTouchAboveFalsingThreshold = false; mCollapsedAndHeadsUpOnDown = isFullyCollapsed() && mHeadsUpManager.hasPinnedHeadsUp(); mVelocityTracker.addMovement(event); addMovement(event); if (!mGestureWaitForTouchSlop || (mHeightAnimator != null && !mHintAnimationRunning) || mPeekAnimator != null) { mTouchSlopExceeded = (mHeightAnimator != null && !mHintAnimationRunning) Loading Loading @@ -341,7 +351,7 @@ public abstract class PanelView extends FrameLayout { } break; case MotionEvent.ACTION_MOVE: mVelocityTracker.addMovement(event); addMovement(event); float h = y - mInitialTouchY; // If the panel was collapsed when touching, we only need to check for the Loading Loading @@ -386,7 +396,7 @@ public abstract class PanelView extends FrameLayout { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mVelocityTracker.addMovement(event); addMovement(event); endMotionEvent(event, x, y, false /* forceCancel */); break; } Loading Loading @@ -573,7 +583,7 @@ public abstract class PanelView extends FrameLayout { mHasLayoutedSinceDown = false; mUpdateFlingOnLayout = false; mTouchAboveFalsingThreshold = false; mVelocityTracker.addMovement(event); addMovement(event); break; case MotionEvent.ACTION_POINTER_UP: final int upPointer = event.getPointerId(event.getActionIndex()); Loading @@ -593,7 +603,7 @@ public abstract class PanelView extends FrameLayout { break; case MotionEvent.ACTION_MOVE: final float h = y - mInitialTouchY; mVelocityTracker.addMovement(event); addMovement(event); if (scrolledToBottom || mTouchStartedInEmptyArea || mAnimatingOnDown) { float hAbs = Math.abs(h); if ((h < -mTouchSlop || (mAnimatingOnDown && hAbs > mTouchSlop)) Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +15 −5 Original line number Diff line number Diff line Loading @@ -227,6 +227,16 @@ public abstract class PanelView extends FrameLayout { mUnlockFalsingThreshold = res.getDimensionPixelSize(R.dimen.unlock_falsing_threshold); } private void addMovement(MotionEvent event) { // Add movement to velocity tracker using raw screen X and Y coordinates instead // of window coordinates because the window frame may be moving at the same time. float deltaX = event.getRawX() - event.getX(); float deltaY = event.getRawY() - event.getY(); event.offsetLocation(deltaX, deltaY); mVelocityTracker.addMovement(event); event.offsetLocation(-deltaX, -deltaY); } public void setTouchAndAnimationDisabled(boolean disabled) { mTouchDisabled = disabled; if (mTouchDisabled) { Loading Loading @@ -307,7 +317,7 @@ public abstract class PanelView extends FrameLayout { mTouchAboveFalsingThreshold = false; mCollapsedAndHeadsUpOnDown = isFullyCollapsed() && mHeadsUpManager.hasPinnedHeadsUp(); mVelocityTracker.addMovement(event); addMovement(event); if (!mGestureWaitForTouchSlop || (mHeightAnimator != null && !mHintAnimationRunning) || mPeekAnimator != null) { mTouchSlopExceeded = (mHeightAnimator != null && !mHintAnimationRunning) Loading Loading @@ -341,7 +351,7 @@ public abstract class PanelView extends FrameLayout { } break; case MotionEvent.ACTION_MOVE: mVelocityTracker.addMovement(event); addMovement(event); float h = y - mInitialTouchY; // If the panel was collapsed when touching, we only need to check for the Loading Loading @@ -386,7 +396,7 @@ public abstract class PanelView extends FrameLayout { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mVelocityTracker.addMovement(event); addMovement(event); endMotionEvent(event, x, y, false /* forceCancel */); break; } Loading Loading @@ -573,7 +583,7 @@ public abstract class PanelView extends FrameLayout { mHasLayoutedSinceDown = false; mUpdateFlingOnLayout = false; mTouchAboveFalsingThreshold = false; mVelocityTracker.addMovement(event); addMovement(event); break; case MotionEvent.ACTION_POINTER_UP: final int upPointer = event.getPointerId(event.getActionIndex()); Loading @@ -593,7 +603,7 @@ public abstract class PanelView extends FrameLayout { break; case MotionEvent.ACTION_MOVE: final float h = y - mInitialTouchY; mVelocityTracker.addMovement(event); addMovement(event); if (scrolledToBottom || mTouchStartedInEmptyArea || mAnimatingOnDown) { float hAbs = Math.abs(h); if ((h < -mTouchSlop || (mAnimatingOnDown && hAbs > mTouchSlop)) Loading