Merge "Fix issue where the notification could snap to the menu while its invisible" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
043ae355e9
@@ -462,11 +462,20 @@ public class SwipeHelper implements Gefingerpoken {
|
||||
int duration = SNAP_ANIM_LEN;
|
||||
anim.setDuration(duration);
|
||||
anim.addListener(new AnimatorListenerAdapter() {
|
||||
boolean wasCancelled = false;
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
wasCancelled = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
mSnappingChild = false;
|
||||
updateSwipeProgressFromOffset(animView, canBeDismissed);
|
||||
mCallback.onChildSnappedBack(animView, targetLeft);
|
||||
if (!wasCancelled) {
|
||||
updateSwipeProgressFromOffset(animView, canBeDismissed);
|
||||
mCallback.onChildSnappedBack(animView, targetLeft);
|
||||
}
|
||||
}
|
||||
});
|
||||
prepareSnapBackAnimation(animView, anim);
|
||||
|
||||
@@ -317,6 +317,10 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl
|
||||
}
|
||||
|
||||
private void dismiss(View animView, float velocity) {
|
||||
if (mFadeAnimator != null) {
|
||||
mFadeAnimator.cancel();
|
||||
}
|
||||
mHandler.removeCallbacks(mCheckForDrag);
|
||||
mMenuSnappedTo = false;
|
||||
mDismissing = true;
|
||||
mSwipeHelper.dismiss(animView, velocity);
|
||||
|
||||
Reference in New Issue
Block a user