Move ad-hoc dynamic tile injection into FeatureProvider.

Ideally a page should use DashboardFragment and it doesn't need to
handle adding dynamic tiles manually. This method is only designed for
page that are not fully migrated to DashboardFragment yet.

Bug: 32623105
Test: RunSettingsRoboTests
Change-Id: I0cafcddf9a43b164daea500bade869fada5b3f4e
This commit is contained in:
Fan Zhang
2016-11-16 16:03:08 -08:00
parent 08aee17586
commit 16f5af6e84
4 changed files with 109 additions and 31 deletions

View File

@@ -39,6 +39,19 @@ public interface DashboardFeatureProvider {
*/
DashboardCategory getTilesForCategory(String key);
/**
* Get tiles (wrapped as a list of Preference) for key defined in CategoryKey.
*
* @param activity Activity hosting the preference
* @param context UI context to inflate preference
* @param key Value from CategoryKey
* @deprecated Pages implementing {@code DashboardFragment} should use
* {@link #getTilesForCategory(String)} instead. Using this method will not get the benefit
* of auto-ordering, progressive disclosure, auto-refreshing summary text etc.
*/
@Deprecated
List<Preference> getPreferencesForCategory(Activity activity, Context context, String key);
/**
* Get all tiles, grouped by category.
*/
@@ -75,4 +88,5 @@ public interface DashboardFeatureProvider {
ProgressiveDisclosureMixin getProgressiveDisclosureMixin(Context context,
DashboardFragment fragment);
}