summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2018-06-08 22:50:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-06-08 22:50:12 +0000
commit40e41a6299abf8befb9b9f5ff9861873e7208c74 (patch)
treeade8cc3aa1ef8e03dd843e2b24212439e86b4067
parentce30fd3904a132d35ff273972dd68fed5166f005 (diff)
parent3ddda6dc4c184acef268127f1ea7b81cdc5c5ebc (diff)
downloadbase-40e41a6299abf8befb9b9f5ff9861873e7208c74.tar.gz
Merge "Fixed a flickering of the icon when it goes into the shelf" into pi-dev
-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) {