Skip to content

Commit

Permalink
Battery bolt inside the icon: fix visibility when charging
Browse files Browse the repository at this point in the history
- percentage hidden in the icon: show bolt
- percentage inside the icon and force pct outside when charging: show bolt
- percentage inside the icon and no force pct outside when charging: hide bolt
- percentage always outside the icon: show bolt

Change-Id: I1c15c9fa398e2a2f26f8cf3d8c1db973108a0130
  • Loading branch information
ezio84 authored and xlxfoxxlx committed Jun 15, 2017
1 parent 09d3436 commit 7a696ef
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -768,7 +768,8 @@ private void drawBattery(Canvas canvas) {
// happened, we need to change the paint rather than the alpha in case the blendMode // happened, we need to change the paint rather than the alpha in case the blendMode
// has been set to clear. Clear always clears regardless of alpha level ;) // has been set to clear. Clear always clears regardless of alpha level ;)
final BitmapDrawable bd = (BitmapDrawable) d; final BitmapDrawable bd = (BitmapDrawable) d;
bd.getPaint().set(mPluggedIn && mForceChargeBatteryText ? mTextAndBoltPaint : mClearPaint); bd.getPaint().set(!mPluggedIn || (mPluggedIn && mShowPercent && !mForceChargeBatteryText)
? mClearPaint : mTextAndBoltPaint);
if (mBoltOverlay) { if (mBoltOverlay) {
mBoltDrawable.setTint(getBoltColor()); mBoltDrawable.setTint(getBoltColor());
} }
Expand Down

0 comments on commit 7a696ef

Please sign in to comment.