Loading packages/SystemUI/src/com/android/systemui/SwipeHelper.java +13 −8 Original line number Diff line number Diff line Loading @@ -329,7 +329,7 @@ public class SwipeHelper implements Gefingerpoken { */ public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { dismissChild(view, velocity, null /* endAction */, 0 /* delay */, useAccelerateInterpolator, 0 /* fixedDuration */); useAccelerateInterpolator, 0 /* fixedDuration */, false /* isDismissAll */); } /** Loading @@ -341,17 +341,22 @@ public class SwipeHelper implements Gefingerpoken { * @param fixedDuration If not 0, this exact duration will be taken */ public void dismissChild(final View animView, float velocity, final Runnable endAction, long delay, boolean useAccelerateInterpolator, long fixedDuration) { long delay, boolean useAccelerateInterpolator, long fixedDuration, boolean isDismissAll) { final boolean canBeDismissed = mCallback.canChildBeDismissed(animView); float newPos; boolean isLayoutRtl = animView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; if (velocity < 0 || (velocity == 0 && getTranslation(animView) < 0) // if we use the Menu to dismiss an item in landscape, animate up || (velocity == 0 && getTranslation(animView) == 0 && mSwipeDirection == Y) boolean animateUpForMenu = velocity == 0 && (getTranslation(animView) == 0 || isDismissAll) && mSwipeDirection == Y; // if the language is rtl we prefer swiping to the left || (velocity == 0 && getTranslation(animView) == 0 && isLayoutRtl)) { boolean animateLeftForRtl = velocity == 0 && (getTranslation(animView) == 0 || isDismissAll) && isLayoutRtl; boolean animateLeft = velocity < 0 || (velocity == 0 && getTranslation(animView) < 0 && !isDismissAll); if (animateLeft || animateLeftForRtl || animateUpForMenu) { newPos = -getSize(animView); } else { newPos = getSize(animView); Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +5 −20 Original line number Diff line number Diff line Loading @@ -986,7 +986,8 @@ public class NotificationStackScrollLayout extends ViewGroup } public void dismissViewAnimated(View child, Runnable endRunnable, int delay, long duration) { mSwipeHelper.dismissChild(child, 0, endRunnable, delay, true, duration); mSwipeHelper.dismissChild(child, 0, endRunnable, delay, true, duration, true /* isDismissAll */); } public void snapViewIfNeeded(View child) { Loading Loading @@ -3194,9 +3195,6 @@ public class NotificationStackScrollLayout extends ViewGroup disableClipOptimization(); } handleDismissAllClipping(); if (mCurrIconRow != null && mCurrIconRow.isVisible()) { mCurrIconRow.getNotificationParent().animateTranslateNotification(0 /* left target */); } } private void handleDismissAllClipping() { Loading Loading @@ -3639,10 +3637,7 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public Animator getViewTranslationAnimator(View v, float target, AnimatorUpdateListener listener) { if (mDismissAllInProgress) { // When dismissing all, we translate the entire view instead. return super.getViewTranslationAnimator(v, target, listener); } else if (v instanceof ExpandableNotificationRow) { if (v instanceof ExpandableNotificationRow) { return ((ExpandableNotificationRow) v).getTranslateViewAnimator(target, listener); } else { return super.getViewTranslationAnimator(v, target, listener); Loading @@ -3651,23 +3646,13 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public void setTranslation(View v, float translate) { if (mDismissAllInProgress) { // When dismissing all, we translate the entire view instead. super.setTranslation(v, translate); } else { ((ExpandableView) v).setTranslation(translate); } } @Override public float getTranslation(View v) { if (mDismissAllInProgress) { // When dismissing all, we translate the entire view instead. return super.getTranslation(v); } else { return ((ExpandableView) v).getTranslation(); } } public void closeControlsIfOutsideTouch(MotionEvent ev) { NotificationGuts guts = mPhoneStatusBar.getExposedGuts(); Loading Loading
packages/SystemUI/src/com/android/systemui/SwipeHelper.java +13 −8 Original line number Diff line number Diff line Loading @@ -329,7 +329,7 @@ public class SwipeHelper implements Gefingerpoken { */ public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { dismissChild(view, velocity, null /* endAction */, 0 /* delay */, useAccelerateInterpolator, 0 /* fixedDuration */); useAccelerateInterpolator, 0 /* fixedDuration */, false /* isDismissAll */); } /** Loading @@ -341,17 +341,22 @@ public class SwipeHelper implements Gefingerpoken { * @param fixedDuration If not 0, this exact duration will be taken */ public void dismissChild(final View animView, float velocity, final Runnable endAction, long delay, boolean useAccelerateInterpolator, long fixedDuration) { long delay, boolean useAccelerateInterpolator, long fixedDuration, boolean isDismissAll) { final boolean canBeDismissed = mCallback.canChildBeDismissed(animView); float newPos; boolean isLayoutRtl = animView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; if (velocity < 0 || (velocity == 0 && getTranslation(animView) < 0) // if we use the Menu to dismiss an item in landscape, animate up || (velocity == 0 && getTranslation(animView) == 0 && mSwipeDirection == Y) boolean animateUpForMenu = velocity == 0 && (getTranslation(animView) == 0 || isDismissAll) && mSwipeDirection == Y; // if the language is rtl we prefer swiping to the left || (velocity == 0 && getTranslation(animView) == 0 && isLayoutRtl)) { boolean animateLeftForRtl = velocity == 0 && (getTranslation(animView) == 0 || isDismissAll) && isLayoutRtl; boolean animateLeft = velocity < 0 || (velocity == 0 && getTranslation(animView) < 0 && !isDismissAll); if (animateLeft || animateLeftForRtl || animateUpForMenu) { newPos = -getSize(animView); } else { newPos = getSize(animView); Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +5 −20 Original line number Diff line number Diff line Loading @@ -986,7 +986,8 @@ public class NotificationStackScrollLayout extends ViewGroup } public void dismissViewAnimated(View child, Runnable endRunnable, int delay, long duration) { mSwipeHelper.dismissChild(child, 0, endRunnable, delay, true, duration); mSwipeHelper.dismissChild(child, 0, endRunnable, delay, true, duration, true /* isDismissAll */); } public void snapViewIfNeeded(View child) { Loading Loading @@ -3194,9 +3195,6 @@ public class NotificationStackScrollLayout extends ViewGroup disableClipOptimization(); } handleDismissAllClipping(); if (mCurrIconRow != null && mCurrIconRow.isVisible()) { mCurrIconRow.getNotificationParent().animateTranslateNotification(0 /* left target */); } } private void handleDismissAllClipping() { Loading Loading @@ -3639,10 +3637,7 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public Animator getViewTranslationAnimator(View v, float target, AnimatorUpdateListener listener) { if (mDismissAllInProgress) { // When dismissing all, we translate the entire view instead. return super.getViewTranslationAnimator(v, target, listener); } else if (v instanceof ExpandableNotificationRow) { if (v instanceof ExpandableNotificationRow) { return ((ExpandableNotificationRow) v).getTranslateViewAnimator(target, listener); } else { return super.getViewTranslationAnimator(v, target, listener); Loading @@ -3651,23 +3646,13 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public void setTranslation(View v, float translate) { if (mDismissAllInProgress) { // When dismissing all, we translate the entire view instead. super.setTranslation(v, translate); } else { ((ExpandableView) v).setTranslation(translate); } } @Override public float getTranslation(View v) { if (mDismissAllInProgress) { // When dismissing all, we translate the entire view instead. return super.getTranslation(v); } else { return ((ExpandableView) v).getTranslation(); } } public void closeControlsIfOutsideTouch(MotionEvent ev) { NotificationGuts guts = mPhoneStatusBar.getExposedGuts(); Loading