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

Commit 8b3e7051 authored by Matt Sziklay's avatar Matt Sziklay Committed by Android (Google) Code Review
Browse files

Merge "Implement veiled resizing." into udc-dev

parents 4645c5fb 0c624e10
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -73,6 +73,13 @@ public class TaskConstants {
     */
    public static final int TASK_CHILD_LAYER_TASK_OVERLAY = 4 * TASK_CHILD_LAYER_REGION_SIZE;


    /**
     * Veil to cover task surface and other window decorations during resizes.
     * @hide
     */
    public static final int TASK_CHILD_LAYER_RESIZE_VEIL = 6 * 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.
@@ -84,7 +91,8 @@ public class TaskConstants {
            TASK_CHILD_LAYER_COMPAT_UI,
            TASK_CHILD_LAYER_WINDOW_DECORATIONS,
            TASK_CHILD_LAYER_RECENTS_ANIMATION_PIP_OVERLAY,
            TASK_CHILD_LAYER_TASK_OVERLAY
            TASK_CHILD_LAYER_TASK_OVERLAY,
            TASK_CHILD_LAYER_RESIZE_VEIL
    })
    public @interface TaskChildLayer {}
}
+20 −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" />
</shape>
+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.
  -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@drawable/desktop_mode_resize_veil_background">

    <ImageView
        android:id="@+id/veil_application_icon"
        android:layout_width="96dp"
        android:layout_height="96dp"
        android:layout_gravity="center"
        android:contentDescription="@string/app_icon_text" />
</FrameLayout>
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@ public class DesktopModeStatus {
    private static final boolean IS_PROTO2_ENABLED = SystemProperties.getBoolean(
            "persist.wm.debug.desktop_mode_2", false);

    /**
     * Flag to indicate whether task resizing is veiled.
     */
    private static final boolean IS_VEILED_RESIZE_ENABLED = SystemProperties.getBoolean(
            "persist.wm.debug.desktop_veiled_resizing", true);

    /**
     * Return {@code true} if desktop mode support is enabled
     */
@@ -64,6 +70,13 @@ public class DesktopModeStatus {
        return isProto1Enabled() || isProto2Enabled();
    }

    /**
     * Return {@code true} if veiled resizing is active. If false, fluid resizing is used.
     */
    public static boolean isVeiledResizeEnabled() {
        return IS_VEILED_RESIZE_ENABLED;
    }

    /**
     * Check if desktop mode is active
     *
+2 −2
Original line number Diff line number Diff line
@@ -185,8 +185,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
                        mSyncQueue);
        mWindowDecorByTaskId.put(taskInfo.taskId, windowDecoration);

        final TaskPositioner taskPositioner =
                new TaskPositioner(mTaskOrganizer, windowDecoration, mDisplayController);
        final FluidResizeTaskPositioner taskPositioner =
                new FluidResizeTaskPositioner(mTaskOrganizer, windowDecoration, mDisplayController);
        final CaptionTouchEventListener touchEventListener =
                new CaptionTouchEventListener(taskInfo, taskPositioner);
        windowDecoration.setCaptionListeners(touchEventListener, touchEventListener);
Loading