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

Commit 4d6c262c authored by Omar Elmekkawy's avatar Omar Elmekkawy Committed by Android (Google) Code Review
Browse files

Merge changes from topic "tile_resizing" into main

* changes:
  [9/n] Adding user change support for tiling
  [8/n] Fix failing unit tests after introducing tiling
  [7/n] Adding infrastructure to break tiling on certain events
  [6/n] Tile resizing handle core business logic for dragging and animation
  [5/n] Add desktop tiling project skeleton
  [4/n] Add an API to disable edge resizing for tiling.
  [3/n] Add onDragMove API to notify tiling of drag to break tiling
  [2/n] Add TilingDividerView and its WindowlessWindowManager
parents 2c1d501b 4fc05c89
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public enum DesktopModeFlags {
    ENABLE_CAPTION_COMPAT_INSET_FORCE_CONSUMPTION_ALWAYS(
            Flags::enableCaptionCompatInsetForceConsumptionAlways, true),
    ENABLE_CASCADING_WINDOWS(Flags::enableCascadingWindows, true),
    ENABLE_TILE_RESIZING(Flags::enableTileResizing, true),
    ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY(
            Flags::enableDesktopWindowingWallpaperActivity, true),
    ENABLE_DESKTOP_WINDOWING_MODALS_POLICY(Flags::enableDesktopWindowingModalsPolicy, true),
+37 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2024 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.tiling.TilingDividerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:id="@+id/divider_bar">

        <com.android.wm.shell.common.split.DividerHandleView
            android:id="@+id/docked_divider_handle"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:layout_gravity="center"
            android:contentDescription="@string/accessibility_divider"
            android:background="@null"/>

        <com.android.wm.shell.common.split.DividerRoundedCorner
            android:id="@+id/docked_divider_rounded_corner"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>


</com.android.wm.shell.windowdecor.tiling.TilingDividerView>
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -103,7 +103,8 @@ public class DividerHandleView extends View {
        mHoveringHeight = mHeight > mWidth ? ((int) (mHeight * 1.5f)) : mHeight;
    }

    void setIsLeftRightSplit(boolean isLeftRightSplit) {
    /** sets whether it's a left/right or top/bottom split */
    public void setIsLeftRightSplit(boolean isLeftRightSplit) {
        mIsLeftRightSplit = isLeftRightSplit;
        updateDimens();
    }
+5 −1
Original line number Diff line number Diff line
@@ -98,7 +98,11 @@ public class DividerRoundedCorner extends View {
        return false;
    }

    void setIsLeftRightSplit(boolean isLeftRightSplit) {
    /**
     * Set whether the rounded corner is for a left/right split.
     * @param isLeftRightSplit whether it's a left/right split or top/bottom split.
     */
    public void setIsLeftRightSplit(boolean isLeftRightSplit) {
        mIsLeftRightSplit = isLeftRightSplit;
    }

+29 −3
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ import com.android.wm.shell.windowdecor.DesktopModeWindowDecorViewModel;
import com.android.wm.shell.windowdecor.WindowDecorViewModel;
import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer;
import com.android.wm.shell.windowdecor.education.DesktopWindowingEducationTooltipController;
import com.android.wm.shell.windowdecor.tiling.DesktopTilingDecorViewModel;

import dagger.Binds;
import dagger.Lazy;
@@ -649,7 +650,8 @@ public abstract class WMShellModule {
            InteractionJankMonitor interactionJankMonitor,
            InputManager inputManager,
            FocusTransitionObserver focusTransitionObserver,
            DesktopModeEventLogger desktopModeEventLogger) {
            DesktopModeEventLogger desktopModeEventLogger,
            DesktopTilingDecorViewModel desktopTilingDecorViewModel) {
        return new DesktopTasksController(context, shellInit, shellCommandHandler, shellController,
                displayController, shellTaskOrganizer, syncQueue, rootTaskDisplayAreaOrganizer,
                dragAndDropController, transitions, keyguardManager,
@@ -661,8 +663,32 @@ public abstract class WMShellModule {
                desktopModeLoggerTransitionObserver, launchAdjacentController,
                recentsTransitionHandler, multiInstanceHelper, mainExecutor, desktopTasksLimiter,
                recentTasksController.orElse(null), interactionJankMonitor, mainHandler,
                inputManager, focusTransitionObserver,
                desktopModeEventLogger);
                inputManager, focusTransitionObserver, desktopModeEventLogger,
                desktopTilingDecorViewModel);
    }

    @WMSingleton
    @Provides
    static DesktopTilingDecorViewModel provideDesktopTilingViewModel(Context context,
            DisplayController displayController,
            RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
            SyncTransactionQueue syncQueue,
            Transitions transitions,
            ShellTaskOrganizer shellTaskOrganizer,
            ToggleResizeDesktopTaskTransitionHandler toggleResizeDesktopTaskTransitionHandler,
            ReturnToDragStartAnimator returnToDragStartAnimator,
            @DynamicOverride DesktopRepository desktopRepository) {
        return new DesktopTilingDecorViewModel(
                context,
                displayController,
                rootTaskDisplayAreaOrganizer,
                syncQueue,
                transitions,
                shellTaskOrganizer,
                toggleResizeDesktopTaskTransitionHandler,
                returnToDragStartAnimator,
                desktopRepository
        );
    }

    @WMSingleton
Loading