Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipResizeGestureHandler.java +12 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.view.InputEvent; import android.view.InputEventReceiver; import android.view.InputMonitor; import android.view.MotionEvent; import android.view.ViewConfiguration; import com.android.internal.policy.TaskResizingAlgorithm; import com.android.systemui.R; Loading Loading @@ -77,10 +78,12 @@ public class PipResizeGestureHandler { private final Runnable mUpdateMovementBoundsRunnable; private int mDelta; private float mTouchSlop; private boolean mAllowGesture; private boolean mIsAttached; private boolean mIsEnabled; private boolean mEnableUserResize; private boolean mThresholdCrossed; private InputMonitor mInputMonitor; private InputEventReceiver mInputEventReceiver; Loading @@ -100,6 +103,7 @@ public class PipResizeGestureHandler { mPipTaskOrganizer = pipTaskOrganizer; mMovementBoundsSupplier = movementBoundsSupplier; mUpdateMovementBoundsRunnable = updateMovementBoundsRunnable; context.getDisplay().getRealSize(mMaxSize); reloadResources(); Loading @@ -126,6 +130,7 @@ public class PipResizeGestureHandler { private void reloadResources() { final Resources res = mContext.getResources(); mDelta = res.getDimensionPixelSize(R.dimen.pip_resize_edge_size); mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop(); } private void resetDragCorners() { Loading Loading @@ -270,7 +275,12 @@ public class PipResizeGestureHandler { break; case MotionEvent.ACTION_MOVE: // Capture inputs float dx = Math.abs(ev.getX() - mDownPoint.x); float dy = Math.abs(ev.getY() - mDownPoint.y); if (!mThresholdCrossed && dx > mTouchSlop && dy > mTouchSlop) { mThresholdCrossed = true; mInputMonitor.pilferPointers(); } final Rect currentPipBounds = mMotionHelper.getBounds(); mLastResizeBounds.set(TaskResizingAlgorithm.resizeDrag(ev.getX(), ev.getY(), mDownPoint.x, mDownPoint.y, currentPipBounds, mCtrlType, mMinSize.x, Loading @@ -288,6 +298,7 @@ public class PipResizeGestureHandler { mUpdateMovementBoundsRunnable.run(); mCtrlType = CTRL_NONE; mAllowGesture = false; mThresholdCrossed = false; }); }); break; Loading Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipResizeGestureHandler.java +12 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.view.InputEvent; import android.view.InputEventReceiver; import android.view.InputMonitor; import android.view.MotionEvent; import android.view.ViewConfiguration; import com.android.internal.policy.TaskResizingAlgorithm; import com.android.systemui.R; Loading Loading @@ -77,10 +78,12 @@ public class PipResizeGestureHandler { private final Runnable mUpdateMovementBoundsRunnable; private int mDelta; private float mTouchSlop; private boolean mAllowGesture; private boolean mIsAttached; private boolean mIsEnabled; private boolean mEnableUserResize; private boolean mThresholdCrossed; private InputMonitor mInputMonitor; private InputEventReceiver mInputEventReceiver; Loading @@ -100,6 +103,7 @@ public class PipResizeGestureHandler { mPipTaskOrganizer = pipTaskOrganizer; mMovementBoundsSupplier = movementBoundsSupplier; mUpdateMovementBoundsRunnable = updateMovementBoundsRunnable; context.getDisplay().getRealSize(mMaxSize); reloadResources(); Loading @@ -126,6 +130,7 @@ public class PipResizeGestureHandler { private void reloadResources() { final Resources res = mContext.getResources(); mDelta = res.getDimensionPixelSize(R.dimen.pip_resize_edge_size); mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop(); } private void resetDragCorners() { Loading Loading @@ -270,7 +275,12 @@ public class PipResizeGestureHandler { break; case MotionEvent.ACTION_MOVE: // Capture inputs float dx = Math.abs(ev.getX() - mDownPoint.x); float dy = Math.abs(ev.getY() - mDownPoint.y); if (!mThresholdCrossed && dx > mTouchSlop && dy > mTouchSlop) { mThresholdCrossed = true; mInputMonitor.pilferPointers(); } final Rect currentPipBounds = mMotionHelper.getBounds(); mLastResizeBounds.set(TaskResizingAlgorithm.resizeDrag(ev.getX(), ev.getY(), mDownPoint.x, mDownPoint.y, currentPipBounds, mCtrlType, mMinSize.x, Loading @@ -288,6 +298,7 @@ public class PipResizeGestureHandler { mUpdateMovementBoundsRunnable.run(); mCtrlType = CTRL_NONE; mAllowGesture = false; mThresholdCrossed = false; }); }); break; Loading