From bd839dbdd1287f290a7dad0895c685368ebdea33 Mon Sep 17 00:00:00 2001 From: mattsziklay Date: Wed, 28 Sep 2022 13:44:18 -0700 Subject: [PATCH] Add bar type window caption. This is the first CL towards implementing the bar type caption which will have a back button, a handle, and a close button. The caption will also disappear when the attached task is not in focus. Still to be implemented: 1: Windowing options appearing on handle click 2: Drag down in fullscreen to enter desktop mode 3: Caption display via hovering when cursor available Bug: 239960071 Test: Manual: confirm new caption displays with the correct buttons/layout. Confirm buttons work and focus change works with multiple tasks. Test: Atest WindowDecorationTests Change-Id: I2ebed76b803d1f337edc3e7340966909f63eaf40 --- .../res/drawable/decor_back_button_dark.xml | 32 +++++++ .../res/drawable/decor_caption_title.xml | 4 +- .../res/drawable/decor_close_button_dark.xml | 8 +- .../Shell/res/drawable/decor_handle_dark.xml | 23 +++++ .../res/layout/caption_window_decoration.xml | 30 +++---- .../Shell/res/values/strings.xml | 4 + .../wm/shell/dagger/WMShellModule.java | 14 +-- .../CaptionWindowDecorViewModel.java | 73 ++++++++-------- .../windowdecor/CaptionWindowDecoration.java | 85 +++++++++++-------- .../shell/windowdecor/WindowDecoration.java | 21 +++-- .../windowdecor/WindowDecorationTests.java | 5 +- 11 files changed, 185 insertions(+), 114 deletions(-) create mode 100644 libs/WindowManager/Shell/res/drawable/decor_back_button_dark.xml create mode 100644 libs/WindowManager/Shell/res/drawable/decor_handle_dark.xml diff --git a/libs/WindowManager/Shell/res/drawable/decor_back_button_dark.xml b/libs/WindowManager/Shell/res/drawable/decor_back_button_dark.xml new file mode 100644 index 0000000000000..66e5b43d76af3 --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/decor_back_button_dark.xml @@ -0,0 +1,32 @@ + + + + + + + + \ No newline at end of file diff --git a/libs/WindowManager/Shell/res/drawable/decor_caption_title.xml b/libs/WindowManager/Shell/res/drawable/decor_caption_title.xml index 8207365a737d9..53a8bb18537cf 100644 --- a/libs/WindowManager/Shell/res/drawable/decor_caption_title.xml +++ b/libs/WindowManager/Shell/res/drawable/decor_caption_title.xml @@ -15,8 +15,6 @@ ~ limitations under the License. --> - + diff --git a/libs/WindowManager/Shell/res/drawable/decor_close_button_dark.xml b/libs/WindowManager/Shell/res/drawable/decor_close_button_dark.xml index f2f1a1d55dee6..851cbf26afc33 100644 --- a/libs/WindowManager/Shell/res/drawable/decor_close_button_dark.xml +++ b/libs/WindowManager/Shell/res/drawable/decor_close_button_dark.xml @@ -18,15 +18,13 @@ android:width="32.0dp" android:height="32.0dp" android:viewportWidth="32.0" - android:viewportHeight="32.0" - android:tint="@color/decor_button_dark_color" - > + android:viewportHeight="32.0"> + android:fillColor="@android:color/black" + android:pathData="M12.45,38.35 L9.65,35.55 21.2,24 9.65,12.45 12.45,9.65 24,21.2 35.55,9.65 38.35,12.45 26.8,24 38.35,35.55 35.55,38.35 24,26.8Z"/> diff --git a/libs/WindowManager/Shell/res/drawable/decor_handle_dark.xml b/libs/WindowManager/Shell/res/drawable/decor_handle_dark.xml new file mode 100644 index 0000000000000..ee0f4663c9407 --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/decor_handle_dark.xml @@ -0,0 +1,23 @@ + + + + diff --git a/libs/WindowManager/Shell/res/layout/caption_window_decoration.xml b/libs/WindowManager/Shell/res/layout/caption_window_decoration.xml index d183e42c173b0..38cd5702f1349 100644 --- a/libs/WindowManager/Shell/res/layout/caption_window_decoration.xml +++ b/libs/WindowManager/Shell/res/layout/caption_window_decoration.xml @@ -17,39 +17,33 @@