diff options
author | d34d <clark@cyngn.com> | 2016-05-19 12:48:53 -0700 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2016-05-19 12:53:06 -0700 |
commit | 453e8f212c4a0efafe1d7e3d6f00a0d87e953ed8 (patch) | |
tree | 7f847bea0fa719b172ed8e790407fe693c1aaae9 /packages | |
parent | e3ddac3a775d2e8808da40d302794e9b50016d9b (diff) | |
download | frameworks_base-453e8f212c4a0efafe1d7e3d6f00a0d87e953ed8.zip frameworks_base-453e8f212c4a0efafe1d7e3d6f00a0d87e953ed8.tar.gz frameworks_base-453e8f212c4a0efafe1d7e3d6f00a0d87e953ed8.tar.bz2 |
SysUI: Fix coloring of battery drawables
The frame color is now correctly tinted based on background color
set by setDarkIntensity()
Battery bolt and percentage text have their alpha set to full opacity
to increase visibility when drawn on a light colored status bar.
Change-Id: I907101ed1465f99b92370332d4839b7f0aad13b2
Diffstat (limited to 'packages')
4 files changed, 11 insertions, 5 deletions
diff --git a/packages/SystemUI/res/drawable/ic_battery_circle_frame.xml b/packages/SystemUI/res/drawable/ic_battery_circle_frame.xml index 8528c00..adc8a98 100644 --- a/packages/SystemUI/res/drawable/ic_battery_circle_frame.xml +++ b/packages/SystemUI/res/drawable/ic_battery_circle_frame.xml @@ -20,9 +20,10 @@ android:viewportWidth="24" android:viewportHeight="24"> + <!-- Path will be tinted based on dual tone color --> <path android:name="frame" - android:strokeColor="@color/batterymeter_frame_color" + android:strokeColor="#000000" android:strokeLineJoin="round" android:strokeWidth="3" android:pathData="@string/battery_circle_path"/> diff --git a/packages/SystemUI/res/drawable/ic_battery_landscape_frame.xml b/packages/SystemUI/res/drawable/ic_battery_landscape_frame.xml index 789316f..edb208c 100644 --- a/packages/SystemUI/res/drawable/ic_battery_landscape_frame.xml +++ b/packages/SystemUI/res/drawable/ic_battery_landscape_frame.xml @@ -24,8 +24,9 @@ android:name="mask" android:pathData="@string/battery_landscape_clip_path" /> + <!-- Path will be tinted based on dual tone color --> <path android:name="frame" - android:fillColor="@color/batterymeter_frame_color" + android:fillColor="#000000" android:pathData="M 1 4 H 25 V 20 H 1 V 4 Z" /> </vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml b/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml index f530727..1ef41e1 100644 --- a/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml +++ b/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml @@ -24,9 +24,10 @@ android:name="mask" android:pathData="@string/battery_portrait_clip_path" /> + <!-- Path will be tinted based on dual tone color --> <path android:name="frame" - android:fillColor="@color/batterymeter_frame_color" + android:fillColor="#000000" android:pathData="M19,2v19H5V2H19z" /> </vector>
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java index cfb8396..56ee5dc 100755 --- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java @@ -537,7 +537,9 @@ public class BatteryMeterView extends View implements DemoMode, @Override public void setDarkIntensity(int backgroundColor, int fillColor) { mIconTint = fillColor; - mBoltDrawable.setTint(fillColor); + // make bolt drawable tint fully opaque so it stands out + mBoltDrawable.setTint(0xff000000 | fillColor); + mFrameDrawable.setTint(backgroundColor); updateBoltDrawableLayer(mBatteryDrawable, mBoltDrawable); invalidate(); } @@ -660,7 +662,8 @@ public class BatteryMeterView extends View implements DemoMode, && (mShowPercent && !(level == 100 && !SHOW_100_PERCENT))) { // draw the percentage text String pctText = String.valueOf(SINGLE_DIGIT_PERCENT ? (level/10) : level); - mTextAndBoltPaint.setColor(getColorForLevel(level)); + // make paint color fully opaque so text stands out better + mTextAndBoltPaint.setColor(0xff000000 | getColorForLevel(level)); canvas.drawText(pctText, mTextX, mTextY, mTextAndBoltPaint); } else if (level <= mCriticalLevel) { // draw the warning text |