Rename DragResizeCallback to DragPositioningCallback.
This CL renames DragResizeCallback to DragPositioningCallback to better reflect the interface's purpose of handling both drag to move and drag to resize events. Bug: None Test: Manual: drag windows to resize and move Test: atest WMShellUnitTests Change-Id: I89eb1413a8a0c69eb1e75829ca65711a114e7a18
This commit is contained in:
@@ -174,7 +174,7 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
|
||||
final CaptionTouchEventListener touchEventListener =
|
||||
new CaptionTouchEventListener(taskInfo, taskPositioner);
|
||||
windowDecoration.setCaptionListeners(touchEventListener, touchEventListener);
|
||||
windowDecoration.setDragResizeCallback(taskPositioner);
|
||||
windowDecoration.setDragPositioningCallback(taskPositioner);
|
||||
windowDecoration.setDragDetector(touchEventListener.mDragDetector);
|
||||
windowDecoration.relayout(taskInfo, startT, finishT);
|
||||
setupCaptionColor(taskInfo, windowDecoration);
|
||||
@@ -185,17 +185,17 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
|
||||
|
||||
private final int mTaskId;
|
||||
private final WindowContainerToken mTaskToken;
|
||||
private final DragResizeCallback mDragResizeCallback;
|
||||
private final DragPositioningCallback mDragPositioningCallback;
|
||||
private final DragDetector mDragDetector;
|
||||
|
||||
private int mDragPointerId = -1;
|
||||
|
||||
private CaptionTouchEventListener(
|
||||
RunningTaskInfo taskInfo,
|
||||
DragResizeCallback dragResizeCallback) {
|
||||
DragPositioningCallback dragPositioningCallback) {
|
||||
mTaskId = taskInfo.taskId;
|
||||
mTaskToken = taskInfo.token;
|
||||
mDragResizeCallback = dragResizeCallback;
|
||||
mDragPositioningCallback = dragPositioningCallback;
|
||||
mDragDetector = new DragDetector(this);
|
||||
}
|
||||
|
||||
@@ -247,20 +247,20 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
|
||||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: {
|
||||
mDragPointerId = e.getPointerId(0);
|
||||
mDragResizeCallback.onDragResizeStart(
|
||||
mDragPositioningCallback.onDragPositioningStart(
|
||||
0 /* ctrlType */, e.getRawX(0), e.getRawY(0));
|
||||
break;
|
||||
}
|
||||
case MotionEvent.ACTION_MOVE: {
|
||||
int dragPointerIdx = e.findPointerIndex(mDragPointerId);
|
||||
mDragResizeCallback.onDragResizeMove(
|
||||
mDragPositioningCallback.onDragPositioningMove(
|
||||
e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx));
|
||||
break;
|
||||
}
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL: {
|
||||
int dragPointerIdx = e.findPointerIndex(mDragPointerId);
|
||||
mDragResizeCallback.onDragResizeEnd(
|
||||
mDragPositioningCallback.onDragPositioningEnd(
|
||||
e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL
|
||||
|
||||
private View.OnClickListener mOnCaptionButtonClickListener;
|
||||
private View.OnTouchListener mOnCaptionTouchListener;
|
||||
private DragResizeCallback mDragResizeCallback;
|
||||
private DragPositioningCallback mDragPositioningCallback;
|
||||
private DragResizeInputListener mDragResizeListener;
|
||||
private DragDetector mDragDetector;
|
||||
|
||||
@@ -78,8 +78,8 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL
|
||||
mOnCaptionTouchListener = onCaptionTouchListener;
|
||||
}
|
||||
|
||||
void setDragResizeCallback(DragResizeCallback dragResizeCallback) {
|
||||
mDragResizeCallback = dragResizeCallback;
|
||||
void setDragPositioningCallback(DragPositioningCallback dragPositioningCallback) {
|
||||
mDragPositioningCallback = dragPositioningCallback;
|
||||
}
|
||||
|
||||
void setDragDetector(DragDetector dragDetector) {
|
||||
@@ -151,7 +151,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL
|
||||
mChoreographer,
|
||||
mDisplay.getDisplayId(),
|
||||
mDecorationContainerSurface,
|
||||
mDragResizeCallback);
|
||||
mDragPositioningCallback);
|
||||
}
|
||||
|
||||
final int touchSlop = ViewConfiguration.get(mResult.mRootView.getContext())
|
||||
|
||||
@@ -209,17 +209,17 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
|
||||
|
||||
private final int mTaskId;
|
||||
private final WindowContainerToken mTaskToken;
|
||||
private final DragResizeCallback mDragResizeCallback;
|
||||
private final DragPositioningCallback mDragPositioningCallback;
|
||||
private final DragDetector mDragDetector;
|
||||
|
||||
private int mDragPointerId = -1;
|
||||
|
||||
private DesktopModeTouchEventListener(
|
||||
RunningTaskInfo taskInfo,
|
||||
DragResizeCallback dragResizeCallback) {
|
||||
DragPositioningCallback dragPositioningCallback) {
|
||||
mTaskId = taskInfo.taskId;
|
||||
mTaskToken = taskInfo.token;
|
||||
mDragResizeCallback = dragResizeCallback;
|
||||
mDragPositioningCallback = dragPositioningCallback;
|
||||
mDragDetector = new DragDetector(this);
|
||||
}
|
||||
|
||||
@@ -283,13 +283,13 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
|
||||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: {
|
||||
mDragPointerId = e.getPointerId(0);
|
||||
mDragResizeCallback.onDragResizeStart(
|
||||
mDragPositioningCallback.onDragPositioningStart(
|
||||
0 /* ctrlType */, e.getRawX(0), e.getRawY(0));
|
||||
break;
|
||||
}
|
||||
case MotionEvent.ACTION_MOVE: {
|
||||
final int dragPointerIdx = e.findPointerIndex(mDragPointerId);
|
||||
mDragResizeCallback.onDragResizeMove(
|
||||
mDragPositioningCallback.onDragPositioningMove(
|
||||
e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx));
|
||||
break;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
|
||||
final int dragPointerIdx = e.findPointerIndex(mDragPointerId);
|
||||
final int statusBarHeight = mDisplayController
|
||||
.getDisplayLayout(taskInfo.displayId).stableInsets().top;
|
||||
mDragResizeCallback.onDragResizeEnd(
|
||||
mDragPositioningCallback.onDragPositioningEnd(
|
||||
e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx));
|
||||
if (e.getRawY(dragPointerIdx) <= statusBarHeight) {
|
||||
if (DesktopModeStatus.isProto2Enabled()) {
|
||||
@@ -557,7 +557,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
|
||||
final DesktopModeTouchEventListener touchEventListener =
|
||||
new DesktopModeTouchEventListener(taskInfo, taskPositioner);
|
||||
windowDecoration.setCaptionListeners(touchEventListener, touchEventListener);
|
||||
windowDecoration.setDragResizeCallback(taskPositioner);
|
||||
windowDecoration.setDragPositioningCallback(taskPositioner);
|
||||
windowDecoration.setDragDetector(touchEventListener.mDragDetector);
|
||||
windowDecoration.relayout(taskInfo, startT, finishT);
|
||||
incrementEventReceiverTasks(taskInfo.displayId);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
|
||||
|
||||
private View.OnClickListener mOnCaptionButtonClickListener;
|
||||
private View.OnTouchListener mOnCaptionTouchListener;
|
||||
private DragResizeCallback mDragResizeCallback;
|
||||
private DragPositioningCallback mDragPositioningCallback;
|
||||
private DragResizeInputListener mDragResizeListener;
|
||||
private DragDetector mDragDetector;
|
||||
|
||||
@@ -90,8 +90,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
|
||||
mOnCaptionTouchListener = onCaptionTouchListener;
|
||||
}
|
||||
|
||||
void setDragResizeCallback(DragResizeCallback dragResizeCallback) {
|
||||
mDragResizeCallback = dragResizeCallback;
|
||||
void setDragPositioningCallback(DragPositioningCallback dragPositioningCallback) {
|
||||
mDragPositioningCallback = dragPositioningCallback;
|
||||
}
|
||||
|
||||
void setDragDetector(DragDetector dragDetector) {
|
||||
@@ -179,7 +179,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
|
||||
mChoreographer,
|
||||
mDisplay.getDisplayId(),
|
||||
mDecorationContainerSurface,
|
||||
mDragResizeCallback);
|
||||
mDragPositioningCallback);
|
||||
}
|
||||
|
||||
final int touchSlop = ViewConfiguration.get(mResult.mRootView.getContext())
|
||||
|
||||
@@ -19,28 +19,28 @@ package com.android.wm.shell.windowdecor;
|
||||
/**
|
||||
* Callback called when receiving drag-resize or drag-move related input events.
|
||||
*/
|
||||
public interface DragResizeCallback {
|
||||
public interface DragPositioningCallback {
|
||||
/**
|
||||
* Called when a drag resize starts.
|
||||
* Called when a drag-resize or drag-move starts.
|
||||
*
|
||||
* @param ctrlType {@link TaskPositioner.CtrlType} indicating the direction of resizing, use
|
||||
* {@code 0} to indicate it's a move
|
||||
* @param x x coordinate in window decoration coordinate system where the drag resize starts
|
||||
* @param y y coordinate in window decoration coordinate system where the drag resize starts
|
||||
* @param x x coordinate in window decoration coordinate system where the drag starts
|
||||
* @param y y coordinate in window decoration coordinate system where the drag starts
|
||||
*/
|
||||
void onDragResizeStart(@TaskPositioner.CtrlType int ctrlType, float x, float y);
|
||||
void onDragPositioningStart(@TaskPositioner.CtrlType int ctrlType, float x, float y);
|
||||
|
||||
/**
|
||||
* Called when the pointer moves during a drag resize.
|
||||
* Called when the pointer moves during a drag-resize or drag-move.
|
||||
* @param x x coordinate in window decoration coordinate system of the new pointer location
|
||||
* @param y y coordinate in window decoration coordinate system of the new pointer location
|
||||
*/
|
||||
void onDragResizeMove(float x, float y);
|
||||
void onDragPositioningMove(float x, float y);
|
||||
|
||||
/**
|
||||
* Called when a drag resize stops.
|
||||
* Called when a drag-resize or drag-move stops.
|
||||
* @param x x coordinate in window decoration coordinate system where the drag resize stops
|
||||
* @param y y coordinate in window decoration coordinate system where the drag resize stops
|
||||
*/
|
||||
void onDragResizeEnd(float x, float y);
|
||||
void onDragPositioningEnd(float x, float y);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class DragResizeInputListener implements AutoCloseable {
|
||||
private final SurfaceControl mDecorationSurface;
|
||||
private final InputChannel mInputChannel;
|
||||
private final TaskResizeInputEventReceiver mInputEventReceiver;
|
||||
private final com.android.wm.shell.windowdecor.DragResizeCallback mCallback;
|
||||
private final DragPositioningCallback mCallback;
|
||||
|
||||
private int mWidth;
|
||||
private int mHeight;
|
||||
@@ -83,7 +83,7 @@ class DragResizeInputListener implements AutoCloseable {
|
||||
Choreographer choreographer,
|
||||
int displayId,
|
||||
SurfaceControl decorationSurface,
|
||||
DragResizeCallback callback) {
|
||||
DragPositioningCallback callback) {
|
||||
mInputManager = context.getSystemService(InputManager.class);
|
||||
mHandler = handler;
|
||||
mChoreographer = choreographer;
|
||||
@@ -293,7 +293,7 @@ class DragResizeInputListener implements AutoCloseable {
|
||||
float rawX = e.getRawX(0);
|
||||
float rawY = e.getRawY(0);
|
||||
int ctrlType = calculateCtrlType(isTouch, x, y);
|
||||
mCallback.onDragResizeStart(ctrlType, rawX, rawY);
|
||||
mCallback.onDragPositioningStart(ctrlType, rawX, rawY);
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
@@ -305,7 +305,7 @@ class DragResizeInputListener implements AutoCloseable {
|
||||
int dragPointerIndex = e.findPointerIndex(mDragPointerId);
|
||||
float rawX = e.getRawX(dragPointerIndex);
|
||||
float rawY = e.getRawY(dragPointerIndex);
|
||||
mCallback.onDragResizeMove(rawX, rawY);
|
||||
mCallback.onDragPositioningMove(rawX, rawY);
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ class DragResizeInputListener implements AutoCloseable {
|
||||
case MotionEvent.ACTION_CANCEL: {
|
||||
if (mShouldHandleEvents) {
|
||||
int dragPointerIndex = e.findPointerIndex(mDragPointerId);
|
||||
mCallback.onDragResizeEnd(
|
||||
mCallback.onDragPositioningEnd(
|
||||
e.getRawX(dragPointerIndex), e.getRawY(dragPointerIndex));
|
||||
}
|
||||
mShouldHandleEvents = false;
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.window.WindowContainerTransaction;
|
||||
|
||||
import com.android.wm.shell.ShellTaskOrganizer;
|
||||
|
||||
class TaskPositioner implements DragResizeCallback {
|
||||
class TaskPositioner implements DragPositioningCallback {
|
||||
|
||||
@IntDef({CTRL_TYPE_UNDEFINED, CTRL_TYPE_LEFT, CTRL_TYPE_RIGHT, CTRL_TYPE_TOP, CTRL_TYPE_BOTTOM})
|
||||
@interface CtrlType {}
|
||||
@@ -38,8 +38,8 @@ class TaskPositioner implements DragResizeCallback {
|
||||
private final WindowDecoration mWindowDecoration;
|
||||
|
||||
private final Rect mTaskBoundsAtDragStart = new Rect();
|
||||
private final PointF mResizeStartPoint = new PointF();
|
||||
private final Rect mResizeTaskBounds = new Rect();
|
||||
private final PointF mRepositionStartPoint = new PointF();
|
||||
private final Rect mRepositionTaskBounds = new Rect();
|
||||
private boolean mHasMoved = false;
|
||||
|
||||
private int mCtrlType;
|
||||
@@ -57,7 +57,7 @@ class TaskPositioner implements DragResizeCallback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDragResizeStart(int ctrlType, float x, float y) {
|
||||
public void onDragPositioningStart(int ctrlType, float x, float y) {
|
||||
mHasMoved = false;
|
||||
|
||||
mDragStartListener.onDragStart(mWindowDecoration.mTaskInfo.taskId);
|
||||
@@ -65,11 +65,11 @@ class TaskPositioner implements DragResizeCallback {
|
||||
|
||||
mTaskBoundsAtDragStart.set(
|
||||
mWindowDecoration.mTaskInfo.configuration.windowConfiguration.getBounds());
|
||||
mResizeStartPoint.set(x, y);
|
||||
mRepositionStartPoint.set(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDragResizeMove(float x, float y) {
|
||||
public void onDragPositioningMove(float x, float y) {
|
||||
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
||||
if (changeBounds(wct, x, y)) {
|
||||
// The task is being resized, send the |dragResizing| hint to core with the first
|
||||
@@ -84,7 +84,7 @@ class TaskPositioner implements DragResizeCallback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDragResizeEnd(float x, float y) {
|
||||
public void onDragPositioningEnd(float x, float y) {
|
||||
// |mHasMoved| being false means there is no real change to the task bounds in WM core, so
|
||||
// we don't need a WCT to finish it.
|
||||
if (mHasMoved) {
|
||||
@@ -96,42 +96,44 @@ class TaskPositioner implements DragResizeCallback {
|
||||
|
||||
mCtrlType = CTRL_TYPE_UNDEFINED;
|
||||
mTaskBoundsAtDragStart.setEmpty();
|
||||
mResizeStartPoint.set(0, 0);
|
||||
mRepositionStartPoint.set(0, 0);
|
||||
mHasMoved = false;
|
||||
}
|
||||
|
||||
private boolean changeBounds(WindowContainerTransaction wct, float x, float y) {
|
||||
// |mResizeTaskBounds| is the bounds last reported if |mHasMoved| is true. If it's not true,
|
||||
// we can compare it against |mTaskBoundsAtDragStart|.
|
||||
final int oldLeft = mHasMoved ? mResizeTaskBounds.left : mTaskBoundsAtDragStart.left;
|
||||
final int oldTop = mHasMoved ? mResizeTaskBounds.top : mTaskBoundsAtDragStart.top;
|
||||
final int oldRight = mHasMoved ? mResizeTaskBounds.right : mTaskBoundsAtDragStart.right;
|
||||
final int oldBottom = mHasMoved ? mResizeTaskBounds.bottom : mTaskBoundsAtDragStart.bottom;
|
||||
// |mRepositionTaskBounds| is the bounds last reported if |mHasMoved| is true. If it's not
|
||||
// true, we can compare it against |mTaskBoundsAtDragStart|.
|
||||
final int oldLeft = mHasMoved ? mRepositionTaskBounds.left : mTaskBoundsAtDragStart.left;
|
||||
final int oldTop = mHasMoved ? mRepositionTaskBounds.top : mTaskBoundsAtDragStart.top;
|
||||
final int oldRight = mHasMoved ? mRepositionTaskBounds.right : mTaskBoundsAtDragStart.right;
|
||||
final int oldBottom =
|
||||
mHasMoved ? mRepositionTaskBounds.bottom : mTaskBoundsAtDragStart.bottom;
|
||||
|
||||
final float deltaX = x - mResizeStartPoint.x;
|
||||
final float deltaY = y - mResizeStartPoint.y;
|
||||
mResizeTaskBounds.set(mTaskBoundsAtDragStart);
|
||||
final float deltaX = x - mRepositionStartPoint.x;
|
||||
final float deltaY = y - mRepositionStartPoint.y;
|
||||
mRepositionTaskBounds.set(mTaskBoundsAtDragStart);
|
||||
if ((mCtrlType & CTRL_TYPE_LEFT) != 0) {
|
||||
mResizeTaskBounds.left += deltaX;
|
||||
mRepositionTaskBounds.left += deltaX;
|
||||
}
|
||||
if ((mCtrlType & CTRL_TYPE_RIGHT) != 0) {
|
||||
mResizeTaskBounds.right += deltaX;
|
||||
mRepositionTaskBounds.right += deltaX;
|
||||
}
|
||||
if ((mCtrlType & CTRL_TYPE_TOP) != 0) {
|
||||
mResizeTaskBounds.top += deltaY;
|
||||
mRepositionTaskBounds.top += deltaY;
|
||||
}
|
||||
if ((mCtrlType & CTRL_TYPE_BOTTOM) != 0) {
|
||||
mResizeTaskBounds.bottom += deltaY;
|
||||
mRepositionTaskBounds.bottom += deltaY;
|
||||
}
|
||||
if (mCtrlType == CTRL_TYPE_UNDEFINED) {
|
||||
mResizeTaskBounds.offset((int) deltaX, (int) deltaY);
|
||||
mRepositionTaskBounds.offset((int) deltaX, (int) deltaY);
|
||||
}
|
||||
|
||||
if (oldLeft == mResizeTaskBounds.left && oldTop == mResizeTaskBounds.top
|
||||
&& oldRight == mResizeTaskBounds.right && oldBottom == mResizeTaskBounds.bottom) {
|
||||
if (oldLeft == mRepositionTaskBounds.left && oldTop == mRepositionTaskBounds.top
|
||||
&& oldRight == mRepositionTaskBounds.right
|
||||
&& oldBottom == mRepositionTaskBounds.bottom) {
|
||||
return false;
|
||||
}
|
||||
wct.setBounds(mWindowDecoration.mTaskInfo.token, mResizeTaskBounds);
|
||||
wct.setBounds(mWindowDecoration.mTaskInfo.token, mRepositionTaskBounds);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,13 +66,13 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
|
||||
@Test
|
||||
fun testDragResize_notMove_skipsTransactionOnEnd() {
|
||||
taskPositioner.onDragResizeStart(
|
||||
taskPositioner.onDragPositioningStart(
|
||||
CTRL_TYPE_TOP or CTRL_TYPE_RIGHT,
|
||||
STARTING_BOUNDS.left.toFloat(),
|
||||
STARTING_BOUNDS.top.toFloat()
|
||||
)
|
||||
|
||||
taskPositioner.onDragResizeEnd(
|
||||
taskPositioner.onDragPositioningEnd(
|
||||
STARTING_BOUNDS.left.toFloat() + 10,
|
||||
STARTING_BOUNDS.top.toFloat() + 10
|
||||
)
|
||||
@@ -87,18 +87,18 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
|
||||
@Test
|
||||
fun testDragResize_noEffectiveMove_skipsTransactionOnMoveAndEnd() {
|
||||
taskPositioner.onDragResizeStart(
|
||||
taskPositioner.onDragPositioningStart(
|
||||
CTRL_TYPE_TOP or CTRL_TYPE_RIGHT,
|
||||
STARTING_BOUNDS.left.toFloat(),
|
||||
STARTING_BOUNDS.top.toFloat()
|
||||
)
|
||||
|
||||
taskPositioner.onDragResizeMove(
|
||||
taskPositioner.onDragPositioningMove(
|
||||
STARTING_BOUNDS.left.toFloat(),
|
||||
STARTING_BOUNDS.top.toFloat()
|
||||
)
|
||||
|
||||
taskPositioner.onDragResizeEnd(
|
||||
taskPositioner.onDragPositioningEnd(
|
||||
STARTING_BOUNDS.left.toFloat() + 10,
|
||||
STARTING_BOUNDS.top.toFloat() + 10
|
||||
)
|
||||
@@ -113,13 +113,13 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
|
||||
@Test
|
||||
fun testDragResize_hasEffectiveMove_issuesTransactionOnMoveAndEnd() {
|
||||
taskPositioner.onDragResizeStart(
|
||||
taskPositioner.onDragPositioningStart(
|
||||
CTRL_TYPE_TOP or CTRL_TYPE_RIGHT,
|
||||
STARTING_BOUNDS.left.toFloat(),
|
||||
STARTING_BOUNDS.top.toFloat()
|
||||
)
|
||||
|
||||
taskPositioner.onDragResizeMove(
|
||||
taskPositioner.onDragPositioningMove(
|
||||
STARTING_BOUNDS.left.toFloat() + 10,
|
||||
STARTING_BOUNDS.top.toFloat()
|
||||
)
|
||||
@@ -133,7 +133,7 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
}
|
||||
})
|
||||
|
||||
taskPositioner.onDragResizeEnd(
|
||||
taskPositioner.onDragPositioningEnd(
|
||||
STARTING_BOUNDS.left.toFloat() + 10,
|
||||
STARTING_BOUNDS.top.toFloat() + 10
|
||||
)
|
||||
@@ -150,7 +150,7 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
|
||||
@Test
|
||||
fun testDragResize_move_skipsDragResizingFlag() {
|
||||
taskPositioner.onDragResizeStart(
|
||||
taskPositioner.onDragPositioningStart(
|
||||
CTRL_TYPE_UNDEFINED, // Move
|
||||
STARTING_BOUNDS.left.toFloat(),
|
||||
STARTING_BOUNDS.top.toFloat()
|
||||
@@ -159,12 +159,12 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
// Move the task 10px to the right.
|
||||
val newX = STARTING_BOUNDS.left.toFloat() + 10
|
||||
val newY = STARTING_BOUNDS.top.toFloat()
|
||||
taskPositioner.onDragResizeMove(
|
||||
taskPositioner.onDragPositioningMove(
|
||||
newX,
|
||||
newY
|
||||
)
|
||||
|
||||
taskPositioner.onDragResizeEnd(newX, newY)
|
||||
taskPositioner.onDragPositioningEnd(newX, newY)
|
||||
|
||||
verify(mockShellTaskOrganizer, never()).applyTransaction(argThat { wct ->
|
||||
return@argThat wct.changes.any { (token, change) ->
|
||||
@@ -177,7 +177,7 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
|
||||
@Test
|
||||
fun testDragResize_resize_setsDragResizingFlag() {
|
||||
taskPositioner.onDragResizeStart(
|
||||
taskPositioner.onDragPositioningStart(
|
||||
CTRL_TYPE_RIGHT, // Resize right
|
||||
STARTING_BOUNDS.left.toFloat(),
|
||||
STARTING_BOUNDS.top.toFloat()
|
||||
@@ -186,12 +186,12 @@ class TaskPositionerTest : ShellTestCase() {
|
||||
// Resize the task by 10px to the right.
|
||||
val newX = STARTING_BOUNDS.right.toFloat() + 10
|
||||
val newY = STARTING_BOUNDS.top.toFloat()
|
||||
taskPositioner.onDragResizeMove(
|
||||
taskPositioner.onDragPositioningMove(
|
||||
newX,
|
||||
newY
|
||||
)
|
||||
|
||||
taskPositioner.onDragResizeEnd(newX, newY)
|
||||
taskPositioner.onDragPositioningEnd(newX, newY)
|
||||
|
||||
verify(mockShellTaskOrganizer).applyTransaction(argThat { wct ->
|
||||
return@argThat wct.changes.any { (token, change) ->
|
||||
|
||||
Reference in New Issue
Block a user