From f3db8f654f30afd75ca327cb48a5c6cfa4ed49b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Kurucz?= Date: Tue, 27 Jun 2023 09:42:18 +0000 Subject: [PATCH] Remove unused param from ExpandableView#performRemoveAnimation The HUN disappear animation used to have transition to move the Notification background to the place of its icon. This animation doesn't exist anymore, and we can remove this unused param. Bug: b/243302608 Test: post a HUN and observe the remove animation Change-Id: Ia48a8d7593ecf00eb067bace051b5c26246dd179 --- .../row/ActivatableNotificationView.java | 6 ++--- .../row/ExpandableNotificationRow.java | 5 ++--- .../notification/row/ExpandableView.java | 3 +-- .../row/StackScrollerDecorView.java | 2 +- .../notification/stack/MediaContainerView.kt | 13 ++++++----- .../stack/StackStateAnimator.java | 22 ++----------------- 6 files changed, 17 insertions(+), 34 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java index 8af488ea443d5..27510d47b5ab5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java @@ -359,9 +359,9 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } @Override - public long performRemoveAnimation(long duration, long delay, - float translationDirection, boolean isHeadsUpAnimation, float endLocation, - Runnable onFinishedRunnable, AnimatorListenerAdapter animationListener) { + public long performRemoveAnimation(long duration, long delay, float translationDirection, + boolean isHeadsUpAnimation, Runnable onFinishedRunnable, + AnimatorListenerAdapter animationListener) { enableAppearDrawing(true); mIsHeadsUpAnimation = isHeadsUpAnimation; if (mDrawingAppearAnimation) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 30747db0fb645..b34c28163abbb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -2975,7 +2975,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView long delay, float translationDirection, boolean isHeadsUpAnimation, - float endLocation, Runnable onFinishedRunnable, AnimatorListenerAdapter animationListener) { if (mMenuRow != null && mMenuRow.isMenuVisible()) { @@ -2986,7 +2985,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView public void onAnimationEnd(Animator animation) { ExpandableNotificationRow.super.performRemoveAnimation( duration, delay, translationDirection, isHeadsUpAnimation, - endLocation, onFinishedRunnable, animationListener); + onFinishedRunnable, animationListener); } }); anim.start(); @@ -2994,7 +2993,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } } return super.performRemoveAnimation(duration, delay, translationDirection, - isHeadsUpAnimation, endLocation, onFinishedRunnable, animationListener); + isHeadsUpAnimation, onFinishedRunnable, animationListener); } @Override 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 f0e15c27b7a7b..f98624409e56c 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 @@ -367,7 +367,6 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable, Ro * such that the child appears to be going away to the top. 1 * Should mean the opposite. * @param isHeadsUpAnimation Is this a headsUp animation. - * @param endLocation The location where the horizonal heads up disappear animation should end. * @param onFinishedRunnable A runnable which should be run when the animation is finished. * @param animationListener An animation listener to add to the animation. * @@ -375,7 +374,7 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable, Ro * animation starts. */ public abstract long performRemoveAnimation(long duration, - long delay, float translationDirection, boolean isHeadsUpAnimation, float endLocation, + long delay, float translationDirection, boolean isHeadsUpAnimation, Runnable onFinishedRunnable, AnimatorListenerAdapter animationListener); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java index b24cec150941e..0c686be0406df 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/StackScrollerDecorView.java @@ -235,7 +235,7 @@ public abstract class StackScrollerDecorView extends ExpandableView { @Override public long performRemoveAnimation(long duration, long delay, - float translationDirection, boolean isHeadsUpAnimation, float endLocation, + float translationDirection, boolean isHeadsUpAnimation, Runnable onFinishedRunnable, AnimatorListenerAdapter animationListener) { // TODO: Use duration diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MediaContainerView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MediaContainerView.kt index b8f28b5a60ea6..04308b47abc94 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MediaContainerView.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/MediaContainerView.kt @@ -69,11 +69,14 @@ class MediaContainerView(context: Context, attrs: AttributeSet?) : ExpandableVie canvas.clipPath(clipPath) } - - override fun performRemoveAnimation(duration: Long, delay: Long, translationDirection: Float, - isHeadsUpAnimation: Boolean, endLocation: Float, - onFinishedRunnable: Runnable?, - animationListener: AnimatorListenerAdapter?): Long { + override fun performRemoveAnimation( + duration: Long, + delay: Long, + translationDirection: Float, + isHeadsUpAnimation: Boolean, + onFinishedRunnable: Runnable?, + animationListener: AnimatorListenerAdapter? + ): Long { return 0 } 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 d73919b82c42a..2742a23d5fad6 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 @@ -27,8 +27,6 @@ import com.android.keyguard.KeyguardSliceView; import com.android.systemui.R; import com.android.systemui.shared.clocks.AnimatableClockView; import com.android.systemui.statusbar.NotificationShelf; -import com.android.systemui.statusbar.StatusBarIconView; -import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.row.StackScrollerDecorView; @@ -427,7 +425,7 @@ public class StackStateAnimator { } changingView.performRemoveAnimation(ANIMATION_DURATION_APPEAR_DISAPPEAR, 0 /* delay */, translationDirection, false /* isHeadsUpAppear */, - 0, postAnimation, null); + postAnimation, null); } else if (event.animationType == NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT) { if (mHostLayout.isFullySwipedOut(changingView)) { @@ -474,28 +472,12 @@ public class StackStateAnimator { mTmpState.initFrom(changingView); endRunnable = changingView::removeFromTransientContainer; } - float targetLocation = 0; boolean needsAnimation = true; if (changingView instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) changingView; if (row.isDismissed()) { needsAnimation = false; } - - NotificationEntry entry = row.getEntry(); - StatusBarIconView icon = entry.getIcons().getStatusBarIcon(); - final StatusBarIconView centeredIcon = entry.getIcons().getCenteredIcon(); - if (centeredIcon != null && centeredIcon.getParent() != null) { - icon = centeredIcon; - } - if (icon.getParent() != null) { - icon.getLocationOnScreen(mTmpLocation); - float iconPosition = mTmpLocation[0] - icon.getTranslationX() - + ViewState.getFinalTranslationX(icon) - + icon.getWidth() * 0.25f; - mHostLayout.getLocationOnScreen(mTmpLocation); - targetLocation = iconPosition - mTmpLocation[0]; - } } if (needsAnimation) { @@ -515,7 +497,7 @@ public class StackStateAnimator { } long removeAnimationDelay = changingView.performRemoveAnimation( ANIMATION_DURATION_HEADS_UP_DISAPPEAR, - 0, 0.0f, true /* isHeadsUpAppear */, targetLocation, + 0, 0.0f, true /* isHeadsUpAppear */, postAnimation, getGlobalAnimationFinishedListener()); mAnimationProperties.delay += removeAnimationDelay; } else if (endRunnable != null) {