Merge "Animate notification shade footer" into sc-dev

This commit is contained in:
Jay Aliomer
2021-06-15 18:36:44 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 4 deletions

View File

@@ -115,13 +115,18 @@ public class FooterView extends StackScrollerDecorView {
} }
public class FooterViewState extends ExpandableViewState { 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 @Override
public void applyToView(View view) { public void applyToView(View view) {
super.applyToView(view); super.applyToView(view);
if (view instanceof FooterView) { if (view instanceof FooterView) {
FooterView footerView = (FooterView) view; FooterView footerView = (FooterView) view;
boolean visible = this.clipTopAmount < mClearAllTopPadding; footerView.setContentVisible(!hideContent);
footerView.setContentVisible(visible && footerView.isVisible());
} }
} }
} }

View File

@@ -411,8 +411,8 @@ public class StackScrollAlgorithm {
final float footerEnd = algorithmState.mCurrentExpandedYPosition final float footerEnd = algorithmState.mCurrentExpandedYPosition
+ view.getIntrinsicHeight(); + view.getIntrinsicHeight();
final boolean noSpaceForFooter = footerEnd > ambientState.getStackEndHeight(); final boolean noSpaceForFooter = footerEnd > ambientState.getStackEndHeight();
((FooterView.FooterViewState) viewState).hideContent =
viewState.hidden = shadeClosed || isShelfShowing || noSpaceForFooter; shadeClosed || isShelfShowing || noSpaceForFooter;
} else if (view != ambientState.getTrackedHeadsUpRow()) { } else if (view != ambientState.getTrackedHeadsUpRow()) {
if (ambientState.isExpansionChanging()) { if (ambientState.isExpansionChanging()) {