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

Commit bd839dbd authored by mattsziklay's avatar mattsziklay
Browse files

Add bar type window caption.

This is the first CL towards implementing the bar type caption which
will have a back button, a handle, and a close button. The caption will
also disappear when the attached task is not in focus.
Still to be implemented:
1: Windowing options appearing on handle click
2: Drag down in fullscreen to enter desktop mode
3: Caption display via hovering when cursor available

Bug: 239960071
Test: Manual: confirm new caption displays with the correct buttons/layout.
Confirm buttons work and focus change works with multiple tasks.
Test: Atest WindowDecorationTests

Change-Id: I2ebed76b803d1f337edc3e7340966909f63eaf40
parent c13fc2d2
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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="32.0dp"
        android:height="32.0dp"
        android:viewportWidth="32.0"
        android:viewportHeight="32.0"
        >
    <group android:scaleX="0.5"
           android:scaleY="0.5"
           android:translateX="8.0"
           android:translateY="8.0" >
        <path
            android:fillColor="@android:color/black"
            android:pathData="MM24,40.3 L7.7,24 24,7.7 26.8,10.45 15.3,22H40.3V26H15.3L26.8,37.5Z"/>

    </group>
</vector>
 No newline at end of file
+1 −3
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
  ~ limitations under the License.
  -->
<shape android:shape="rectangle"
       android:tintMode="multiply"
       android:tint="@color/decor_caption_title_color"
       xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="?android:attr/colorPrimary" />
    <solid android:color="@android:color/white" />
</shape>
+3 −5
Original line number Diff line number Diff line
@@ -18,15 +18,13 @@
        android:width="32.0dp"
        android:height="32.0dp"
        android:viewportWidth="32.0"
        android:viewportHeight="32.0"
        android:tint="@color/decor_button_dark_color"
        >
        android:viewportHeight="32.0">
    <group android:scaleX="0.5"
            android:scaleY="0.5"
            android:translateX="8.0"
            android:translateY="8.0" >
        <path
            android:fillColor="@android:color/white"
            android:pathData="M6.9,4.0l-2.9,2.9 9.1,9.1 -9.1,9.200001 2.9,2.799999 9.1,-9.1 9.1,9.1 2.9,-2.799999 -9.1,-9.200001 9.1,-9.1 -2.9,-2.9 -9.1,9.2z"/>
            android:fillColor="@android:color/black"
            android:pathData="M12.45,38.35 L9.65,35.55 21.2,24 9.65,12.45 12.45,9.65 24,21.2 35.55,9.65 38.35,12.45 26.8,24 38.35,35.55 35.55,38.35 24,26.8Z"/>
    </group>
</vector>
+23 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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="24dp"
        android:height="24dp"
        android:viewportWidth="24"
        android:viewportHeight="24">
    <path
        android:fillColor="@android:color/black" android:pathData="M3,5V3H21V5Z"/>
</vector>
+12 −18
Original line number Diff line number Diff line
@@ -17,39 +17,33 @@
<com.android.wm.shell.windowdecor.WindowDecorLinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/caption"
    android:layout_width="match_parent"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="end"
    android:gravity="center_horizontal"
    android:background="@drawable/decor_caption_title">
    <Button
        android:id="@+id/minimize_window"
        android:visibility="gone"
        android:id="@+id/back_button"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_margin="5dp"
        android:padding="4dp"
        android:layout_gravity="top|end"
        android:contentDescription="@string/maximize_button_text"
        android:background="@drawable/decor_minimize_button_dark"
        android:duplicateParentState="true"/>
        android:contentDescription="@string/back_button_text"
        android:background="@drawable/decor_back_button_dark"
    />
    <Button
        android:id="@+id/maximize_window"
        android:layout_width="32dp"
        android:id="@+id/caption_handle"
        android:layout_width="128dp"
        android:layout_height="32dp"
        android:layout_margin="5dp"
        android:padding="4dp"
        android:layout_gravity="center_vertical|end"
        android:contentDescription="@string/maximize_button_text"
        android:background="@drawable/decor_maximize_button_dark"
        android:duplicateParentState="true"/>
        android:contentDescription="@string/handle_text"
        android:background="@drawable/decor_handle_dark"/>
    <Button
        android:id="@+id/close_window"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_margin="5dp"
        android:padding="4dp"
        android:layout_gravity="center_vertical|end"
        android:contentDescription="@string/close_button_text"
        android:background="@drawable/decor_close_button_dark"
        android:duplicateParentState="true"/>
        android:background="@drawable/decor_close_button_dark"/>
</com.android.wm.shell.windowdecor.WindowDecorLinearLayout>
 No newline at end of file
Loading