Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java +10 −5 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public class DividerView extends FrameLayout implements View.OnTouchListener, return false; } if (mDoubleTapDetector.onTouchEvent(event)) { return true; } final int action = event.getAction() & MotionEvent.ACTION_MASK; final boolean isLandscape = isLandscape(); // Using raw xy to prevent lost track of motion events while moving divider bar. Loading @@ -136,21 +140,22 @@ public class DividerView extends FrameLayout implements View.OnTouchListener, case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mVelocityTracker.addMovement(event); releaseTouching(); if (!mMoving) break; mVelocityTracker.computeCurrentVelocity(1000 /* units */); final float velocity = isLandscape ? mVelocityTracker.getXVelocity() : mVelocityTracker.getYVelocity(); releaseTouching(); mMoving = false; final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos; final DividerSnapAlgorithm.SnapTarget snapTarget = mSplitLayout.findSnapTarget(position, velocity, false /* hardDismiss */); mSplitLayout.snapToTarget(position, snapTarget); mMoving = false; break; } mDoubleTapDetector.onTouchEvent(event); return true; } Loading Loading @@ -229,7 +234,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener, if (mSplitLayout != null) { mSplitLayout.onDoubleTappedDivider(); } return false; return true; } } } libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,7 @@ public class SplitLayout { } private void flingDividePosition(int from, int to) { if (from == to) return; ValueAnimator animator = ValueAnimator .ofInt(from, to) .setDuration(250); Loading libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ import android.view.VelocityTracker; import android.view.View; import android.view.View.OnTouchListener; import android.view.ViewConfiguration; import android.view.ViewRootImpl; import android.view.ViewTreeObserver.InternalInsetsInfo; import android.view.ViewTreeObserver.OnComputeInternalInsetsListener; import android.view.WindowManager; Loading Loading @@ -524,9 +523,10 @@ public class DividerView extends FrameLayout implements OnTouchListener, case MotionEvent.ACTION_CANCEL: mVelocityTracker.addMovement(event); if (!mMoving) break; x = (int) event.getRawX(); y = (int) event.getRawY(); mVelocityTracker.computeCurrentVelocity(1000); int position = calculatePosition(x, y); stopDragging(position, isHorizontalDivision() ? mVelocityTracker.getYVelocity() Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java +10 −5 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public class DividerView extends FrameLayout implements View.OnTouchListener, return false; } if (mDoubleTapDetector.onTouchEvent(event)) { return true; } final int action = event.getAction() & MotionEvent.ACTION_MASK; final boolean isLandscape = isLandscape(); // Using raw xy to prevent lost track of motion events while moving divider bar. Loading @@ -136,21 +140,22 @@ public class DividerView extends FrameLayout implements View.OnTouchListener, case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mVelocityTracker.addMovement(event); releaseTouching(); if (!mMoving) break; mVelocityTracker.computeCurrentVelocity(1000 /* units */); final float velocity = isLandscape ? mVelocityTracker.getXVelocity() : mVelocityTracker.getYVelocity(); releaseTouching(); mMoving = false; final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos; final DividerSnapAlgorithm.SnapTarget snapTarget = mSplitLayout.findSnapTarget(position, velocity, false /* hardDismiss */); mSplitLayout.snapToTarget(position, snapTarget); mMoving = false; break; } mDoubleTapDetector.onTouchEvent(event); return true; } Loading Loading @@ -229,7 +234,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener, if (mSplitLayout != null) { mSplitLayout.onDoubleTappedDivider(); } return false; return true; } } }
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,7 @@ public class SplitLayout { } private void flingDividePosition(int from, int to) { if (from == to) return; ValueAnimator animator = ValueAnimator .ofInt(from, to) .setDuration(250); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ import android.view.VelocityTracker; import android.view.View; import android.view.View.OnTouchListener; import android.view.ViewConfiguration; import android.view.ViewRootImpl; import android.view.ViewTreeObserver.InternalInsetsInfo; import android.view.ViewTreeObserver.OnComputeInternalInsetsListener; import android.view.WindowManager; Loading Loading @@ -524,9 +523,10 @@ public class DividerView extends FrameLayout implements OnTouchListener, case MotionEvent.ACTION_CANCEL: mVelocityTracker.addMovement(event); if (!mMoving) break; x = (int) event.getRawX(); y = (int) event.getRawY(); mVelocityTracker.computeCurrentVelocity(1000); int position = calculatePosition(x, y); stopDragging(position, isHorizontalDivision() ? mVelocityTracker.getYVelocity() Loading