Add a default widget category provider that uses application category.
The category provider can be customized by any launcher via resource
override. For instance, one can override it to provide custom categories
using an allowlist or use a different mechanism such as query play
services.
We still need to get proper strings for categories from UX writer.
Bug: 318410881
Test: WidgetRecommendationCategoryProviderTest
Flag: ACONFIG com.android.launcher3.enable_categorized_widget_recommendations DEVELOPMENT
Change-Id: I5c4e0d22eaffc8254ddd54356f8c62f00e22a3c4
diff --git a/res/values/config.xml b/res/values/config.xml
index 5bdd7ebb..29c4e66 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -194,6 +194,11 @@
<string-array name="filtered_components" ></string-array>
+ <!-- Widget component names to be included in weather category of widget suggestions. -->
+ <string-array name="weather_recommendations"></string-array>
+ <!-- Widget component names to be included in fitness category of widget suggestions. -->
+ <string-array name="fitness_recommendations"></string-array>
+
<!-- Name of the class used to generate colors from the wallpaper colors. Must be implementing the LauncherAppWidgetHostView.ColorGenerator interface. -->
<string name="color_generator_class" translatable="false"/>
@@ -252,6 +257,9 @@
<!-- Used for custom widgets -->
<array name="custom_widget_providers"/>
+ <!-- Used for determining category of a widget presented in widget recommendations. -->
+ <string name="widget_recommendation_category_provider_class" translatable="false"></string>
+
<!-- Embed parameters -->
<dimen name="activity_split_ratio" format="float">0.5</dimen>
<integer name="min_width_split">720</integer>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index b9fb024..5cc4616 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -71,6 +71,12 @@
<!-- Widget suggestions header title in the full widgets picker for large screen devices
in landscape mode. [CHAR_LIMIT=50] -->
<string name="suggested_widgets_header_title">Suggestions</string>
+ <string name="productivity_widget_recommendation_category_label">Boost your day</string>
+ <string name="news_widget_recommendation_category_label">News For You</string>
+ <string name="social_and_entertainment_widget_recommendation_category_label">Your Chill Zone</string>
+ <string name="fitness_widget_recommendation_category_label">Reach Your Fitness Goals</string>
+ <string name="weather_widget_recommendation_category_label">Stay Ahead of the Weather</string>
+ <string name="others_widget_recommendation_category_label">You Might Also Like</string>
<!-- Label for showing the number of widgets an app has in the full widgets picker.
[CHAR_LIMIT=25][ICU SYNTAX] -->
<string name="widgets_count">