summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2018-06-08 00:26:48 -0700
committerSelim Cinek <cinek@google.com>2018-06-08 16:06:52 +0000
commit3ddda6dc4c184acef268127f1ea7b81cdc5c5ebc (patch)
treeb7622cc15112992152fd58ae3e229f0d35efabaa
parentd54c3a3036430043e6408a6d5de3a09885fdf474 (diff)
downloadbase-3ddda6dc4c184acef268127f1ea7b81cdc5c5ebc.tar.gz
Fixed a flickering of the icon when it goes into the shelf
We can adjust the Pivot such that the scaling doesn't happen irregularly and that the animation is smooth. Change-Id: Ib2e42a20430e1c10950a197a4c04e7c64c7dec67 Test: add notification, no flicker Fixes: 80270979
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 27cb077394b1..c0e7ac4810d9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -197,6 +197,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
mDarkAmount);
final int outerBounds = mStatusBarIconSize;
mIconScale = (float)imageBounds / (float)outerBounds;
+ updatePivot();
}
private void updateIconScaleForSystemIcons() {
@@ -859,6 +860,12 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
mLayoutRunnable.run();
mLayoutRunnable = null;
}
+ updatePivot();
+ }
+
+ private void updatePivot() {
+ setPivotX((1 - mIconScale) / 2.0f * getWidth());
+ setPivotY((getHeight() - mIconScale * getWidth()) / 2.0f);
}
public void executeOnLayout(Runnable runnable) {