summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-12-11 13:34:14 -0600
committerRoman Birg <roman@cyngn.com>2015-12-11 11:37:21 -0800
commit7a797c9c85e61685b8f0f9973a7e19d87c1c4bf6 (patch)
treea3f2a2d9b9826088acaa7ccf872d6a785a041000 /packages
parenta954e0df78c4a0ef074047720b9f3b4e5c2c1799 (diff)
downloadframeworks_base-7a797c9c85e61685b8f0f9973a7e19d87c1c4bf6.zip
frameworks_base-7a797c9c85e61685b8f0f9973a7e19d87c1c4bf6.tar.gz
frameworks_base-7a797c9c85e61685b8f0f9973a7e19d87c1c4bf6.tar.bz2
SystemUI: finish circle battery animation after unplugging
Change-Id: I4a06323429625af7eaba334a3e799190f94a0555 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages')
-rwxr-xr-xpackages/SystemUI/src/com/android/systemui/BatteryMeterView.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
index 41d4aae..244b7f7 100755
--- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
+++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
@@ -928,22 +928,24 @@ public class BatteryMeterView extends View implements DemoMode,
if (!tracker.shouldIndicateCharging()
|| tracker.status == BatteryManager.BATTERY_STATUS_FULL
|| tracker.level == 0) {
- if (mIsAnimating) {
- mIsAnimating = false;
- mAnimOffset = 0;
- }
- return;
+ mIsAnimating = false;
+ } else {
+ mIsAnimating = true;
}
- mIsAnimating = true;
-
if (mAnimOffset > 360) {
mAnimOffset = 0;
- } else {
+ }
+
+ boolean continueAnimation = mIsAnimating || mAnimOffset != 0;
+
+ if (continueAnimation) {
mAnimOffset += 3;
}
- postInvalidateDelayed(50);
+ if (continueAnimation) {
+ postInvalidateDelayed(50);
+ }
}
/**