From 6439678d821523cc8733434ab74a2c24207d5ac6 Mon Sep 17 00:00:00 2001 From: Jorge Gil Date: Fri, 25 Oct 2024 04:39:07 +0000 Subject: Add immersive option to maximize menu Shown when the task is requesting immersive. Also changes the maximize drawable to have a small bottom padding so that it is slightly different than the immersive drawable. This change also hides the snap options when the app is not resizable. Overall, this means that the menu can now have between 1-3 options in it, depending on resizeability and immersive requests, so the menu width and position are adjusted accordingly. Flag: com.android.window.flags.enable_fully_immersive_in_desktop Fix: 369441303 Test: manual - open maximize menu on immersive apps, non immersive apps, resizable apps and non resizable apps and check the options are shown accordingly Test: atest DesktopModeWindowDecorationTests DesktopModeWindowDecorViewModelTests Change-Id: Ie8c7357e55d9650cc318de5f6fdc791de0629db1 --- .../desktop_mode_window_decor_maximize_menu.xml | 42 +++- libs/WindowManager/Shell/res/values/dimen.xml | 10 +- libs/WindowManager/Shell/res/values/strings.xml | 5 +- .../DesktopModeWindowDecorViewModel.java | 5 + .../windowdecor/DesktopModeWindowDecoration.java | 60 ++++-- .../android/wm/shell/windowdecor/MaximizeMenu.kt | 237 ++++++++++++++++----- .../DesktopModeWindowDecorViewModelTests.kt | 36 ++++ .../DesktopModeWindowDecorationTests.java | 121 ++++++++++- 8 files changed, 429 insertions(+), 87 deletions(-) diff --git a/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_maximize_menu.xml b/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_maximize_menu.xml index 37596182f05b..5e41865cd31e 100644 --- a/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_maximize_menu.xml +++ b/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_maximize_menu.xml @@ -17,20 +17,53 @@ + +