Fixed an issue when launching notification groups

The clipping on the bottom wasn't calculated accurately

Change-Id: Iaf4aab575418ce8477503ae3079f9913f8b669f6
Fixes: 110093221
Test: launch group, observe normal animation
This commit is contained in:
Selim Cinek
2018-12-04 13:29:25 -08:00
parent b53030f983
commit c42db8df8b
2 changed files with 12 additions and 3 deletions

View File

@@ -299,6 +299,10 @@ public class ActivityLaunchAnimator {
return top;
}
public int getBottom() {
return bottom;
}
public int getWidth() {
return right - left;
}

View File

@@ -2001,7 +2001,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
float interpolation = Interpolators.FAST_OUT_SLOW_IN.getInterpolation(params.getProgress());
int startClipTopAmount = params.getStartClipTopAmount();
if (mNotificationParent != null) {
top -= mNotificationParent.getTranslationY();
float parentY = mNotificationParent.getTranslationY();
top -= parentY;
mNotificationParent.setTranslationZ(translationZ);
int parentStartClipTopAmount = params.getParentStartClipTopAmount();
if (startClipTopAmount != 0) {
@@ -2011,8 +2012,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
mNotificationParent.setClipTopAmount(clipTopAmount);
}
mNotificationParent.setExtraWidthForClipping(extraWidthForClipping);
mNotificationParent.setMinimumHeightForClipping(params.getHeight()
+ mNotificationParent.getActualHeight());
float clipBottom = Math.max(params.getBottom(),
parentY + mNotificationParent.getActualHeight()
- mNotificationParent.getClipBottomAmount());
float clipTop = Math.min(params.getTop(), parentY);
int minimumHeightForClipping = (int) (clipBottom - clipTop);
mNotificationParent.setMinimumHeightForClipping(minimumHeightForClipping);
} else if (startClipTopAmount != 0) {
int clipTopAmount = (int) MathUtils.lerp(startClipTopAmount, 0, interpolation);
setClipTopAmount(clipTopAmount);