Use adaptive icon shapes for settings homeepage

- Add AdaptiveIconShapeDrawable for the homepage icon backgrounds
- Rename RoundedHomepageIcon -> AdaptiveHomepageIcon to reflect that the
adaptive icon shape is used

Bug: 123829919
Test: mp settings; manually viewing homepage icons
Change-Id: I9fddfbf57461b300200f30f716d861878bbbcc38
This commit is contained in:
Amin Shaikh
2019-02-05 13:52:30 -05:00
parent 12cec79889
commit 3304bec980
20 changed files with 122 additions and 148 deletions

View File

@@ -46,7 +46,7 @@ import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.dashboard.profileselector.ProfileSelectDialog;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.RoundedHomepageIcon;
import com.android.settings.widget.AdaptiveHomepageIcon;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.Tile;
@@ -197,8 +197,8 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
Drawable iconDrawable = tileIcon.loadDrawable(preference.getContext());
if (forceRoundedIcon
&& !TextUtils.equals(mContext.getPackageName(), tile.getPackageName())) {
iconDrawable = new RoundedHomepageIcon(mContext, iconDrawable);
((RoundedHomepageIcon) iconDrawable).setBackgroundColor(mContext, tile);
iconDrawable = new AdaptiveHomepageIcon(mContext, iconDrawable);
((AdaptiveHomepageIcon) iconDrawable).setBackgroundColor(mContext, tile);
}
preference.setIcon(iconDrawable);
} else if (tile.getMetaData() != null