summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyn Han <lynhan@google.com>2021-07-14 17:43:27 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-07-14 17:43:27 +0000
commit1da11b55e9974091fffc155d1fa4d6c5230466c2 (patch)
tree72b6465aeec31bd117d3ce3196d6cad21b8d455a
parent964a1e0f72725439da1a792308a5b2d050bc5292 (diff)
parent12de672d3d83daca18655ca9a9521e71078115b8 (diff)
downloadbase-1da11b55e9974091fffc155d1fa4d6c5230466c2.tar.gz
Merge "Set views below shelf explicitly invisible to skip hardware rendering" into sc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java21
1 files changed, 17 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 e65038b32bf0..f460a132d65c 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
@@ -148,8 +148,22 @@ public class StackScrollAlgorithm {
AmbientState ambientState) {
NotificationShelf shelf = ambientState.getShelf();
- if (shelf != null) {
- shelf.updateState(algorithmState, ambientState);
+ if (shelf == null) {
+ return;
+ }
+
+ shelf.updateState(algorithmState, ambientState);
+
+ // After the shelf has updated its yTranslation,
+ // explicitly hide views below the shelf to skip rendering them in the hardware layer.
+ final float shelfTop = shelf.getViewState().yTranslation;
+
+ for (ExpandableView view : algorithmState.visibleChildren) {
+ final float viewTop = view.getViewState().yTranslation;
+
+ if (viewTop >= shelfTop) {
+ view.getViewState().hidden = true;
+ }
}
}
@@ -411,8 +425,7 @@ public class StackScrollAlgorithm {
} else {
if (view != ambientState.getTrackedHeadsUpRow()) {
if (ambientState.isExpansionChanging()) {
- // Show all views. Views below the shelf will later be clipped (essentially
- // hidden) in NotificationShelf.
+ // We later update shelf state, then hide views below the shelf.
viewState.hidden = false;
viewState.inShelf = algorithmState.firstViewInShelf != null
&& i >= algorithmState.visibleChildren.indexOf(