Loading src/com/android/settings/fuelgauge/batteryusage/PowerGaugePreference.java +11 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ public class PowerGaugePreference extends AppPreference { private static final float UNSELECTABLE_ALPHA_LIGHT_MODE = 0.65f; private static final float UNSELECTABLE_ALPHA_DARK_MODE = 0.65f; private final int mTitleColorNormal; private BatteryEntry mInfo; private BatteryDiffEntry mBatteryDiffEntry; private CharSequence mContentDescription; Loading Loading @@ -78,6 +80,8 @@ public class PowerGaugePreference extends AppPreference { mInfo = info; mContentDescription = contentDescription; mShowAnomalyIcon = false; mTitleColorNormal = Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary); } /** Sets the content description. */ Loading Loading @@ -155,6 +159,13 @@ public class PowerGaugePreference extends AppPreference { final TextView titleView = (TextView) view.findViewById(android.R.id.title); titleView.setContentDescription(mContentDescription); } if (!isSelectable()) { // Set colors consistently to meet contrast requirements for non-selectable items ((TextView) view.findViewById(android.R.id.title)).setTextColor(mTitleColorNormal); ((TextView) view.findViewById(android.R.id.summary)).setTextColor(mTitleColorNormal); subtitle.setTextColor(mTitleColorNormal); } } private static void setViewAlpha(View view, float alpha) { Loading Loading
src/com/android/settings/fuelgauge/batteryusage/PowerGaugePreference.java +11 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ public class PowerGaugePreference extends AppPreference { private static final float UNSELECTABLE_ALPHA_LIGHT_MODE = 0.65f; private static final float UNSELECTABLE_ALPHA_DARK_MODE = 0.65f; private final int mTitleColorNormal; private BatteryEntry mInfo; private BatteryDiffEntry mBatteryDiffEntry; private CharSequence mContentDescription; Loading Loading @@ -78,6 +80,8 @@ public class PowerGaugePreference extends AppPreference { mInfo = info; mContentDescription = contentDescription; mShowAnomalyIcon = false; mTitleColorNormal = Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary); } /** Sets the content description. */ Loading Loading @@ -155,6 +159,13 @@ public class PowerGaugePreference extends AppPreference { final TextView titleView = (TextView) view.findViewById(android.R.id.title); titleView.setContentDescription(mContentDescription); } if (!isSelectable()) { // Set colors consistently to meet contrast requirements for non-selectable items ((TextView) view.findViewById(android.R.id.title)).setTextColor(mTitleColorNormal); ((TextView) view.findViewById(android.R.id.summary)).setTextColor(mTitleColorNormal); subtitle.setTextColor(mTitleColorNormal); } } private static void setViewAlpha(View view, float alpha) { Loading