Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +23 −16 Original line number Diff line number Diff line Loading @@ -281,12 +281,18 @@ public class PanelView extends FrameLayout { mHandleView.setPressed(false); mBar.onTrackingStopped(PanelView.this); trackMovement(event); float vel = 0, yVel = 0, xVel = 0; boolean negative = false; if (mVelocityTracker != null) { // the velocitytracker might be null if we got a bad input stream mVelocityTracker.computeCurrentVelocity(1000); float yVel = mVelocityTracker.getYVelocity(); boolean negative = yVel < 0; yVel = mVelocityTracker.getYVelocity(); negative = yVel < 0; float xVel = mVelocityTracker.getXVelocity(); xVel = mVelocityTracker.getXVelocity(); if (xVel < 0) { xVel = -xVel; } Loading @@ -294,11 +300,15 @@ public class PanelView extends FrameLayout { xVel = mFlingGestureMaxXVelocityPx; // limit how much we care about the x axis } float vel = (float)Math.hypot(yVel, xVel); vel = (float)Math.hypot(yVel, xVel); if (vel > mFlingGestureMaxOutputVelocityPx) { vel = mFlingGestureMaxOutputVelocityPx; } mVelocityTracker.recycle(); mVelocityTracker = null; } // if you've barely moved your finger, we treat the velocity as 0 // preventing spurious flings due to touch screen jitter final float deltaY = Math.abs(mFinalTouchY - mInitialTouchY); Loading @@ -321,9 +331,6 @@ public class PanelView extends FrameLayout { fling(vel, true); mVelocityTracker.recycle(); mVelocityTracker = null; break; } return true; Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +23 −16 Original line number Diff line number Diff line Loading @@ -281,12 +281,18 @@ public class PanelView extends FrameLayout { mHandleView.setPressed(false); mBar.onTrackingStopped(PanelView.this); trackMovement(event); float vel = 0, yVel = 0, xVel = 0; boolean negative = false; if (mVelocityTracker != null) { // the velocitytracker might be null if we got a bad input stream mVelocityTracker.computeCurrentVelocity(1000); float yVel = mVelocityTracker.getYVelocity(); boolean negative = yVel < 0; yVel = mVelocityTracker.getYVelocity(); negative = yVel < 0; float xVel = mVelocityTracker.getXVelocity(); xVel = mVelocityTracker.getXVelocity(); if (xVel < 0) { xVel = -xVel; } Loading @@ -294,11 +300,15 @@ public class PanelView extends FrameLayout { xVel = mFlingGestureMaxXVelocityPx; // limit how much we care about the x axis } float vel = (float)Math.hypot(yVel, xVel); vel = (float)Math.hypot(yVel, xVel); if (vel > mFlingGestureMaxOutputVelocityPx) { vel = mFlingGestureMaxOutputVelocityPx; } mVelocityTracker.recycle(); mVelocityTracker = null; } // if you've barely moved your finger, we treat the velocity as 0 // preventing spurious flings due to touch screen jitter final float deltaY = Math.abs(mFinalTouchY - mInitialTouchY); Loading @@ -321,9 +331,6 @@ public class PanelView extends FrameLayout { fling(vel, true); mVelocityTracker.recycle(); mVelocityTracker = null; break; } return true; Loading