From 2e356496df4b632531bc97e28bd07b6008845504 Mon Sep 17 00:00:00 2001 From: Jay Aliomer Date: Fri, 11 Jun 2021 12:54:09 -0400 Subject: [PATCH] Animate notification shade footer Fixes: 187958424 Test: visual Change-Id: I7adef54a713b856afce0c20b58850a239545881b --- .../systemui/statusbar/notification/row/FooterView.java | 9 +++++++-- .../notification/stack/StackScrollAlgorithm.java | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) 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 298d4f07a8df2..8e24890c88121 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 @@ -115,13 +115,18 @@ public class FooterView extends StackScrollerDecorView { } public class FooterViewState extends ExpandableViewState { + /** + * used to hide the content of the footer to animate. + * #hide is applied without animation, but #hideContent has animation. + */ + public boolean hideContent; + @Override public void applyToView(View view) { super.applyToView(view); if (view instanceof FooterView) { FooterView footerView = (FooterView) view; - boolean visible = this.clipTopAmount < mClearAllTopPadding; - footerView.setContentVisible(visible && footerView.isVisible()); + footerView.setContentVisible(!hideContent); } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index a02ebbfa3521e..e5fd103c239f1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -411,8 +411,8 @@ public class StackScrollAlgorithm { final float footerEnd = algorithmState.mCurrentExpandedYPosition + view.getIntrinsicHeight(); final boolean noSpaceForFooter = footerEnd > ambientState.getStackEndHeight(); - - viewState.hidden = shadeClosed || isShelfShowing || noSpaceForFooter; + ((FooterView.FooterViewState) viewState).hideContent = + shadeClosed || isShelfShowing || noSpaceForFooter; } else if (view != ambientState.getTrackedHeadsUpRow()) { if (ambientState.isExpansionChanging()) {