Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +9 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Point; import android.util.AttributeSet; import android.util.IndentingPrintWriter; Loading Loading @@ -389,6 +390,14 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mBackgroundNormal.setTopOverlap(topOverlap); } @Override public boolean isBackgroundOpaque() { if (Color.alpha(mCurrentBackgroundTint) == 255) { return true; } return false; } @Override public long performRemoveAnimation(long duration, long delay, float translationDirection, boolean isHeadsUpAnimation, boolean isHeadsUpCycling, Runnable onStartedRunnable, Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +4 −0 Original line number Diff line number Diff line Loading @@ -528,6 +528,10 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable, Ro Runnable onFinishedRunnable, AnimatorListenerAdapter animationListener, ClipSide clipSide); public boolean isBackgroundOpaque() { return false; } public enum ClipSide { TOP, BOTTOM Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +3 −0 Original line number Diff line number Diff line Loading @@ -1551,6 +1551,9 @@ public class NotificationStackScrollLayout canClip = notifParent.isGroupExpanded() && !notifParent.isGroupExpansionChanging(); } if (row.isBackgroundOpaque()) { canClip = false; } // handle the notGoneIndex for the children as well List<ExpandableNotificationRow> children = row.getAttachedChildren(); if (row.isSummaryWithChildren() && children != null) { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +79 −36 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import android.view.ViewGroup; import android.view.WindowInsets; import android.view.WindowInsetsAnimation; import androidx.annotation.NonNull; import androidx.test.filters.SmallTest; import com.android.keyguard.BouncerPanelExpansionCalculator; Loading Loading @@ -1399,9 +1400,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapOnTop() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1428,9 +1429,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapOnTop_groupCollapsed() { ExpandableNotificationRow firstRow = mKosmos.createRowGroup(); ExpandableNotificationRow firstRow = createRowGroup(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading Loading @@ -1458,9 +1459,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapOnTop_groupExpanded() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = parent.getViewState(); Loading Loading @@ -1500,9 +1501,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapOnBottom_groupExpanded_Transient() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = parent.getViewState(); Loading Loading @@ -1547,10 +1548,10 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapOnBottom_whenTransient() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addTransientView(firstRow, 0); firstRow.setTransientContainer(mStackScroller); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading Loading @@ -1578,12 +1579,28 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { secondRow.getBottomOverlap() == 0); } @NonNull private ExpandableNotificationRow createRow() { ExpandableNotificationRow row = mKosmos.createRow(); row.setIsBlurSupported(true); return row; } @NonNull private ExpandableNotificationRow createRowGroup() { ExpandableNotificationRow rowGroup = mKosmos.createRowGroup(); rowGroup.setIsBlurSupported(true); List<ExpandableNotificationRow> children = rowGroup.getAttachedChildren(); children.forEach((it) -> it.setIsBlurSupported(true)); return rowGroup; } @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_baseline() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1608,9 +1625,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("First row wasn't returned as the first element", overlapList.get(0) == firstRow); !overlapList.isEmpty() && overlapList.get(0) == firstRow); assertTrue("Second row wasn't returned as the first element", overlapList.get(1) == secondRow); overlapList.size() >= 2 && overlapList.get(1) == secondRow); assertTrue("The first view should not be non-overlapping", !nonOverlapList.contains(firstRow)); assertTrue("The second view should not be non-overlapping", Loading @@ -1620,11 +1637,11 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_sorted() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableNotificationRow thirdRow = mKosmos.createRow(); ExpandableNotificationRow thirdRow = createRow(); mStackScroller.addContainerView(thirdRow); ExpandableViewState viewState = firstRow.getViewState(); Loading Loading @@ -1657,11 +1674,11 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("Third row wasn't returned as the first element", overlapList.get(0) == thirdRow); !overlapList.isEmpty() && overlapList.get(0) == thirdRow); assertTrue("Second row wasn't returned as the second element", overlapList.get(1) == secondRow); overlapList.size() > 1 &&overlapList.get(1) == secondRow); assertTrue("First row wasn't returned as the last element", overlapList.get(2) == firstRow); overlapList.size() > 2 &&overlapList.get(2) == firstRow); assertTrue("The first view should not be non-overlapping", !nonOverlapList.contains(firstRow)); assertTrue("The second view should not be non-overlapping", Loading @@ -1673,10 +1690,10 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_transient() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addTransientView(firstRow, 0); firstRow.setTransientContainer(mStackScroller); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1702,9 +1719,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("First row wasn't returned as the first element", overlapList.get(0) == firstRow); !overlapList.isEmpty() &&overlapList.get(0) == firstRow); assertTrue("Second row wasn't returned as the second element", overlapList.get(1) == secondRow); overlapList.size() > 1 &&overlapList.get(1) == secondRow); assertTrue("The first view should not be non-overlapping", !nonOverlapList.contains(firstRow)); assertTrue("The second view should not be non-overlapping", Loading @@ -1714,7 +1731,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_alpha() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1738,7 +1755,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_gone() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1760,10 +1777,36 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { assertTrue("There was an unexpected overlapping view", overlapList.isEmpty()); } @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_opaque() { ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); viewState.initFrom(firstRow); viewState.setYTranslation(0f); viewState.height = 100; viewState.notGoneIndex = 0; viewState.setAlpha(1); viewState.hidden = false; viewState.applyToView(firstRow); // make it opaque firstRow.setIsBlurSupported(false); ArrayList<ExpandableView> overlapList = new ArrayList<>(); ArrayList<ExpandableView> nonOverlapList = new ArrayList<>(); mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("A opaque view was returned as foverlapping", nonOverlapList.contains(firstRow)); assertTrue("There was an unexpected overlapping view", overlapList.isEmpty()); } @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_invisible() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1787,7 +1830,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_collapsed_group() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading @@ -1811,7 +1854,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() && overlapList.get(0) == parent); assertTrue("Children should only be added when expanded", !overlapList.contains(child)); assertTrue("Children of collapsed group wasn't added non-overlapping", nonOverlapList.contains(child)); Loading @@ -1821,7 +1864,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapListCreation_expanded_group() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading @@ -1847,7 +1890,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() &&overlapList.get(0) == parent); assertTrue("Children should be added when expanded", overlapList.contains(child)); assertTrue("Children of expanded group was added non-overlapping", !nonOverlapList.contains(child)); Loading @@ -1857,7 +1900,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapListCreation_expanded_group_alpha() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading @@ -1883,7 +1926,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() &&overlapList.get(0) == parent); assertTrue("Children only should be added when expanded and visible", !overlapList.contains(child)); assertTrue("Children of expanded group was added non-overlapping", Loading @@ -1894,7 +1937,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapListCreation_expanded_group_transient() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading Loading @@ -1923,7 +1966,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() && overlapList.get(0) == parent); assertTrue("Transient children should be added overlapping when expanded", overlapList.contains(child)); assertTrue("Transient child of expanded group was added non-overlapping", Loading @@ -1933,7 +1976,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT}) public void testOverlapWhenOutOfBounds() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +9 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Point; import android.util.AttributeSet; import android.util.IndentingPrintWriter; Loading Loading @@ -389,6 +390,14 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mBackgroundNormal.setTopOverlap(topOverlap); } @Override public boolean isBackgroundOpaque() { if (Color.alpha(mCurrentBackgroundTint) == 255) { return true; } return false; } @Override public long performRemoveAnimation(long duration, long delay, float translationDirection, boolean isHeadsUpAnimation, boolean isHeadsUpCycling, Runnable onStartedRunnable, Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +4 −0 Original line number Diff line number Diff line Loading @@ -528,6 +528,10 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable, Ro Runnable onFinishedRunnable, AnimatorListenerAdapter animationListener, ClipSide clipSide); public boolean isBackgroundOpaque() { return false; } public enum ClipSide { TOP, BOTTOM Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +3 −0 Original line number Diff line number Diff line Loading @@ -1551,6 +1551,9 @@ public class NotificationStackScrollLayout canClip = notifParent.isGroupExpanded() && !notifParent.isGroupExpansionChanging(); } if (row.isBackgroundOpaque()) { canClip = false; } // handle the notGoneIndex for the children as well List<ExpandableNotificationRow> children = row.getAttachedChildren(); if (row.isSummaryWithChildren() && children != null) { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +79 −36 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import android.view.ViewGroup; import android.view.WindowInsets; import android.view.WindowInsetsAnimation; import androidx.annotation.NonNull; import androidx.test.filters.SmallTest; import com.android.keyguard.BouncerPanelExpansionCalculator; Loading Loading @@ -1399,9 +1400,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapOnTop() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1428,9 +1429,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapOnTop_groupCollapsed() { ExpandableNotificationRow firstRow = mKosmos.createRowGroup(); ExpandableNotificationRow firstRow = createRowGroup(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading Loading @@ -1458,9 +1459,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapOnTop_groupExpanded() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = parent.getViewState(); Loading Loading @@ -1500,9 +1501,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapOnBottom_groupExpanded_Transient() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = parent.getViewState(); Loading Loading @@ -1547,10 +1548,10 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapOnBottom_whenTransient() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addTransientView(firstRow, 0); firstRow.setTransientContainer(mStackScroller); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading Loading @@ -1578,12 +1579,28 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { secondRow.getBottomOverlap() == 0); } @NonNull private ExpandableNotificationRow createRow() { ExpandableNotificationRow row = mKosmos.createRow(); row.setIsBlurSupported(true); return row; } @NonNull private ExpandableNotificationRow createRowGroup() { ExpandableNotificationRow rowGroup = mKosmos.createRowGroup(); rowGroup.setIsBlurSupported(true); List<ExpandableNotificationRow> children = rowGroup.getAttachedChildren(); children.forEach((it) -> it.setIsBlurSupported(true)); return rowGroup; } @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_baseline() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1608,9 +1625,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("First row wasn't returned as the first element", overlapList.get(0) == firstRow); !overlapList.isEmpty() && overlapList.get(0) == firstRow); assertTrue("Second row wasn't returned as the first element", overlapList.get(1) == secondRow); overlapList.size() >= 2 && overlapList.get(1) == secondRow); assertTrue("The first view should not be non-overlapping", !nonOverlapList.contains(firstRow)); assertTrue("The second view should not be non-overlapping", Loading @@ -1620,11 +1637,11 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_sorted() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableNotificationRow thirdRow = mKosmos.createRow(); ExpandableNotificationRow thirdRow = createRow(); mStackScroller.addContainerView(thirdRow); ExpandableViewState viewState = firstRow.getViewState(); Loading Loading @@ -1657,11 +1674,11 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("Third row wasn't returned as the first element", overlapList.get(0) == thirdRow); !overlapList.isEmpty() && overlapList.get(0) == thirdRow); assertTrue("Second row wasn't returned as the second element", overlapList.get(1) == secondRow); overlapList.size() > 1 &&overlapList.get(1) == secondRow); assertTrue("First row wasn't returned as the last element", overlapList.get(2) == firstRow); overlapList.size() > 2 &&overlapList.get(2) == firstRow); assertTrue("The first view should not be non-overlapping", !nonOverlapList.contains(firstRow)); assertTrue("The second view should not be non-overlapping", Loading @@ -1673,10 +1690,10 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_transient() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addTransientView(firstRow, 0); firstRow.setTransientContainer(mStackScroller); ExpandableNotificationRow secondRow = mKosmos.createRow(); ExpandableNotificationRow secondRow = createRow(); mStackScroller.addContainerView(secondRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1702,9 +1719,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("First row wasn't returned as the first element", overlapList.get(0) == firstRow); !overlapList.isEmpty() &&overlapList.get(0) == firstRow); assertTrue("Second row wasn't returned as the second element", overlapList.get(1) == secondRow); overlapList.size() > 1 &&overlapList.get(1) == secondRow); assertTrue("The first view should not be non-overlapping", !nonOverlapList.contains(firstRow)); assertTrue("The second view should not be non-overlapping", Loading @@ -1714,7 +1731,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_alpha() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1738,7 +1755,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_gone() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1760,10 +1777,36 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { assertTrue("There was an unexpected overlapping view", overlapList.isEmpty()); } @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_opaque() { ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); viewState.initFrom(firstRow); viewState.setYTranslation(0f); viewState.height = 100; viewState.notGoneIndex = 0; viewState.setAlpha(1); viewState.hidden = false; viewState.applyToView(firstRow); // make it opaque firstRow.setIsBlurSupported(false); ArrayList<ExpandableView> overlapList = new ArrayList<>(); ArrayList<ExpandableView> nonOverlapList = new ArrayList<>(); mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("A opaque view was returned as foverlapping", nonOverlapList.contains(firstRow)); assertTrue("There was an unexpected overlapping view", overlapList.isEmpty()); } @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_invisible() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading @@ -1787,7 +1830,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags(com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT) public void testOverlapListCreation_collapsed_group() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading @@ -1811,7 +1854,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() && overlapList.get(0) == parent); assertTrue("Children should only be added when expanded", !overlapList.contains(child)); assertTrue("Children of collapsed group wasn't added non-overlapping", nonOverlapList.contains(child)); Loading @@ -1821,7 +1864,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapListCreation_expanded_group() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading @@ -1847,7 +1890,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() &&overlapList.get(0) == parent); assertTrue("Children should be added when expanded", overlapList.contains(child)); assertTrue("Children of expanded group was added non-overlapping", !nonOverlapList.contains(child)); Loading @@ -1857,7 +1900,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapListCreation_expanded_group_alpha() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading @@ -1883,7 +1926,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() &&overlapList.get(0) == parent); assertTrue("Children only should be added when expanded and visible", !overlapList.contains(child)); assertTrue("Children of expanded group was added non-overlapping", Loading @@ -1894,7 +1937,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT, com.android.systemui.Flags.FLAG_NOTIFICATION_BUNDLE_UI}) public void testOverlapListCreation_expanded_group_transient() { ExpandableNotificationRow parent = mKosmos.createRowGroup(); ExpandableNotificationRow parent = createRowGroup(); mStackScroller.addContainerView(parent); ExpandableViewState viewState = parent.getViewState(); Loading Loading @@ -1923,7 +1966,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.createSortedNotificationLists(overlapList, nonOverlapList); assertTrue("The parent wasn't added to the overlapping list", overlapList.get(0) == parent); !overlapList.isEmpty() && overlapList.get(0) == parent); assertTrue("Transient children should be added overlapping when expanded", overlapList.contains(child)); assertTrue("Transient child of expanded group was added non-overlapping", Loading @@ -1933,7 +1976,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT}) public void testOverlapWhenOutOfBounds() { ExpandableNotificationRow firstRow = mKosmos.createRow(); ExpandableNotificationRow firstRow = createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); Loading