Merge "Hide windowing controls in proto1 caption menu" into udc-dev
This commit is contained in:
@@ -365,6 +365,7 @@
|
|||||||
<dimen name="freeform_decor_caption_menu_width">256dp</dimen>
|
<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">250dp</dimen>
|
||||||
|
<dimen name="freeform_decor_caption_menu_height_no_windowing_controls">210dp</dimen>
|
||||||
|
|
||||||
<dimen name="freeform_resize_handle">30dp</dimen>
|
<dimen name="freeform_resize_handle">30dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import android.view.MotionEvent;
|
|||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.window.WindowContainerTransaction;
|
import android.window.WindowContainerTransaction;
|
||||||
@@ -69,6 +70,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
|
|||||||
|
|
||||||
private RelayoutParams mRelayoutParams = new RelayoutParams();
|
private RelayoutParams mRelayoutParams = new RelayoutParams();
|
||||||
private final int mCaptionMenuHeightId = R.dimen.freeform_decor_caption_menu_height;
|
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 =
|
private final WindowDecoration.RelayoutResult<WindowDecorLinearLayout> mResult =
|
||||||
new WindowDecoration.RelayoutResult<>();
|
new WindowDecoration.RelayoutResult<>();
|
||||||
|
|
||||||
@@ -227,11 +230,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
|
|||||||
final View fullscreen = menu.findViewById(R.id.fullscreen_button);
|
final View fullscreen = menu.findViewById(R.id.fullscreen_button);
|
||||||
fullscreen.setOnClickListener(mOnCaptionButtonClickListener);
|
fullscreen.setOnClickListener(mOnCaptionButtonClickListener);
|
||||||
final View desktop = menu.findViewById(R.id.desktop_button);
|
final View desktop = menu.findViewById(R.id.desktop_button);
|
||||||
if (DesktopModeStatus.isProto2Enabled()) {
|
desktop.setOnClickListener(mOnCaptionButtonClickListener);
|
||||||
desktop.setOnClickListener(mOnCaptionButtonClickListener);
|
final ViewGroup windowingBtns = menu.findViewById(R.id.windowing_mode_buttons);
|
||||||
} else if (DesktopModeStatus.isProto1Enabled()) {
|
windowingBtns.setVisibility(DesktopModeStatus.isProto1Enabled() ? View.GONE : View.VISIBLE);
|
||||||
desktop.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
final View split = menu.findViewById(R.id.split_screen_button);
|
final View split = menu.findViewById(R.id.split_screen_button);
|
||||||
split.setOnClickListener(mOnCaptionButtonClickListener);
|
split.setOnClickListener(mOnCaptionButtonClickListener);
|
||||||
final View close = menu.findViewById(R.id.close_button);
|
final View close = menu.findViewById(R.id.close_button);
|
||||||
@@ -280,7 +281,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
|
|||||||
final int captionWidth = mTaskInfo.getConfiguration()
|
final int captionWidth = mTaskInfo.getConfiguration()
|
||||||
.windowConfiguration.getBounds().width();
|
.windowConfiguration.getBounds().width();
|
||||||
final int menuWidth = loadDimensionPixelSize(resources, mHandleMenuWidthId);
|
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 shadowRadius = loadDimensionPixelSize(resources, mHandleMenuShadowRadiusId);
|
||||||
final int cornerRadius = loadDimensionPixelSize(resources, mHandleMenuCornerRadiusId);
|
final int cornerRadius = loadDimensionPixelSize(resources, mHandleMenuCornerRadiusId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user