Skip to content

Commit 1974da9

Browse files
0xD34DGerrit Code Review
authored andcommitted
Revert "SysUI: Fix coloring of battery drawables"
This reverts commit 453e8f2. Going to re-do this since the colors need to be cached so when the user changes styles we apply the correct tinting Change-Id: I7bcd70d4464eac5a7869a3e237d19be8629310f5
1 parent c7e7c09 commit 1974da9

4 files changed

Lines changed: 5 additions & 11 deletions

File tree

packages/SystemUI/res/drawable/ic_battery_circle_frame.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
android:viewportWidth="24"
2121
android:viewportHeight="24">
2222

23-
<!-- Path will be tinted based on dual tone color -->
2423
<path
2524
android:name="frame"
26-
android:strokeColor="#000000"
25+
android:strokeColor="@color/batterymeter_frame_color"
2726
android:strokeLineJoin="round"
2827
android:strokeWidth="3"
2928
android:pathData="@string/battery_circle_path"/>

packages/SystemUI/res/drawable/ic_battery_landscape_frame.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
android:name="mask"
2525
android:pathData="@string/battery_landscape_clip_path" />
2626

27-
<!-- Path will be tinted based on dual tone color -->
2827
<path
2928
android:name="frame"
30-
android:fillColor="#000000"
29+
android:fillColor="@color/batterymeter_frame_color"
3130
android:pathData="M 1 4 H 25 V 20 H 1 V 4 Z" />
3231
</vector>

packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
android:name="mask"
2525
android:pathData="@string/battery_portrait_clip_path" />
2626

27-
<!-- Path will be tinted based on dual tone color -->
2827
<path
2928
android:name="frame"
30-
android:fillColor="#000000"
29+
android:fillColor="@color/batterymeter_frame_color"
3130
android:pathData="M19,2v19H5V2H19z" />
3231

3332
</vector>

packages/SystemUI/src/com/android/systemui/BatteryMeterView.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,7 @@ public void onDispose() {
537537
@Override
538538
public void setDarkIntensity(int backgroundColor, int fillColor) {
539539
mIconTint = fillColor;
540-
// make bolt drawable tint fully opaque so it stands out
541-
mBoltDrawable.setTint(0xff000000 | fillColor);
542-
mFrameDrawable.setTint(backgroundColor);
540+
mBoltDrawable.setTint(fillColor);
543541
updateBoltDrawableLayer(mBatteryDrawable, mBoltDrawable);
544542
invalidate();
545543
}
@@ -662,8 +660,7 @@ private void drawPercentageText(Canvas canvas, BatteryTracker tracker) {
662660
&& (mShowPercent && !(level == 100 && !SHOW_100_PERCENT))) {
663661
// draw the percentage text
664662
String pctText = String.valueOf(SINGLE_DIGIT_PERCENT ? (level/10) : level);
665-
// make paint color fully opaque so text stands out better
666-
mTextAndBoltPaint.setColor(0xff000000 | getColorForLevel(level));
663+
mTextAndBoltPaint.setColor(getColorForLevel(level));
667664
canvas.drawText(pctText, mTextX, mTextY, mTextAndBoltPaint);
668665
} else if (level <= mCriticalLevel) {
669666
// draw the warning text

0 commit comments

Comments
 (0)