Merge "Fixed a flickering of the icon when it goes into the shelf" into pi-dev

This commit is contained in:
Selim Cinek
2018-06-08 22:50:12 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {