Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9adff251 authored by Jorge Gil's avatar Jorge Gil
Browse files

Hide windowing controls in proto1 caption menu

Proto1 is a system wide mode, so entering/exiting desktop mode should
be limited to the quick settings tile instead of adding windowing
controls to each individual task.

Also removes the logic to hide the desktop button in proto1 since
that will have no effect now that its parent is the one being hidden.

Bug: 272059013
Test: enter desktop mode in proto1 and proto2. Only in proto2 should
the windowing controls be visible.

Change-Id: Ica47a8ee14089c11e711c67abbcec46e2fb56fa0
parent 50ed6f3e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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>

+9 −6
Original line number Diff line number Diff line
@@ -38,6 +38,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;
@@ -70,6 +71,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<>();

@@ -242,11 +245,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);
        }
        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);
@@ -367,7 +368,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);