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

Commit c4f6fac5 authored by Maryam Dehaini's avatar Maryam Dehaini
Browse files

Show maximize menu when user long clicks maximize button on caption

When a user long clicks on the maximize button in the caption, a menu
appears below with three options:
1. Maximize the window normally (same functionality as the maximize
   button)
2. Place the task on the left side of the screen with an area equal to
  the left half of the display area
3. Place the task on the right side of the screen with an area equal to
   the right half of the display area

Test: Manual testing
Bug: 292093104

Change-Id: I561660f34208a6c36913461a2cc32ab97a03f815
parent 6162ea96
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -80,6 +80,12 @@ public class TaskConstants {
     */
    public static final int TASK_CHILD_LAYER_RESIZE_VEIL = 6 * TASK_CHILD_LAYER_REGION_SIZE;

    /**
     * Floating menus belonging to a task (e.g. maximize menu).
     * @hide
     */
    public  static final int TASK_CHILD_LAYER_FLOATING_MENU = 7 * TASK_CHILD_LAYER_REGION_SIZE;

    /**
     * Z-orders of task child layers other than activities, task fragments and layers interleaved
     * with them, e.g. IME windows. [-10000, 10000) is reserved for these layers.
+28 −0
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
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
        android:color="@color/desktop_mode_maximize_menu_button_on_hover"/>
    <item android:state_hovered="true"
        android:color="@color/desktop_mode_maximize_menu_button_on_hover"/>
    <item android:state_focused="true"
        android:color="@color/desktop_mode_maximize_menu_button_on_hover"/>
    <item android:state_selected="true"
        android:color="@color/desktop_mode_maximize_menu_button_on_hover"/>
    <item android:color="@color/desktop_mode_maximize_menu_button"/>
</selector>
 No newline at end of file
+28 −0
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
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
        android:color="@color/desktop_mode_maximize_menu_button_outline_on_hover"/>
    <item android:state_hovered="true"
        android:color="@color/desktop_mode_maximize_menu_button_outline_on_hover"/>
    <item android:state_focused="true"
        android:color="@color/desktop_mode_maximize_menu_button_outline_on_hover"/>
    <item android:state_selected="true"
        android:color="@color/desktop_mode_maximize_menu_button_outline_on_hover"/>
    <item android:color="@color/desktop_mode_maximize_menu_button_outline"/>
</selector>
 No newline at end of file
+21 −0
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.
  -->
<shape android:shape="rectangle"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@android:color/white" />
    <corners android:radius="@dimen/desktop_mode_maximize_menu_corner_radius" />
</shape>
Loading