Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -730,7 +730,7 @@ class DesktopTasksController( * * @param taskInfo the task being dragged. * @param position position of surface when drag ends. * @param y the Y position of the motion event. * @param y the Y position of the top edge of the task * @param windowDecor the window decoration for the task being dragged */ fun onDragPositioningEnd( Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +5 −5 Original line number Diff line number Diff line Loading @@ -429,10 +429,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { mDragPointerId = e.getPointerId(0); } final int dragPointerIdx = e.findPointerIndex(mDragPointerId); mDesktopTasksController.ifPresent(c -> c.onDragPositioningMove(taskInfo, decoration.mTaskSurface, e.getRawY(dragPointerIdx))); mDragPositioningCallback.onDragPositioningMove( final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningMove( e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); mDesktopTasksController.ifPresent(c -> c.onDragPositioningMove(taskInfo, decoration.mTaskSurface, newTaskBounds.top)); mIsDragging = true; mShouldClick = false; return true; Loading @@ -458,10 +458,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { final Point position = new Point( (int) (e.getRawX(dragPointerIdx) - e.getX(dragPointerIdx)), (int) (e.getRawY(dragPointerIdx) - e.getY(dragPointerIdx))); mDragPositioningCallback.onDragPositioningEnd( final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningEnd( e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); mDesktopTasksController.ifPresent(c -> c.onDragPositioningEnd(taskInfo, position, e.getRawY(), mWindowDecorByTaskId.get(mTaskId))); position, newTaskBounds.top, mWindowDecorByTaskId.get(mTaskId))); mIsDragging = false; return true; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragPositioningCallback.java +5 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.windowdecor; import android.annotation.IntDef; import android.graphics.Rect; /** * Callback called when receiving drag-resize or drag-move related input events. Loading Loading @@ -46,13 +47,15 @@ public interface DragPositioningCallback { * 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 * @return the updated task bounds */ void onDragPositioningMove(float x, float y); Rect onDragPositioningMove(float x, float y); /** * 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 * @return the final bounds for the dragged task */ void onDragPositioningEnd(float x, float y); Rect onDragPositioningEnd(float x, float y); } libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositioner.java +4 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class FluidResizeTaskPositioner implements DragPositioningCallback { } @Override public void onDragPositioningMove(float x, float y) { public Rect onDragPositioningMove(float x, float y) { final WindowContainerTransaction wct = new WindowContainerTransaction(); PointF delta = DragPositioningCallbackUtility.calculateDelta(x, y, mRepositionStartPoint); if (isResizing() && DragPositioningCallbackUtility.changeBounds(mCtrlType, Loading @@ -106,10 +106,11 @@ class FluidResizeTaskPositioner implements DragPositioningCallback { mRepositionTaskBounds, mTaskBoundsAtDragStart, mRepositionStartPoint, t, x, y); t.apply(); } return new Rect(mRepositionTaskBounds); } @Override public void onDragPositioningEnd(float x, float y) { public Rect onDragPositioningEnd(float x, float y) { // If task has been resized or task was dragged into area outside of // mDisallowedAreaForEndBounds, apply WCT to finish it. if (isResizing() && mHasDragResized) { Loading @@ -136,6 +137,7 @@ class FluidResizeTaskPositioner implements DragPositioningCallback { mRepositionStartPoint.set(0, 0); mCtrlType = CTRL_TYPE_UNDEFINED; mHasDragResized = false; return new Rect(mRepositionTaskBounds); } private boolean isResizing() { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java +4 −2 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, } @Override public void onDragPositioningMove(float x, float y) { public Rect onDragPositioningMove(float x, float y) { PointF delta = DragPositioningCallbackUtility.calculateDelta(x, y, mRepositionStartPoint); if (isResizing() && DragPositioningCallbackUtility.changeBounds(mCtrlType, mRepositionTaskBounds, mTaskBoundsAtDragStart, mStableBounds, delta, Loading @@ -117,10 +117,11 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, mRepositionTaskBounds, mTaskBoundsAtDragStart, mRepositionStartPoint, t, x, y); t.apply(); } return new Rect(mRepositionTaskBounds); } @Override public void onDragPositioningEnd(float x, float y) { public Rect onDragPositioningEnd(float x, float y) { PointF delta = DragPositioningCallbackUtility.calculateDelta(x, y, mRepositionStartPoint); if (isResizing()) { Loading Loading @@ -151,6 +152,7 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, mCtrlType = CTRL_TYPE_UNDEFINED; mTaskBoundsAtDragStart.setEmpty(); mRepositionStartPoint.set(0, 0); return new Rect(mRepositionTaskBounds); } private boolean isResizing() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -730,7 +730,7 @@ class DesktopTasksController( * * @param taskInfo the task being dragged. * @param position position of surface when drag ends. * @param y the Y position of the motion event. * @param y the Y position of the top edge of the task * @param windowDecor the window decoration for the task being dragged */ fun onDragPositioningEnd( Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +5 −5 Original line number Diff line number Diff line Loading @@ -429,10 +429,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { mDragPointerId = e.getPointerId(0); } final int dragPointerIdx = e.findPointerIndex(mDragPointerId); mDesktopTasksController.ifPresent(c -> c.onDragPositioningMove(taskInfo, decoration.mTaskSurface, e.getRawY(dragPointerIdx))); mDragPositioningCallback.onDragPositioningMove( final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningMove( e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); mDesktopTasksController.ifPresent(c -> c.onDragPositioningMove(taskInfo, decoration.mTaskSurface, newTaskBounds.top)); mIsDragging = true; mShouldClick = false; return true; Loading @@ -458,10 +458,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { final Point position = new Point( (int) (e.getRawX(dragPointerIdx) - e.getX(dragPointerIdx)), (int) (e.getRawY(dragPointerIdx) - e.getY(dragPointerIdx))); mDragPositioningCallback.onDragPositioningEnd( final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningEnd( e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); mDesktopTasksController.ifPresent(c -> c.onDragPositioningEnd(taskInfo, position, e.getRawY(), mWindowDecorByTaskId.get(mTaskId))); position, newTaskBounds.top, mWindowDecorByTaskId.get(mTaskId))); mIsDragging = false; return true; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragPositioningCallback.java +5 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.windowdecor; import android.annotation.IntDef; import android.graphics.Rect; /** * Callback called when receiving drag-resize or drag-move related input events. Loading Loading @@ -46,13 +47,15 @@ public interface DragPositioningCallback { * 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 * @return the updated task bounds */ void onDragPositioningMove(float x, float y); Rect onDragPositioningMove(float x, float y); /** * 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 * @return the final bounds for the dragged task */ void onDragPositioningEnd(float x, float y); Rect onDragPositioningEnd(float x, float y); }
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/FluidResizeTaskPositioner.java +4 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class FluidResizeTaskPositioner implements DragPositioningCallback { } @Override public void onDragPositioningMove(float x, float y) { public Rect onDragPositioningMove(float x, float y) { final WindowContainerTransaction wct = new WindowContainerTransaction(); PointF delta = DragPositioningCallbackUtility.calculateDelta(x, y, mRepositionStartPoint); if (isResizing() && DragPositioningCallbackUtility.changeBounds(mCtrlType, Loading @@ -106,10 +106,11 @@ class FluidResizeTaskPositioner implements DragPositioningCallback { mRepositionTaskBounds, mTaskBoundsAtDragStart, mRepositionStartPoint, t, x, y); t.apply(); } return new Rect(mRepositionTaskBounds); } @Override public void onDragPositioningEnd(float x, float y) { public Rect onDragPositioningEnd(float x, float y) { // If task has been resized or task was dragged into area outside of // mDisallowedAreaForEndBounds, apply WCT to finish it. if (isResizing() && mHasDragResized) { Loading @@ -136,6 +137,7 @@ class FluidResizeTaskPositioner implements DragPositioningCallback { mRepositionStartPoint.set(0, 0); mCtrlType = CTRL_TYPE_UNDEFINED; mHasDragResized = false; return new Rect(mRepositionTaskBounds); } private boolean isResizing() { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java +4 −2 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, } @Override public void onDragPositioningMove(float x, float y) { public Rect onDragPositioningMove(float x, float y) { PointF delta = DragPositioningCallbackUtility.calculateDelta(x, y, mRepositionStartPoint); if (isResizing() && DragPositioningCallbackUtility.changeBounds(mCtrlType, mRepositionTaskBounds, mTaskBoundsAtDragStart, mStableBounds, delta, Loading @@ -117,10 +117,11 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, mRepositionTaskBounds, mTaskBoundsAtDragStart, mRepositionStartPoint, t, x, y); t.apply(); } return new Rect(mRepositionTaskBounds); } @Override public void onDragPositioningEnd(float x, float y) { public Rect onDragPositioningEnd(float x, float y) { PointF delta = DragPositioningCallbackUtility.calculateDelta(x, y, mRepositionStartPoint); if (isResizing()) { Loading Loading @@ -151,6 +152,7 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, mCtrlType = CTRL_TYPE_UNDEFINED; mTaskBoundsAtDragStart.setEmpty(); mRepositionStartPoint.set(0, 0); return new Rect(mRepositionTaskBounds); } private boolean isResizing() { Loading