Merge "Fixed a grey flash when swiping away the last notification" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d9a569ae58
@@ -1853,24 +1853,34 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
}
|
}
|
||||||
updateBackgroundBounds();
|
updateBackgroundBounds();
|
||||||
if (!mCurrentBounds.equals(mBackgroundBounds)) {
|
if (!mCurrentBounds.equals(mBackgroundBounds)) {
|
||||||
if (mAnimateNextBackgroundTop || mAnimateNextBackgroundBottom || areBoundsAnimating()) {
|
boolean animate = mAnimateNextBackgroundTop || mAnimateNextBackgroundBottom
|
||||||
|
|| areBoundsAnimating();
|
||||||
|
if (!isExpanded()) {
|
||||||
|
abortBackgroundAnimators();
|
||||||
|
animate = false;
|
||||||
|
}
|
||||||
|
if (animate) {
|
||||||
startBackgroundAnimation();
|
startBackgroundAnimation();
|
||||||
} else {
|
} else {
|
||||||
mCurrentBounds.set(mBackgroundBounds);
|
mCurrentBounds.set(mBackgroundBounds);
|
||||||
applyCurrentBackgroundBounds();
|
applyCurrentBackgroundBounds();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mBottomAnimator != null) {
|
abortBackgroundAnimators();
|
||||||
mBottomAnimator.cancel();
|
|
||||||
}
|
|
||||||
if (mTopAnimator != null) {
|
|
||||||
mTopAnimator.cancel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mAnimateNextBackgroundBottom = false;
|
mAnimateNextBackgroundBottom = false;
|
||||||
mAnimateNextBackgroundTop = false;
|
mAnimateNextBackgroundTop = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void abortBackgroundAnimators() {
|
||||||
|
if (mBottomAnimator != null) {
|
||||||
|
mBottomAnimator.cancel();
|
||||||
|
}
|
||||||
|
if (mTopAnimator != null) {
|
||||||
|
mTopAnimator.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private boolean areBoundsAnimating() {
|
private boolean areBoundsAnimating() {
|
||||||
return mBottomAnimator != null || mTopAnimator != null;
|
return mBottomAnimator != null || mTopAnimator != null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user