From 23a9bc9919f9afd45a120e9eed7aa7ed133b3c52 Mon Sep 17 00:00:00 2001 From: Merissa Tan Date: Mon, 5 Dec 2022 17:15:34 -0800 Subject: Add full-width caption on Shell. This CL adds a default full-width caption implementation on Shell to act as a stable caption implementation in freeform windowing environment, since the desktop mode caption is not yet finalized. Currently, this caption is used unless the desktop mode flag is turned on. Bug: 260276028 Test: atest WMShellUnitTests Change-Id: I354330cfb959b453e382fed44d87ca7f0308a4e2 --- .../Shell/res/drawable/caption_decor_title.xml | 22 ++ .../res/drawable/decor_minimize_button_dark.xml | 8 +- .../Shell/res/layout/caption_window_decor.xml | 56 +++++ .../com/android/wm/shell/dagger/WMShellModule.java | 13 +- .../windowdecor/CaptionWindowDecorViewModel.java | 266 +++++++++++++++++++++ .../shell/windowdecor/CaptionWindowDecoration.java | 228 ++++++++++++++++++ .../DesktopModeWindowDecorViewModel.java | 46 +--- .../wm/shell/windowdecor/TaskOperations.java | 112 +++++++++ .../wm/shell/windowdecor/TaskPositioner.java | 4 + 9 files changed, 712 insertions(+), 43 deletions(-) create mode 100644 libs/WindowManager/Shell/res/drawable/caption_decor_title.xml create mode 100644 libs/WindowManager/Shell/res/layout/caption_window_decor.xml create mode 100644 libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java create mode 100644 libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java create mode 100644 libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/TaskOperations.java (limited to 'libs') diff --git a/libs/WindowManager/Shell/res/drawable/caption_decor_title.xml b/libs/WindowManager/Shell/res/drawable/caption_decor_title.xml new file mode 100644 index 000000000000..6114ad6e277a --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/caption_decor_title.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/libs/WindowManager/Shell/res/drawable/decor_minimize_button_dark.xml b/libs/WindowManager/Shell/res/drawable/decor_minimize_button_dark.xml index b7ff96e64eec..91edbf1a7bd4 100644 --- a/libs/WindowManager/Shell/res/drawable/decor_minimize_button_dark.xml +++ b/libs/WindowManager/Shell/res/drawable/decor_minimize_button_dark.xml @@ -14,10 +14,10 @@ ~ limitations under the License. --> diff --git a/libs/WindowManager/Shell/res/layout/caption_window_decor.xml b/libs/WindowManager/Shell/res/layout/caption_window_decor.xml new file mode 100644 index 000000000000..f3d219872001 --- /dev/null +++ b/libs/WindowManager/Shell/res/layout/caption_window_decor.xml @@ -0,0 +1,56 @@ + + + +