Permalink
Browse files

Battery styles: bring in latest upstream changes

- fix battery bolt/text not fully transparent in keyguard and tile
- minor code improvements

Change-Id: I0172ac01b3e589bba3002a3256b351ddfae59adc
  • Loading branch information...
maniac103 authored and xlxfoxxlx committed Dec 2, 2016
1 parent 7a696ef commit ba46b2401e270db4ed7eff86d3ba940fce7f669c
Showing with 6 additions and 4 deletions.
  1. +6 −4 packages/SystemUI/src/com/android/systemui/BatteryMeterDrawable.java
@@ -216,6 +216,7 @@ public BatteryMeterDrawable(Context context, Handler handler, int frameColor, in
} else {
xferMode = PorterDuff.intToMode(a.getInt(1, PorterDuff.modeToInt(PorterDuff.Mode.XOR)));
}
a.recycle();
} else {
mTextGravity = Gravity.CENTER;
}
@@ -422,16 +423,17 @@ private int getColorForLevel(int percent, boolean isChargeLevel) {
} else {
// If we are in power save mode, always use the normal color.
if (mPowerSaveEnabled) {
return mColors[mColors.length-1];
return mColors[mColors.length - 1];
}
int thresh, color = 0;
for (int i=0; i<mColors.length; i+=2) {
int thresh = 0;
int color = 0;
for (int i = 0; i < mColors.length; i += 2) {
thresh = mColors[i];
color = mColors[i+1];
if (percent <= thresh) {
// Respect tinting for "normal" level
if (i == mColors.length-2) {
if (i == mColors.length - 2) {
return mIconTint;
} else {
return color;

0 comments on commit ba46b24

Please sign in to comment.