Loading libs/WindowManager/Shell/res/drawable/desktop_mode_decor_menu_background.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,6 @@ <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@android:color/white" /> <corners android:radius="20dp" /> <corners android:radius="@dimen/caption_menu_corner_radius" /> <stroke android:width="1dp" android:color="#b3b3b3"/> </shape> libs/WindowManager/Shell/res/layout/desktop_mode_decor_handle_menu.xml +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/desktop_mode_decor_menu_background" android:elevation="@dimen/caption_menu_elevation" android:divider="?android:attr/dividerHorizontal" android:showDividers="middle" android:dividerPadding="18dip"> Loading libs/WindowManager/Shell/res/values/dimen.xml +5 −1 Original line number Diff line number Diff line Loading @@ -370,6 +370,10 @@ <dimen name="freeform_resize_corner">44dp</dimen> <dimen name="caption_menu_elevation">4dp</dimen> <!-- The radius of the caption menu shadow. --> <dimen name="caption_menu_shadow_radius">4dp</dimen> <!-- The radius of the caption menu corners. --> <dimen name="caption_menu_corner_radius">20dp</dimen> </resources> libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +7 −8 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private boolean mDesktopActive; private AdditionalWindow mHandleMenu; private final int mHandleMenuWidthId = R.dimen.freeform_decor_caption_menu_width; private final int mHandleMenuShadowRadiusId = R.dimen.caption_menu_shadow_radius; private final int mHandleMenuCornerRadiusId = R.dimen.caption_menu_corner_radius; private PointF mHandleMenuPosition = new PointF(); DesktopModeWindowDecoration( Loading Loading @@ -353,19 +355,16 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin .windowConfiguration.getBounds().width(); final int menuWidth = loadDimensionPixelSize(resources, mHandleMenuWidthId); final int menuHeight = loadDimensionPixelSize(resources, mCaptionMenuHeightId); // Elevation gives the appearance of a changed x/y coordinate; this is to fix that int elevationOffset = 2 * loadDimensionPixelSize(resources, R.dimen.caption_menu_elevation); final int shadowRadius = loadDimensionPixelSize(resources, mHandleMenuShadowRadiusId); final int cornerRadius = loadDimensionPixelSize(resources, mHandleMenuCornerRadiusId); final int x = mRelayoutParams.mCaptionX + (captionWidth / 2) - (menuWidth / 2) - mResult.mDecorContainerOffsetX - elevationOffset; final int y = mRelayoutParams.mCaptionY - mResult.mDecorContainerOffsetY - elevationOffset; - mResult.mDecorContainerOffsetX; final int y = mRelayoutParams.mCaptionY - mResult.mDecorContainerOffsetY; mHandleMenuPosition.set(x, y); String namePrefix = "Caption Menu"; mHandleMenu = addWindow(R.layout.desktop_mode_decor_handle_menu, namePrefix, t, x, y, menuWidth, menuHeight, 2 * elevationOffset); menuWidth, menuHeight, shadowRadius, cornerRadius); mSyncQueue.runInSync(transaction -> { transaction.merge(t); t.close(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +8 −6 Original line number Diff line number Diff line Loading @@ -391,11 +391,12 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> * @param yPos y position of new window * @param width width of new window * @param height height of new window * @param cropPadding padding to add to window crop to ensure shadows display properly * @return * @param shadowRadius radius of the shadow of the new window * @param cornerRadius radius of the corners of the new window * @return the {@link AdditionalWindow} that was added. */ AdditionalWindow addWindow(int layoutId, String namePrefix, SurfaceControl.Transaction t, int xPos, int yPos, int width, int height, int cropPadding) { int xPos, int yPos, int width, int height, int shadowRadius, int cornerRadius) { final SurfaceControl.Builder builder = mSurfaceControlBuilderSupplier.get(); SurfaceControl windowSurfaceControl = builder .setName(namePrefix + " of Task=" + mTaskInfo.taskId) Loading @@ -404,9 +405,10 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> .build(); View v = LayoutInflater.from(mDecorWindowContext).inflate(layoutId, null); t.setPosition( windowSurfaceControl, xPos, yPos) .setWindowCrop(windowSurfaceControl, width + cropPadding, height + cropPadding) t.setPosition(windowSurfaceControl, xPos, yPos) .setWindowCrop(windowSurfaceControl, width, height) .setShadowRadius(windowSurfaceControl, shadowRadius) .setCornerRadius(windowSurfaceControl, cornerRadius) .show(windowSurfaceControl); final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height, Loading Loading
libs/WindowManager/Shell/res/drawable/desktop_mode_decor_menu_background.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,6 @@ <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@android:color/white" /> <corners android:radius="20dp" /> <corners android:radius="@dimen/caption_menu_corner_radius" /> <stroke android:width="1dp" android:color="#b3b3b3"/> </shape>
libs/WindowManager/Shell/res/layout/desktop_mode_decor_handle_menu.xml +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/desktop_mode_decor_menu_background" android:elevation="@dimen/caption_menu_elevation" android:divider="?android:attr/dividerHorizontal" android:showDividers="middle" android:dividerPadding="18dip"> Loading
libs/WindowManager/Shell/res/values/dimen.xml +5 −1 Original line number Diff line number Diff line Loading @@ -370,6 +370,10 @@ <dimen name="freeform_resize_corner">44dp</dimen> <dimen name="caption_menu_elevation">4dp</dimen> <!-- The radius of the caption menu shadow. --> <dimen name="caption_menu_shadow_radius">4dp</dimen> <!-- The radius of the caption menu corners. --> <dimen name="caption_menu_corner_radius">20dp</dimen> </resources>
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +7 −8 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private boolean mDesktopActive; private AdditionalWindow mHandleMenu; private final int mHandleMenuWidthId = R.dimen.freeform_decor_caption_menu_width; private final int mHandleMenuShadowRadiusId = R.dimen.caption_menu_shadow_radius; private final int mHandleMenuCornerRadiusId = R.dimen.caption_menu_corner_radius; private PointF mHandleMenuPosition = new PointF(); DesktopModeWindowDecoration( Loading Loading @@ -353,19 +355,16 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin .windowConfiguration.getBounds().width(); final int menuWidth = loadDimensionPixelSize(resources, mHandleMenuWidthId); final int menuHeight = loadDimensionPixelSize(resources, mCaptionMenuHeightId); // Elevation gives the appearance of a changed x/y coordinate; this is to fix that int elevationOffset = 2 * loadDimensionPixelSize(resources, R.dimen.caption_menu_elevation); final int shadowRadius = loadDimensionPixelSize(resources, mHandleMenuShadowRadiusId); final int cornerRadius = loadDimensionPixelSize(resources, mHandleMenuCornerRadiusId); final int x = mRelayoutParams.mCaptionX + (captionWidth / 2) - (menuWidth / 2) - mResult.mDecorContainerOffsetX - elevationOffset; final int y = mRelayoutParams.mCaptionY - mResult.mDecorContainerOffsetY - elevationOffset; - mResult.mDecorContainerOffsetX; final int y = mRelayoutParams.mCaptionY - mResult.mDecorContainerOffsetY; mHandleMenuPosition.set(x, y); String namePrefix = "Caption Menu"; mHandleMenu = addWindow(R.layout.desktop_mode_decor_handle_menu, namePrefix, t, x, y, menuWidth, menuHeight, 2 * elevationOffset); menuWidth, menuHeight, shadowRadius, cornerRadius); mSyncQueue.runInSync(transaction -> { transaction.merge(t); t.close(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java +8 −6 Original line number Diff line number Diff line Loading @@ -391,11 +391,12 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> * @param yPos y position of new window * @param width width of new window * @param height height of new window * @param cropPadding padding to add to window crop to ensure shadows display properly * @return * @param shadowRadius radius of the shadow of the new window * @param cornerRadius radius of the corners of the new window * @return the {@link AdditionalWindow} that was added. */ AdditionalWindow addWindow(int layoutId, String namePrefix, SurfaceControl.Transaction t, int xPos, int yPos, int width, int height, int cropPadding) { int xPos, int yPos, int width, int height, int shadowRadius, int cornerRadius) { final SurfaceControl.Builder builder = mSurfaceControlBuilderSupplier.get(); SurfaceControl windowSurfaceControl = builder .setName(namePrefix + " of Task=" + mTaskInfo.taskId) Loading @@ -404,9 +405,10 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer> .build(); View v = LayoutInflater.from(mDecorWindowContext).inflate(layoutId, null); t.setPosition( windowSurfaceControl, xPos, yPos) .setWindowCrop(windowSurfaceControl, width + cropPadding, height + cropPadding) t.setPosition(windowSurfaceControl, xPos, yPos) .setWindowCrop(windowSurfaceControl, width, height) .setShadowRadius(windowSurfaceControl, shadowRadius) .setCornerRadius(windowSurfaceControl, cornerRadius) .show(windowSurfaceControl); final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height, Loading