Loading libs/WindowManager/Shell/res/values/dimen.xml +12 −0 Original line number Diff line number Diff line Loading @@ -515,8 +515,20 @@ <!-- The size of the icon shown in the resize veil. --> <dimen name="desktop_mode_resize_veil_icon_size">96dp</dimen> <!-- The with of the border around the app task for edge resizing, when enable_windowing_edge_drag_resize is enabled. --> <dimen name="desktop_mode_edge_handle">12dp</dimen> <!-- The original width of the border around the app task for edge resizing, when enable_windowing_edge_drag_resize is disabled. --> <dimen name="freeform_resize_handle">15dp</dimen> <!-- The size of the corner region for drag resizing with touch, when a larger touch region is appropriate. Applied when enable_windowing_edge_drag_resize is enabled. --> <dimen name="desktop_mode_corner_resize_large">48dp</dimen> <!-- The original size of the corner region for darg resizing, when enable_windowing_edge_drag_resize is disabled. --> <dimen name="freeform_resize_corner">44dp</dimen> <!-- The width of the area at the sides of the screen where a freeform task will transition to Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +10 −7 Original line number Diff line number Diff line Loading @@ -16,17 +16,23 @@ package com.android.wm.shell.windowdecor; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getFineResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getLargeResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getResizeEdgeHandleSize; import android.annotation.NonNull; import android.app.ActivityManager.RunningTaskInfo; import android.app.WindowConfiguration; import android.app.WindowConfiguration.WindowingMode; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.VectorDrawable; import android.os.Handler; import android.util.Size; import android.view.Choreographer; import android.view.SurfaceControl; import android.view.View; Loading Loading @@ -222,7 +228,6 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL mHandler, mChoreographer, mDisplay.getDisplayId(), 0 /* taskCornerRadius */, mDecorationContainerSurface, mDragPositioningCallback, mSurfaceControlBuilderSupplier, Loading @@ -234,12 +239,10 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL .getScaledTouchSlop(); mDragDetector.setTouchSlop(touchSlop); final int resize_handle = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_handle); final int resize_corner = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_corner); mDragResizeListener.setGeometry( mResult.mWidth, mResult.mHeight, resize_handle, resize_corner, touchSlop); final Resources res = mResult.mRootView.getResources(); mDragResizeListener.setGeometry(new DragResizeWindowGeometry(0 /* taskCornerRadius */, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop); } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +9 −8 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_UP; import static com.android.launcher3.icons.BaseIconFactory.MODE_DEFAULT; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getFineResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getLargeResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getResizeEdgeHandleSize; import android.annotation.NonNull; import android.app.ActivityManager; Loading @@ -42,6 +45,7 @@ import android.graphics.Region; import android.graphics.drawable.Drawable; import android.os.Handler; import android.util.Log; import android.util.Size; import android.view.Choreographer; import android.view.MotionEvent; import android.view.SurfaceControl; Loading Loading @@ -276,7 +280,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mHandler, mChoreographer, mDisplay.getDisplayId(), mRelayoutParams.mCornerRadius, mDecorationContainerSurface, mDragPositioningCallback, mSurfaceControlBuilderSupplier, Loading @@ -288,15 +291,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin .getScaledTouchSlop(); mDragDetector.setTouchSlop(touchSlop); final int resize_handle = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_handle); final int resize_corner = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_corner); // If either task geometry or position have changed, update this task's // exclusion region listener final Resources res = mResult.mRootView.getResources(); if (mDragResizeListener.setGeometry( mResult.mWidth, mResult.mHeight, resize_handle, resize_corner, touchSlop) new DragResizeWindowGeometry(mRelayoutParams.mCornerRadius, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop) || !mTaskInfo.positionInParent.equals(mPositionInParent)) { updateExclusionRegion(); } Loading Loading @@ -427,7 +428,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin return mHandleMenu != null; } boolean shouldResizeListenerHandleEvent(MotionEvent e, Point offset) { boolean shouldResizeListenerHandleEvent(@NonNull MotionEvent e, @NonNull Point offset) { return mDragResizeListener != null && mDragResizeListener.shouldHandleEvent(e, offset); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragPositioningCallback.java +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,9 @@ import android.graphics.Rect; * Callback called when receiving drag-resize or drag-move related input events. */ public interface DragPositioningCallback { /** * Indicates the direction of resizing. May be combined together to indicate a diagonal drag. */ @IntDef(flag = true, value = { CTRL_TYPE_UNDEFINED, CTRL_TYPE_LEFT, CTRL_TYPE_RIGHT, CTRL_TYPE_TOP, CTRL_TYPE_BOTTOM }) Loading Loading
libs/WindowManager/Shell/res/values/dimen.xml +12 −0 Original line number Diff line number Diff line Loading @@ -515,8 +515,20 @@ <!-- The size of the icon shown in the resize veil. --> <dimen name="desktop_mode_resize_veil_icon_size">96dp</dimen> <!-- The with of the border around the app task for edge resizing, when enable_windowing_edge_drag_resize is enabled. --> <dimen name="desktop_mode_edge_handle">12dp</dimen> <!-- The original width of the border around the app task for edge resizing, when enable_windowing_edge_drag_resize is disabled. --> <dimen name="freeform_resize_handle">15dp</dimen> <!-- The size of the corner region for drag resizing with touch, when a larger touch region is appropriate. Applied when enable_windowing_edge_drag_resize is enabled. --> <dimen name="desktop_mode_corner_resize_large">48dp</dimen> <!-- The original size of the corner region for darg resizing, when enable_windowing_edge_drag_resize is disabled. --> <dimen name="freeform_resize_corner">44dp</dimen> <!-- The width of the area at the sides of the screen where a freeform task will transition to Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java +10 −7 Original line number Diff line number Diff line Loading @@ -16,17 +16,23 @@ package com.android.wm.shell.windowdecor; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getFineResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getLargeResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getResizeEdgeHandleSize; import android.annotation.NonNull; import android.app.ActivityManager.RunningTaskInfo; import android.app.WindowConfiguration; import android.app.WindowConfiguration.WindowingMode; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.VectorDrawable; import android.os.Handler; import android.util.Size; import android.view.Choreographer; import android.view.SurfaceControl; import android.view.View; Loading Loading @@ -222,7 +228,6 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL mHandler, mChoreographer, mDisplay.getDisplayId(), 0 /* taskCornerRadius */, mDecorationContainerSurface, mDragPositioningCallback, mSurfaceControlBuilderSupplier, Loading @@ -234,12 +239,10 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL .getScaledTouchSlop(); mDragDetector.setTouchSlop(touchSlop); final int resize_handle = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_handle); final int resize_corner = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_corner); mDragResizeListener.setGeometry( mResult.mWidth, mResult.mHeight, resize_handle, resize_corner, touchSlop); final Resources res = mResult.mRootView.getResources(); mDragResizeListener.setGeometry(new DragResizeWindowGeometry(0 /* taskCornerRadius */, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop); } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +9 −8 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_UP; import static com.android.launcher3.icons.BaseIconFactory.MODE_DEFAULT; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getFineResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getLargeResizeCornerSize; import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getResizeEdgeHandleSize; import android.annotation.NonNull; import android.app.ActivityManager; Loading @@ -42,6 +45,7 @@ import android.graphics.Region; import android.graphics.drawable.Drawable; import android.os.Handler; import android.util.Log; import android.util.Size; import android.view.Choreographer; import android.view.MotionEvent; import android.view.SurfaceControl; Loading Loading @@ -276,7 +280,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mHandler, mChoreographer, mDisplay.getDisplayId(), mRelayoutParams.mCornerRadius, mDecorationContainerSurface, mDragPositioningCallback, mSurfaceControlBuilderSupplier, Loading @@ -288,15 +291,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin .getScaledTouchSlop(); mDragDetector.setTouchSlop(touchSlop); final int resize_handle = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_handle); final int resize_corner = mResult.mRootView.getResources() .getDimensionPixelSize(R.dimen.freeform_resize_corner); // If either task geometry or position have changed, update this task's // exclusion region listener final Resources res = mResult.mRootView.getResources(); if (mDragResizeListener.setGeometry( mResult.mWidth, mResult.mHeight, resize_handle, resize_corner, touchSlop) new DragResizeWindowGeometry(mRelayoutParams.mCornerRadius, new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res), getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop) || !mTaskInfo.positionInParent.equals(mPositionInParent)) { updateExclusionRegion(); } Loading Loading @@ -427,7 +428,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin return mHandleMenu != null; } boolean shouldResizeListenerHandleEvent(MotionEvent e, Point offset) { boolean shouldResizeListenerHandleEvent(@NonNull MotionEvent e, @NonNull Point offset) { return mDragResizeListener != null && mDragResizeListener.shouldHandleEvent(e, offset); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragPositioningCallback.java +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,9 @@ import android.graphics.Rect; * Callback called when receiving drag-resize or drag-move related input events. */ public interface DragPositioningCallback { /** * Indicates the direction of resizing. May be combined together to indicate a diagonal drag. */ @IntDef(flag = true, value = { CTRL_TYPE_UNDEFINED, CTRL_TYPE_LEFT, CTRL_TYPE_RIGHT, CTRL_TYPE_TOP, CTRL_TYPE_BOTTOM }) Loading