From 167f81b931589054474dbdfd51ae9411a3e032ed Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Tue, 23 Feb 2021 10:48:46 +0000 Subject: [PATCH] Add a header container view to the widgets full sheet A header container view will contain 1. A horizontal bar: for indicating the popup view can be dragged to dismiss: 2. A title view: a title of the widgets full sheet popup view. 3. A search bar: for widgets / shortcut search. Since we will be making the fallback search algorithm available in AOSP, the search bar will now live in the Launcher3 codebase. 4. Recommended widgets (coming soon...) This CL also added a scroll effect which gradually collapses the title view when the user scrolls down the recycler view. The title view will gradually restore its height when the user scroll to the top of the recycler view. Test: Manually test widgets pickers in work profile and non work profile setup. Verified the fast scroll bar works well in both setup. With searchbar: https://drive.google.com/file/d/19grUHL_LspLhMD_5p6-i0CiMW1FpflmD/view?usp=sharing Without searchbar: https://drive.google.com/file/d/1KRPgEAESHUhJDo1UJsQN80JO1c9Y8Nhl/view?usp=sharing Bug: 179797520 Change-Id: If0016e3b3c693414897140e7912531ed9bd5deef --- res/drawable/bg_widgets_searchbox.xml | 19 ++ res/layout/personal_work_tabs.xml | 1 + res/layout/widgets_full_sheet_paged_view.xml | 6 +- ..._full_sheet_search_and_recommendations.xml | 49 ++++++ res/values/strings.xml | 8 +- .../android/launcher3/BaseRecyclerView.java | 18 ++ .../allapps/AllAppsRecyclerView.java | 18 -- .../views/RecyclerViewFastScroller.java | 29 +++- ...rchAndRecommendationsScrollController.java | 162 ++++++++++++++++++ .../widget/picker/WidgetsFullSheet.java | 67 +++++++- .../widget/picker/WidgetsRecyclerView.java | 26 ++- 11 files changed, 375 insertions(+), 28 deletions(-) create mode 100644 res/drawable/bg_widgets_searchbox.xml create mode 100644 res/layout/widgets_full_sheet_search_and_recommendations.xml create mode 100644 src/com/android/launcher3/widget/picker/SearchAndRecommendationsScrollController.java diff --git a/res/drawable/bg_widgets_searchbox.xml b/res/drawable/bg_widgets_searchbox.xml new file mode 100644 index 0000000000..81dd2aa0c6 --- /dev/null +++ b/res/drawable/bg_widgets_searchbox.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/res/layout/personal_work_tabs.xml b/res/layout/personal_work_tabs.xml index 8f29997802..5fb5bcbea0 100644 --- a/res/layout/personal_work_tabs.xml +++ b/res/layout/personal_work_tabs.xml @@ -23,6 +23,7 @@ android:layout_marginLeft="@dimen/all_apps_tabs_side_padding" android:layout_marginRight="@dimen/all_apps_tabs_side_padding" android:orientation="horizontal" + android:elevation="2dp" style="@style/TextHeadline">