From 155634c02a98e72d9fc57d53b0f9c8818be1ff21 Mon Sep 17 00:00:00 2001 From: Yanting Yang Date: Fri, 15 Jan 2021 04:06:37 +0800 Subject: [PATCH] Update the icon size of homepage preference for injected IAs Based on the Android S design, apply the new foreground image inset to AdaptiveIcon to generate the new injected IAs icon. Fixes: 177213699 Test: robotest & visual with turning on/off silky home Change-Id: If1961a3a41cda92f5435beb47799e8250820d9fb --- .../settings/dashboard/DashboardFeatureProviderImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java index 9c00e4be129..a191e685a65 100644 --- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java +++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java @@ -410,7 +410,11 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider { String iconPackage, Icon icon) { Drawable iconDrawable = icon.loadDrawable(preference.getContext()); if (forceRoundedIcon && !TextUtils.equals(mContext.getPackageName(), iconPackage)) { - iconDrawable = new AdaptiveIcon(mContext, iconDrawable); + iconDrawable = new AdaptiveIcon(mContext, iconDrawable, + FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME) + && TextUtils.equals(tile.getCategory(), CategoryKey.CATEGORY_HOMEPAGE) + ? R.dimen.homepage_foreground_image_inset + : R.dimen.dashboard_tile_foreground_image_inset); ((AdaptiveIcon) iconDrawable).setBackgroundColor(mContext, tile); } preference.setIcon(iconDrawable);