Add a config to force rounded icon for DashboardFragment.
And each page has ability to turn on/off rounded icons. This CL only adds the flag, it doesn't actually change icon shape yet. - Boolean config in xml - New protected method for each DashboardFragment to load config - Plumb the boolean into DashboardFeatureProvider for future use. - Remove some unused APIs from DashboardFeatureProvider Bug: 110405144 Fixes: 79748104 Test: robotests Change-Id: Id34782e75aa7289967e4dd1f4fe2978688092702
This commit is contained in:
@@ -80,39 +80,11 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
|
||||
return mCategoryManager.getTilesByCategory(mContext, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Preference> getPreferencesForCategory(FragmentActivity activity, Context context,
|
||||
int sourceMetricsCategory, String key) {
|
||||
final DashboardCategory category = getTilesForCategory(key);
|
||||
if (category == null) {
|
||||
Log.d(TAG, "NO dashboard tiles for " + TAG);
|
||||
return null;
|
||||
}
|
||||
final List<Tile> tiles = category.getTiles();
|
||||
if (tiles == null || tiles.isEmpty()) {
|
||||
Log.d(TAG, "tile list is empty, skipping category " + category.key);
|
||||
return null;
|
||||
}
|
||||
final List<Preference> preferences = new ArrayList<>();
|
||||
for (Tile tile : tiles) {
|
||||
final Preference pref = new Preference(context);
|
||||
bindPreferenceToTile(activity, sourceMetricsCategory, pref, tile, null /* key */,
|
||||
Preference.DEFAULT_ORDER /* baseOrder */);
|
||||
preferences.add(pref);
|
||||
}
|
||||
return preferences;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DashboardCategory> getAllCategories() {
|
||||
return mCategoryManager.getCategories(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldTintIcon() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_tintSettingIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDashboardKeyForTile(Tile tile) {
|
||||
if (tile == null) {
|
||||
@@ -128,8 +100,8 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindPreferenceToTile(FragmentActivity activity, int sourceMetricsCategory,
|
||||
Preference pref, Tile tile, String key, int baseOrder) {
|
||||
public void bindPreferenceToTile(FragmentActivity activity, boolean forceRoundedIcon,
|
||||
int sourceMetricsCategory, Preference pref, Tile tile, String key, int baseOrder) {
|
||||
if (pref == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user