Redesign homepage IA icon
- remove the outer circle of the icons - tint the icons including injected ones Test: robotest, visual Bug: 182870640 Change-Id: If72c37152f4f0d68e25149b11d497eef1c7ece91
This commit is contained in:
@@ -21,6 +21,7 @@ import static com.android.settingslib.search.SearchIndexable.MOBILE;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.util.FeatureFlagUtils;
|
||||
@@ -28,8 +29,10 @@ import android.util.FeatureFlagUtils;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
@@ -102,6 +105,31 @@ public class TopLevelSettings extends DashboardFragment implements
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
super.onCreatePreferences(savedInstanceState, rootKey);
|
||||
if (!FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
|
||||
return;
|
||||
}
|
||||
final PreferenceScreen screen = getPreferenceScreen();
|
||||
if (screen == null) {
|
||||
return;
|
||||
}
|
||||
// Tint the homepage icons
|
||||
final int tintColor = Utils.getHomepageIconColor(getContext());
|
||||
final int count = screen.getPreferenceCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
final Preference preference = screen.getPreference(i);
|
||||
if (preference == null) {
|
||||
break;
|
||||
}
|
||||
final Drawable icon = preference.getIcon();
|
||||
if (icon != null) {
|
||||
icon.setTint(tintColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldForceRoundedIcon() {
|
||||
return getContext().getResources()
|
||||
|
Reference in New Issue
Block a user