Fixed the backgroundclipping with the clipbottom amount

The clipping was applied after the minimizing to the height,
but it should have been applied before.

Change-Id: I80140e91dd08505feb8fd2256fb6ff4c7e31a139
Test: Add group, expand it, observe correct clipping of the background on the bottom
Bug: 32437839
This commit is contained in:
Selim Cinek
2016-11-22 13:45:39 -08:00
parent b3dadccbc5
commit c519dcf1fb

View File

@@ -2106,7 +2106,7 @@ public class NotificationStackScrollLayout extends ViewGroup
finalTranslationY = (int) ViewState.getFinalTranslationY(lastView);
}
int finalHeight = ExpandableViewState.getFinalActualHeight(lastView);
int finalBottom = finalTranslationY + finalHeight;
int finalBottom = finalTranslationY + finalHeight - lastView.getClipBottomAmount();
finalBottom = Math.min(finalBottom, getHeight());
if (mAnimateNextBackgroundBottom
|| mBottomAnimator == null && mCurrentBounds.bottom == finalBottom
@@ -2114,10 +2114,10 @@ public class NotificationStackScrollLayout extends ViewGroup
// we're ending up at the same location as we are now, lets just skip the animation
bottom = finalBottom;
} else {
bottom = (int) (lastView.getTranslationY() + lastView.getActualHeight());
bottom = (int) (lastView.getTranslationY() + lastView.getActualHeight()
- lastView.getClipBottomAmount());
bottom = Math.min(bottom, getHeight());
}
bottom -= lastView.getClipBottomAmount();
} else {
top = mTopPadding;
bottom = top;