summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jorge Gil <jorgegil@google.com> 2023-03-22 20:37:07 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-03-22 20:37:07 +0000
commit196e62a84e1b8d88a4743a1d1a562f29b0426a01 (patch)
treea7fa5c8aaf24d27520cc2b9871b4d7b887ee2319
parent2e49589c0c03535e0a323c9e8d849fe51bfb4fc5 (diff)
parent9adff2515decff62fa8cc2232d5ca8d025d0a091 (diff)
Merge "Hide windowing controls in proto1 caption menu" into udc-dev
-rw-r--r--libs/WindowManager/Shell/res/values/dimen.xml1
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java15
2 files changed, 10 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index 680ad5101366..88ca10d20521 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -365,6 +365,7 @@
<dimen name="freeform_decor_caption_menu_width">256dp</dimen>
<dimen name="freeform_decor_caption_menu_height">250dp</dimen>
+ <dimen name="freeform_decor_caption_menu_height_no_windowing_controls">210dp</dimen>
<dimen name="freeform_resize_handle">30dp</dimen>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
index a6a4d1d2cc72..6478fe723027 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
@@ -33,6 +33,7 @@ import android.view.MotionEvent;
import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewConfiguration;
+import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.window.WindowContainerTransaction;
@@ -69,6 +70,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
private RelayoutParams mRelayoutParams = new RelayoutParams();
private final int mCaptionMenuHeightId = R.dimen.freeform_decor_caption_menu_height;
+ private final int mCaptionMenuHeightWithoutWindowingControlsId =
+ R.dimen.freeform_decor_caption_menu_height_no_windowing_controls;
private final WindowDecoration.RelayoutResult<WindowDecorLinearLayout> mResult =
new WindowDecoration.RelayoutResult<>();
@@ -227,11 +230,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
final View fullscreen = menu.findViewById(R.id.fullscreen_button);
fullscreen.setOnClickListener(mOnCaptionButtonClickListener);
final View desktop = menu.findViewById(R.id.desktop_button);
- if (DesktopModeStatus.isProto2Enabled()) {
- desktop.setOnClickListener(mOnCaptionButtonClickListener);
- } else if (DesktopModeStatus.isProto1Enabled()) {
- desktop.setVisibility(View.GONE);
- }
+ desktop.setOnClickListener(mOnCaptionButtonClickListener);
+ final ViewGroup windowingBtns = menu.findViewById(R.id.windowing_mode_buttons);
+ windowingBtns.setVisibility(DesktopModeStatus.isProto1Enabled() ? View.GONE : View.VISIBLE);
final View split = menu.findViewById(R.id.split_screen_button);
split.setOnClickListener(mOnCaptionButtonClickListener);
final View close = menu.findViewById(R.id.close_button);
@@ -280,7 +281,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
final int captionWidth = mTaskInfo.getConfiguration()
.windowConfiguration.getBounds().width();
final int menuWidth = loadDimensionPixelSize(resources, mHandleMenuWidthId);
- final int menuHeight = loadDimensionPixelSize(resources, mCaptionMenuHeightId);
+ // The windowing controls are disabled in proto1.
+ final int menuHeight = loadDimensionPixelSize(resources, DesktopModeStatus.isProto1Enabled()
+ ? mCaptionMenuHeightWithoutWindowingControlsId : mCaptionMenuHeightId);
final int shadowRadius = loadDimensionPixelSize(resources, mHandleMenuShadowRadiusId);
final int cornerRadius = loadDimensionPixelSize(resources, mHandleMenuCornerRadiusId);