diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java index 2ff43d002f3a7..85f556fa733cc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java @@ -54,7 +54,8 @@ public abstract class ExpandableOutlineView extends ExpandableView { R.id.bottom_roundess_animator_end_tag, R.id.bottom_roundess_animator_start_tag); private static final AnimationProperties ROUNDNESS_PROPERTIES = - new AnimationProperties().setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); + new AnimationProperties().setDuration( + StackStateAnimator.ANIMATION_DURATION_CORNER_RADIUS); private static final Path EMPTY_PATH = new Path(); private final Rect mOutlineRect = new Rect(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java index 73e080423d408..ba03d01b20b06 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java @@ -69,6 +69,7 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable { private float mContentTranslation; protected boolean mLastInSection; protected boolean mFirstInSection; + boolean mIsBeingSwiped; public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); @@ -173,6 +174,14 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable { return false; } + public void setIsBeingSwiped(boolean swiped) { + mIsBeingSwiped = swiped; + } + + public boolean isBeingSwiped() { + return mIsBeingSwiped; + } + public boolean isHeadsUpAnimatingAway() { return false; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManager.java index f9d7c1f056aeb..31600710057b0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationRoundnessManager.java @@ -67,7 +67,7 @@ public class NotificationRoundnessManager { } } - private boolean updateViewWithoutCallback(ExpandableView view, + boolean updateViewWithoutCallback(ExpandableView view, boolean animate) { float topRoundness = getRoundness(view, true /* top */); float bottomRoundness = getRoundness(view, false /* top */); @@ -107,7 +107,9 @@ public class NotificationRoundnessManager { } private float getRoundness(ExpandableView view, boolean top) { - if ((view.isPinned() || view.isHeadsUpAnimatingAway()) && !mExpanded) { + if ((view.isPinned() + || view.isBeingSwiped() + || (view.isHeadsUpAnimatingAway()) && !mExpanded)) { return 1.0f; } if (isFirstInSection(view, true /* include first section */) && top) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 5f696a0358c21..0dc824f04e748 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -4967,7 +4967,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mSwipedOutViews.add(v); } - void onSwipeBegin() { + void onSwipeBegin(View v) { + if (v instanceof ExpandableView) { + ExpandableView ev = (ExpandableView) v; + ev.setIsBeingSwiped(true); + mController.getNoticationRoundessManager() + .updateViewWithoutCallback(ev, true /* animate */); + } requestDisallowInterceptTouchEvent(true); updateFirstAndLastBackgroundViews(); updateContinuousShadowDrawing(); @@ -4975,7 +4981,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable requestChildrenUpdate(); } - void onSwipeEnd() { + void onSwipeEnd(View v) { + if (v instanceof ExpandableView) { + ExpandableView ev = (ExpandableView) v; + ev.setIsBeingSwiped(false); + mController.getNoticationRoundessManager() + .updateViewWithoutCallback(ev, true /* animate */); + } updateFirstAndLastBackgroundViews(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index c2d030b132dbd..e332f18ce1832 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -395,7 +395,7 @@ public class NotificationStackScrollLayoutController { if (mView.getDismissAllInProgress()) { return; } - mView.onSwipeEnd(); + mView.onSwipeEnd(view); if (view instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) view; if (row.isHeadsUp()) { @@ -450,12 +450,12 @@ public class NotificationStackScrollLayoutController { @Override public void onBeginDrag(View v) { mFalsingCollector.onNotificationStartDismissing(); - mView.onSwipeBegin(); + mView.onSwipeBegin(v); } @Override public void onChildSnappedBack(View animView, float targetLeft) { - mView.onSwipeEnd(); + mView.onSwipeEnd(animView); if (animView instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) animView; if (row.isPinned() && !canChildBeDismissed(row) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java index d4add958ad1f0..66a48f16b6240 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackStateAnimator.java @@ -42,6 +42,7 @@ import java.util.Stack; public class StackStateAnimator { public static final int ANIMATION_DURATION_STANDARD = 360; + public static final int ANIMATION_DURATION_CORNER_RADIUS = 200; public static final int ANIMATION_DURATION_WAKEUP = 500; public static final int ANIMATION_DURATION_GO_TO_FULL_SHADE = 448; public static final int ANIMATION_DURATION_APPEAR_DISAPPEAR = 464;