diff options
| author | 2021-04-30 18:07:48 -0500 | |
|---|---|---|
| committer | 2021-04-30 18:34:45 -0500 | |
| commit | 3b25cae9ffe5914939b13af7f9e3bd98f542ff14 (patch) | |
| tree | 04d236efdcef4005384950ea45db2709e6ef8cbe | |
| parent | f5cded5a11c05510aa1bdb248c8230ac6a4adaf6 (diff) | |
Hide footer in place instead of scrolling it offscreen
Bug: 186479647
Test: open shade with shelf,
scroll notifications all the way up to show footer,
then scroll down => footer hides in place
Change-Id: If95b6f8682cc1d8980d6e2b9edf769fb55aad336
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java | 12 |
1 files changed, 8 insertions, 4 deletions
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 27ee13ab4eaf..591d3c0a7a5f 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 @@ -399,10 +399,14 @@ public class StackScrollAlgorithm { } if (view instanceof FooterView) { - viewState.yTranslation = Math.min(viewState.yTranslation, - ambientState.getStackHeight()); - // Hide footer if shelf is showing - viewState.hidden = algorithmState.firstViewInShelf != null; + final boolean isShelfShowing = algorithmState.firstViewInShelf != null; + + final float footerEnd = viewState.yTranslation + view.getIntrinsicHeight(); + final boolean noSpaceForFooter = footerEnd > ambientState.getStackHeight(); + + viewState.hidden = isShelfShowing + || (!ambientState.isExpansionChanging() && noSpaceForFooter); + } else if (view != ambientState.getTrackedHeadsUpRow()) { if (ambientState.isExpansionChanging()) { // Show all views. Views below the shelf will later be clipped (essentially hidden) |