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

Commit 352e6fd6 authored by Maryam Dehaini's avatar Maryam Dehaini Committed by Android (Google) Code Review
Browse files

Merge "Remove select button from handle menu" into main

parents 3b04432b b03ee808
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2023 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20">
  <path
      android:pathData="M15.701,14.583L18.567,17.5L17.425,18.733L14.525,15.833L12.442,17.917V12.5H17.917L15.701,14.583ZM15.833,5.833H17.5V7.5H15.833V5.833ZM17.5,4.167H15.833V2.567C16.75,2.567 17.5,3.333 17.5,4.167ZM12.5,2.5H14.167V4.167H12.5V2.5ZM15.833,9.167H17.5V10.833H15.833V9.167ZM7.5,17.5H5.833V15.833H7.5V17.5ZM4.167,7.5H2.5V5.833H4.167V7.5ZM4.167,2.567V4.167H2.5C2.5,3.333 3.333,2.567 4.167,2.567ZM4.167,14.167H2.5V12.5H4.167V14.167ZM7.5,4.167H5.833V2.5H7.5V4.167ZM10.833,4.167H9.167V2.5H10.833V4.167ZM10.833,17.5H9.167V15.833H10.833V17.5ZM4.167,10.833H2.5V9.167H4.167V10.833ZM4.167,17.567C3.25,17.567 2.5,16.667 2.5,15.833H4.167V17.567Z"
      android:fillColor="#1C1C14"/>
</vector>
+0 −9
Original line number Diff line number Diff line
@@ -134,15 +134,6 @@
            android:drawableStart="@drawable/desktop_mode_ic_handle_menu_screenshot"
            android:drawableTint="?androidprv:attr/materialColorOnSurface"
            style="@style/DesktopModeHandleMenuActionButton"/>

        <Button
            android:id="@+id/select_button"
            android:contentDescription="@string/select_text"
            android:text="@string/select_text"
            android:drawableStart="@drawable/desktop_mode_ic_handle_menu_select"
            android:drawableTint="?androidprv:attr/materialColorOnSurface"
            style="@style/DesktopModeHandleMenuActionButton"/>

    </LinearLayout>
</LinearLayout>
+0 −6
Original line number Diff line number Diff line
@@ -442,12 +442,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                mDesktopTasksController.requestSplit(decoration.mTaskInfo);
            } else if (id == R.id.collapse_menu_button) {
                decoration.closeHandleMenu();
            } else if (id == R.id.select_button) {
                if (DesktopModeStatus.IS_DISPLAY_CHANGE_ENABLED) {
                    // TODO(b/278084491): dev option to enable display switching
                    //  remove when select is implemented
                    mDesktopTasksController.moveToNextDisplay(mTaskId);
                }
            } else if (id == R.id.maximize_window) {
                final RunningTaskInfo taskInfo = decoration.mTaskInfo;
                decoration.closeHandleMenu();
+9 −8
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.graphics.PointF;
import android.view.MotionEvent;
import android.view.SurfaceControl;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
@@ -53,6 +52,7 @@ import com.android.wm.shell.R;
 */
class HandleMenu {
    private static final String TAG = "HandleMenu";
    private static final boolean SHOULD_SHOW_MORE_ACTIONS_PILL = false;
    private final Context mContext;
    private final WindowDecoration mParentDecor;
    private WindowDecoration.AdditionalWindow mHandleMenuWindow;
@@ -185,11 +185,9 @@ class HandleMenu {
     * Set up interactive elements & height of handle menu's more actions pill
     */
    private void setupMoreActionsPill(View handleMenu) {
        final Button selectBtn = handleMenu.findViewById(R.id.select_button);
        selectBtn.setOnClickListener(mOnClickListener);
        final Button screenshotBtn = handleMenu.findViewById(R.id.screenshot_button);
        // TODO: Remove once implemented.
        screenshotBtn.setVisibility(View.GONE);
        if (!SHOULD_SHOW_MORE_ACTIONS_PILL) {
            handleMenu.findViewById(R.id.more_actions_pill).setVisibility(View.GONE);
        }
    }

    /**
@@ -305,12 +303,15 @@ class HandleMenu {
     * Determines handle menu height based on if windowing pill should be shown.
     */
    private int getHandleMenuHeight(Resources resources) {
        int menuHeight = loadDimensionPixelSize(resources,
                R.dimen.desktop_mode_handle_menu_height);
        int menuHeight = loadDimensionPixelSize(resources, R.dimen.desktop_mode_handle_menu_height);
        if (!mShouldShowWindowingPill) {
            menuHeight -= loadDimensionPixelSize(resources,
                    R.dimen.desktop_mode_handle_menu_windowing_pill_height);
        }
        if (!SHOULD_SHOW_MORE_ACTIONS_PILL) {
            menuHeight -= loadDimensionPixelSize(resources,
                    R.dimen.desktop_mode_handle_menu_more_actions_pill_height);
        }
        return menuHeight;
    }