Resolve insufficient contrast for system component icons

Screenshots:
https://screenshot.googleplex.com/5UE5aPgHHBqkpHr
https://screenshot.googleplex.com/8yYqPusm9M2euSj

Bug: 242989982
Test: manually checking for icon UI
Change-Id: Ic3e51dd4d0bc042c9caba78a89f5fe6a4b995efb
This commit is contained in:
ykhung
2022-08-22 15:55:47 +08:00
committed by YK Hung
parent 8cda408a2b
commit 4e98bc19f0
14 changed files with 102 additions and 38 deletions

View File

@@ -65,6 +65,8 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
private static final String TAG = "BatteryChartPreferenceController";
private static final String KEY_FOOTER_PREF = "battery_graph_footer";
private static final String PACKAGE_NAME_NONE = "none";
private static final int ENABLED_ICON_ALPHA = 255;
private static final int DISABLED_ICON_ALPHA = 255 / 3;
private static final long VALID_USAGE_TIME_DURATION = DateUtils.HOUR_IN_MILLIS * 2;
private static final long VALID_DIFF_DURATION = DateUtils.MINUTE_IN_MILLIS * 3;
@@ -463,6 +465,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
if (!isAdded) {
mAppListPrefGroup.addPreference(pref);
}
appIcon.setAlpha(pref.isEnabled() ? ENABLED_ICON_ALPHA : DISABLED_ICON_ALPHA);
prefIndex++;
}
}

View File

@@ -574,7 +574,7 @@ public class BatteryEntry {
break;
case BatteryConsumer.POWER_COMPONENT_BLUETOOTH:
name = context.getResources().getString(R.string.power_bluetooth);
iconId = com.android.internal.R.drawable.ic_settings_bluetooth;
iconId = R.drawable.ic_settings_bluetooth;
break;
case BatteryConsumer.POWER_COMPONENT_CAMERA:
name = context.getResources().getString(R.string.power_camera);
@@ -598,7 +598,7 @@ public class BatteryEntry {
break;
case BatteryConsumer.POWER_COMPONENT_WIFI:
name = context.getResources().getString(R.string.power_wifi);
iconId = R.drawable.ic_settings_wireless;
iconId = R.drawable.ic_settings_wireless_no_theme;
break;
case BatteryConsumer.POWER_COMPONENT_IDLE:
case BatteryConsumer.POWER_COMPONENT_MEMORY: