From b08131433009e20ac35ca6da55c015e08071f1d3 Mon Sep 17 00:00:00 2001 From: Shamali P Date: Mon, 18 Mar 2024 03:36:21 +0000 Subject: [PATCH] Retain recommendations (if possible) while picker is open Picker rebinds recommendations when size constraints change or fold/unfold, but recommendations from popup provider may have changed. This is an attempt at trying to maintain currently shown items as much possible. Also, align the pagination and title to the top in two pane picker (confirmed with David that we prefer this version) Additionally, we don't show the widgets count for suggestions. Bug: 318410881 Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT Test: Manual Change-Id: I60799f9ad38da913c3e084d758f5b82c79cd641c --- res/layout/widget_recommendations.xml | 6 +- res/layout/widgets_two_pane_sheet.xml | 2 +- .../picker/WidgetRecommendationsView.java | 47 +++++-- .../widget/picker/WidgetsFullSheet.java | 119 ++++++++++++------ .../widget/picker/WidgetsTwoPaneSheet.java | 16 ++- 5 files changed, 131 insertions(+), 59 deletions(-) diff --git a/res/layout/widget_recommendations.xml b/res/layout/widget_recommendations.xml index 89821ac909..531db2edd4 100644 --- a/res/layout/widget_recommendations.xml +++ b/res/layout/widget_recommendations.xml @@ -28,6 +28,7 @@ android:layout_marginTop="16dp" android:accessibilityLiveRegion="polite" android:gravity="center_horizontal" + android:layout_gravity="top" android:lineHeight="20sp" android:textColor="?attr/widgetPickerTitleColor" android:textFontWeight="500" @@ -38,7 +39,7 @@ android:id="@+id/widget_recommendations_page_indicator" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" + android:layout_gravity="center_horizontal|top" android:elevation="1dp" android:visibility="gone" />