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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user