diff options
5 files changed, 33 insertions, 16 deletions
diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt index da78a7c24d0f..0c3c3cc0e04b 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt @@ -31,14 +31,16 @@ class ActivityLaunchAnimator(context: Context) { companion object { const val ANIMATION_DURATION = 500L const val ANIMATION_DURATION_FADE_OUT_CONTENT = 183L - const val ANIMATION_DURATION_FADE_IN_WINDOW = 216L - const val ANIMATION_DELAY_FADE_IN_WINDOW = 166L + const val ANIMATION_DURATION_FADE_IN_WINDOW = 217L + const val ANIMATION_DELAY_FADE_IN_WINDOW = 167L private const val ANIMATION_DURATION_NAV_FADE_IN = 266L private const val ANIMATION_DURATION_NAV_FADE_OUT = 133L private const val ANIMATION_DELAY_NAV_FADE_IN = ANIMATION_DURATION - ANIMATION_DURATION_NAV_FADE_IN private const val LAUNCH_TIMEOUT = 1000L + private val CONTENT_FADE_OUT_INTERPOLATOR = PathInterpolator(0f, 0f, 0.2f, 1f) + private val WINDOW_FADE_IN_INTERPOLATOR = PathInterpolator(0f, 0f, 0.6f, 1f) private val NAV_FADE_IN_INTERPOLATOR = PathInterpolator(0f, 0f, 0f, 1f) private val NAV_FADE_OUT_INTERPOLATOR = PathInterpolator(0.2f, 0f, 1f, 1f) @@ -416,12 +418,12 @@ class ActivityLaunchAnimator(context: Context) { val contentAlphaProgress = getProgress(linearProgress, 0, ANIMATION_DURATION_FADE_OUT_CONTENT) state.contentAlpha = - 1 - Interpolators.ALPHA_OUT.getInterpolation(contentAlphaProgress) + 1 - CONTENT_FADE_OUT_INTERPOLATOR.getInterpolation(contentAlphaProgress) val backgroundAlphaProgress = getProgress(linearProgress, ANIMATION_DELAY_FADE_IN_WINDOW, ANIMATION_DURATION_FADE_IN_WINDOW) state.backgroundAlpha = - 1 - Interpolators.ALPHA_IN.getInterpolation(backgroundAlphaProgress) + 1 - WINDOW_FADE_IN_INTERPOLATOR.getInterpolation(backgroundAlphaProgress) applyStateToWindow(window, state) navigationBar?.let { applyStateToNavigationBar(it, state, linearProgress) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationActivityStarter.java index 5748c4aa0b13..2537b19513d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationActivityStarter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationActivityStarter.java @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.notification; import android.content.Intent; import android.service.notification.StatusBarNotification; +import android.view.View; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; @@ -33,7 +34,8 @@ public interface NotificationActivityStarter { void startNotificationGutsIntent(Intent intent, int appUid, ExpandableNotificationRow row); - void startHistoryIntent(boolean showHistory); + /** Called when the user clicks "Manage" or "History" in the Shade. */ + void startHistoryIntent(View view, boolean showHistory); default boolean isCollapsingToShowActivityOverLockscreen() { return false; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java index 4ed5056866f2..3bf0ddb1985b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java @@ -106,10 +106,6 @@ public class FooterView extends StackScrollerDecorView { showHistory(mShowHistory); } - public boolean isButtonVisible() { - return mManageButton.getAlpha() != 0.0f; - } - @Override public ExpandableViewState createExpandableViewState() { return new FooterViewState(); 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 fb72ac3c1411..f5fdd36c9a13 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 @@ -4849,7 +4849,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable clearNotifications(ROWS_ALL, true /* closeShade */); }); footerView.setManageButtonClickListener(v -> { - mNotificationActivityStarter.startHistoryIntent(mFooterView.isHistoryShown()); + mNotificationActivityStarter.startHistoryIntent(v, mFooterView.isHistoryShown()); }); setFooterView(footerView); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java index 3404528be447..4356b52d27ea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java @@ -39,6 +39,7 @@ import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.util.EventLog; +import android.view.View; import com.android.internal.logging.MetricsLogger; import com.android.internal.statusbar.NotificationVisibility; @@ -462,7 +463,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit mActivityStarter.dismissKeyguardThenExecute(() -> { AsyncTask.execute(() -> { ActivityLaunchAnimator.Controller animationController = null; - if (!mStatusBar.isOccluded() && mStatusBar.areLaunchAnimationsEnabled()) { + if (mStatusBar.areLaunchAnimationsEnabled()) { animationController = new StatusBarLaunchAnimatorController( mNotificationAnimationProvider.getAnimatorController(row), mStatusBar, true /* isActivityIntent */); @@ -495,7 +496,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit } @Override - public void startHistoryIntent(boolean showHistory) { + public void startHistoryIntent(View view, boolean showHistory) { mActivityStarter.dismissKeyguardThenExecute(() -> { AsyncTask.execute(() -> { Intent intent = showHistory ? new Intent( @@ -506,11 +507,27 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit if (showHistory) { tsb.addNextIntent(intent); } - tsb.startActivities(null, UserHandle.CURRENT); - // Putting it back on the main thread, since we're touching views - mMainThreadHandler.post(() -> mCommandQueue.animateCollapsePanels( - CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */)); + ActivityLaunchAnimator.Controller animationController = null; + if (mStatusBar.areLaunchAnimationsEnabled()) { + animationController = new StatusBarLaunchAnimatorController( + ActivityLaunchAnimator.Controller.fromView(view), mStatusBar, + true /* isActivityIntent */); + } + + mActivityLaunchAnimator.startIntentWithAnimation(animationController, + (adapter) -> tsb.startActivities( + getActivityOptions(mStatusBar.getDisplayId(), adapter), + UserHandle.CURRENT)); + + // Note that other cases when we should still collapse (like activity already on + // top) is handled by the StatusBarLaunchAnimatorController. + boolean shouldCollapse = animationController == null; + if (shouldCollapse) { + // Putting it back on the main thread, since we're touching views + mMainThreadHandler.post(() -> mCommandQueue.animateCollapsePanels( + CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */)); + } }); return true; }, null, false /* afterKeyguardGone */); |