Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d57cbe1 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [15332942] into sc-release

Change-Id: I4d6f3739498a1427d18c26d17a0e69fb160e0ddf
parents 143febbf a91988bc
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -154,15 +154,21 @@ public class StackScrollAlgorithm {

        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.
        // After the shelf has updated its yTranslation, explicitly set alpha=0 for view below shelf
        // to skip rendering them in the hardware layer. We do not set them invisible because that
        // runs invalidate & onDraw when these views return onscreen, which is more expensive.
        final float shelfTop = shelf.getViewState().yTranslation;

        for (ExpandableView view : algorithmState.visibleChildren) {
            if (view instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) view;
                if (row.isHeadsUp() || row.isHeadsUpAnimatingAway()) {
                    continue;
                }
            }
            final float viewTop = view.getViewState().yTranslation;

            if (viewTop >= shelfTop) {
                view.getViewState().hidden = true;
                view.getViewState().alpha = 0;
            }
        }
    }