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

Commit 21aa4fbc authored by Ben Lin's avatar Ben Lin
Browse files

Add DrawingHandle: an app handle that draws itself instead of drawable.

In order to fulfill the handle -> menu open/close spec, the handle must
be animated in such a way that it looks like it is growing into the
windowing pill. In order to do so we have to directly draw the app
handle and "grow" its height and width at a non-scaled rate, and even
increasing its corner radius.

This introduces a new type of app handle behind a flag, borrowing much
of the animation implementation from Bubbles.

Bug: 314288540
Test: Manual. Open/Close handle menu.
Flag: com.android.window.flags.enable_drawing_app_handle
Change-Id: Ia67707f82e4900aa22cde0200b363b428ced36f7
parent 5582f3c0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -176,6 +176,8 @@ public enum DesktopExperienceFlags {
    ENABLE_DRAG_END_STABLE_BOUNDS_RESET(Flags::enableDragEndStableBoundsReset, false,
            Flags.FLAG_ENABLE_DRAG_END_STABLE_BOUNDS_RESET),
    ENABLE_DRAG_TO_MAXIMIZE(Flags::enableDragToMaximize, true, Flags.FLAG_ENABLE_DRAG_TO_MAXIMIZE),
    ENABLE_DRAWING_APP_HANDLE(Flags::enableDrawingAppHandle, false,
            Flags.FLAG_ENABLE_DRAWING_APP_HANDLE),
    ENABLE_DREAM_ACTIVITY_WINDOWING_EXCLUSION(Flags::enableDreamActivityWindowingExclusion, false,
            Flags.FLAG_ENABLE_DREAM_ACTIVITY_WINDOWING_EXCLUSION),
    ENABLE_DYNAMIC_RADIUS_COMPUTATION_BUGFIX(Flags::enableDynamicRadiusComputationBugfix, true,
+10 −0
Original line number Diff line number Diff line
@@ -914,6 +914,16 @@ flag {
    bug: "383403514"
}

flag {
    name: "enable_drawing_app_handle"
    namespace: "lse_desktop_experience"
    description: "Enables app handle being drawn programmatically instead of using Drawables."
    bug: "314288540"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "enable_dream_activity_windowing_exclusion"
    namespace: "lse_desktop_experience"
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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.
  -->

<com.android.wm.shell.windowdecor.HandleImageButton
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="@dimen/desktop_mode_fullscreen_decor_caption_width"
    android:layout_height="@dimen/desktop_mode_fullscreen_decor_caption_height"
    android:paddingVertical="16dp"
    android:paddingHorizontal="10dp"
    android:screenReaderFocusable="true"
    android:importantForAccessibility="yes"
    android:contentDescription="@string/handle_text"
    android:src="@drawable/decor_handle_dark"
    tools:tint="@color/desktop_mode_caption_handle_bar_dark"
    android:scaleType="fitXY"
    android:background="@android:color/transparent"/>
 No newline at end of file
+15 −13
Original line number Diff line number Diff line
@@ -21,18 +21,20 @@
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center">
    <FrameLayout
        android:layout_width="@dimen/desktop_mode_fullscreen_decor_caption_width"
        android:layout_height="@dimen/desktop_mode_fullscreen_decor_caption_height">

        <ViewStub android:id="@+id/captionStub"
            android:inflatedId="@+id/caption_handle"
            android:layout="@layout/app_handle_image_button"
            android:layout_width="@dimen/desktop_mode_fullscreen_decor_caption_width"
            android:layout_height="@dimen/desktop_mode_fullscreen_decor_caption_height" />

    <com.android.wm.shell.windowdecor.HandleImageButton
        android:id="@+id/caption_handle"
        <ViewStub android:id="@+id/caption2Stub"
            android:inflatedId="@+id/caption_handle2"
            android:layout="@layout/drawing_app_handle"
            android:layout_width="@dimen/desktop_mode_fullscreen_decor_caption_width"
        android:layout_height="@dimen/desktop_mode_fullscreen_decor_caption_height"
        android:paddingVertical="16dp"
        android:paddingHorizontal="10dp"
        android:screenReaderFocusable="true"
        android:importantForAccessibility="yes"
        android:contentDescription="@string/handle_text"
        android:src="@drawable/decor_handle_dark"
        tools:tint="@color/desktop_mode_caption_handle_bar_dark"
        android:scaleType="fitXY"
        android:background="@android:color/transparent"/>
            android:layout_height="@dimen/desktop_mode_fullscreen_decor_caption_height" />
    </FrameLayout>
</com.android.wm.shell.windowdecor.WindowDecorLinearLayout>
 No newline at end of file
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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.
  -->

<com.android.wm.shell.windowdecor.common.DrawingHandle
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="@dimen/desktop_mode_fullscreen_decor_caption_width"
    android:layout_height="@dimen/desktop_mode_fullscreen_decor_caption_height"
    android:screenReaderFocusable="true"
    android:importantForAccessibility="yes"
    android:contentDescription="@string/handle_text"
    android:scaleType="fitXY"
    android:background="@android:color/transparent"/>
 No newline at end of file
Loading