AOD: Scale icon padding with the drawing size

Fixes an issue where the icon placement algorithm would not take into
account the drawingScale of the icon.

Change-Id: Ia6b7e7d32ce584b04035b45d2abc61e0e4590ee8
Test: Trigger AOD1, observe that icons are correctly spaced, also test transition to lockscreen and observe there's no jank
Fixes: 62205097
This commit is contained in:
Adrian Roos
2017-05-30 20:25:52 -07:00
parent a239ed1c79
commit ceac4a0543
2 changed files with 8 additions and 1 deletions

View File

@@ -179,6 +179,10 @@ public class StatusBarIconView extends AnimatedImageView {
mIconScale = (float)imageBounds / (float)outerBounds;
}
public float getIconScaleFullyDark() {
return (float) mStatusBarIconDrawingSizeDark / mStatusBarIconDrawingSize;
}
public float getIconScale() {
return mIconScale;
}

View File

@@ -267,6 +267,9 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
boolean forceOverflow = mSpeedBumpIndex != -1 && i >= mSpeedBumpIndex
&& iconState.iconAppearAmount > 0.0f || i >= maxVisibleIcons;
boolean noOverflowAfter = i == childCount - 1;
float drawingScale = mDark && view instanceof StatusBarIconView
? ((StatusBarIconView) view).getIconScaleFullyDark()
: 1f;
if (mOpenedAmount != 0.0f) {
noOverflowAfter = noOverflowAfter && !hasAmbient && !forceOverflow;
}
@@ -303,7 +306,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
visualOverflowStart += mVisualOverflowAdaption * (1f - mOpenedAmount);
}
}
translationX += iconState.iconAppearAmount * view.getWidth();
translationX += iconState.iconAppearAmount * view.getWidth() * drawingScale;
}
if (firstOverflowIndex != -1) {
int numDots = 1;