From e2b6205b03a1bbe755bf17f51b3e361c9eb0f95c Mon Sep 17 00:00:00 2001 From: danielwbhuang Date: Fri, 11 Nov 2022 15:22:31 +0800 Subject: [PATCH] Implement new shortcut search list UI 1. Add an EditText for shortcuts search purpose. 2. Add new shortcut categories. 3. Create N to 1 shortcut mapping mechanism. 4. Fn based shortcuts shouldn't be showed. Demo New UI: go/shortcutlist_demo Flag: SHORTCUT_LIST_SEARCH_LAYOUT Bug: 259352579 Test: manual and atest Change-Id: I688365d5c408ba07b457eec66b3b5cc497390498 --- .../res/drawable/ic_shortcutlist_search.xml | 25 + .../ic_shortcutlist_search_button_cancel.xml | 25 + .../res/drawable/shortcut_button_colored.xml | 29 + .../shortcut_button_focus_colored.xml | 29 + .../res/drawable/shortcut_dialog_bg.xml | 24 + .../drawable/shortcut_search_background.xml | 26 + ...ard_shortcuts_category_short_separator.xml | 20 + .../keyboard_shortcuts_key_new_icon_view.xml | 24 + .../keyboard_shortcuts_key_new_view.xml | 25 + .../keyboard_shortcuts_key_plus_view.xml | 28 + ...yboard_shortcuts_key_vertical_bar_view.xml | 28 + .../layout/keyboard_shortcuts_search_view.xml | 139 ++ packages/SystemUI/res/values/colors.xml | 1 + packages/SystemUI/res/values/strings.xml | 103 +- packages/SystemUI/res/values/styles.xml | 19 + .../dagger/ReferenceSystemUIModule.java | 4 +- .../statusbar/KeyboardShortcutListSearch.java | 1382 +++++++++++++++++ .../systemui/statusbar/KeyboardShortcuts.java | 24 +- .../statusbar/KeyboardShortcutsReceiver.java | 30 +- .../statusbar/phone/CentralSurfacesImpl.java | 22 +- .../KeyboardShortcutListSearchTest.java | 80 + .../KeyboardShortcutsReceiverTest.java | 135 ++ .../statusbar/KeyboardShortcutsTest.java | 79 + .../phone/CentralSurfacesImplTest.java | 2 + 24 files changed, 2271 insertions(+), 32 deletions(-) create mode 100644 packages/SystemUI/res/drawable/ic_shortcutlist_search.xml create mode 100644 packages/SystemUI/res/drawable/ic_shortcutlist_search_button_cancel.xml create mode 100644 packages/SystemUI/res/drawable/shortcut_button_colored.xml create mode 100644 packages/SystemUI/res/drawable/shortcut_button_focus_colored.xml create mode 100644 packages/SystemUI/res/drawable/shortcut_dialog_bg.xml create mode 100644 packages/SystemUI/res/drawable/shortcut_search_background.xml create mode 100644 packages/SystemUI/res/layout/keyboard_shortcuts_category_short_separator.xml create mode 100644 packages/SystemUI/res/layout/keyboard_shortcuts_key_new_icon_view.xml create mode 100644 packages/SystemUI/res/layout/keyboard_shortcuts_key_new_view.xml create mode 100644 packages/SystemUI/res/layout/keyboard_shortcuts_key_plus_view.xml create mode 100644 packages/SystemUI/res/layout/keyboard_shortcuts_key_vertical_bar_view.xml create mode 100644 packages/SystemUI/res/layout/keyboard_shortcuts_search_view.xml create mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutListSearch.java create mode 100644 packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutListSearchTest.java create mode 100644 packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsReceiverTest.java create mode 100644 packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsTest.java diff --git a/packages/SystemUI/res/drawable/ic_shortcutlist_search.xml b/packages/SystemUI/res/drawable/ic_shortcutlist_search.xml new file mode 100644 index 0000000000000..1b12e74141a77 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_shortcutlist_search.xml @@ -0,0 +1,25 @@ + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/ic_shortcutlist_search_button_cancel.xml b/packages/SystemUI/res/drawable/ic_shortcutlist_search_button_cancel.xml new file mode 100644 index 0000000000000..e3b1ab2d3e732 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_shortcutlist_search_button_cancel.xml @@ -0,0 +1,25 @@ + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/shortcut_button_colored.xml b/packages/SystemUI/res/drawable/shortcut_button_colored.xml new file mode 100644 index 0000000000000..a21489cc47aa5 --- /dev/null +++ b/packages/SystemUI/res/drawable/shortcut_button_colored.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/shortcut_button_focus_colored.xml b/packages/SystemUI/res/drawable/shortcut_button_focus_colored.xml new file mode 100644 index 0000000000000..2ff32b6ee9b5f --- /dev/null +++ b/packages/SystemUI/res/drawable/shortcut_button_focus_colored.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/shortcut_dialog_bg.xml b/packages/SystemUI/res/drawable/shortcut_dialog_bg.xml new file mode 100644 index 0000000000000..6ce3eaecc147e --- /dev/null +++ b/packages/SystemUI/res/drawable/shortcut_dialog_bg.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/shortcut_search_background.xml b/packages/SystemUI/res/drawable/shortcut_search_background.xml new file mode 100644 index 0000000000000..66fc191cb736c --- /dev/null +++ b/packages/SystemUI/res/drawable/shortcut_search_background.xml @@ -0,0 +1,26 @@ + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/keyboard_shortcuts_category_short_separator.xml b/packages/SystemUI/res/layout/keyboard_shortcuts_category_short_separator.xml new file mode 100644 index 0000000000000..530e46eb1c403 --- /dev/null +++ b/packages/SystemUI/res/layout/keyboard_shortcuts_category_short_separator.xml @@ -0,0 +1,20 @@ + + + diff --git a/packages/SystemUI/res/layout/keyboard_shortcuts_key_new_icon_view.xml b/packages/SystemUI/res/layout/keyboard_shortcuts_key_new_icon_view.xml new file mode 100644 index 0000000000000..a037cb284b5ac --- /dev/null +++ b/packages/SystemUI/res/layout/keyboard_shortcuts_key_new_icon_view.xml @@ -0,0 +1,24 @@ + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/keyboard_shortcuts_key_new_view.xml b/packages/SystemUI/res/layout/keyboard_shortcuts_key_new_view.xml new file mode 100644 index 0000000000000..12b4e150ee2d5 --- /dev/null +++ b/packages/SystemUI/res/layout/keyboard_shortcuts_key_new_view.xml @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/keyboard_shortcuts_key_plus_view.xml b/packages/SystemUI/res/layout/keyboard_shortcuts_key_plus_view.xml new file mode 100644 index 0000000000000..727f2c15d5e55 --- /dev/null +++ b/packages/SystemUI/res/layout/keyboard_shortcuts_key_plus_view.xml @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/keyboard_shortcuts_key_vertical_bar_view.xml b/packages/SystemUI/res/layout/keyboard_shortcuts_key_vertical_bar_view.xml new file mode 100644 index 0000000000000..00ef947847405 --- /dev/null +++ b/packages/SystemUI/res/layout/keyboard_shortcuts_key_vertical_bar_view.xml @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/keyboard_shortcuts_search_view.xml b/packages/SystemUI/res/layout/keyboard_shortcuts_search_view.xml new file mode 100644 index 0000000000000..8a66f50d13b16 --- /dev/null +++ b/packages/SystemUI/res/layout/keyboard_shortcuts_search_view.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + +