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

Commit 51b1f6eb authored by lyn's avatar lyn
Browse files

[Bundles] Fix gap during header swipe to expand

Fixes: 439537914

Test: swipe down from bundle header
      => single notif renders fine
      => group notif renders fine

      swipe down on group header inside bundle
      => 2nd level children render fine (no regression)

Test: NotificationChildrenContainerTest

Flag: com.android.systemui.notification_bundle_ui

Change-Id: I9eca78e51f811c600f00e3d999a0327063626638
parent 63f40c42
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -99,6 +99,22 @@ public class NotificationChildrenContainerTest extends SysuiTestCase {
                NotificationChildrenContainer.NUMBER_OF_CHILDREN_WHEN_SYSTEM_EXPANDED);
    }

    @Test
    @EnableFlags(NotificationBundleUi.FLAG_NAME)
    public void testGetMaxAllowedVisibleChildren_bundle_userLocked() {
        ComposeView headerView = new ComposeView(mContext);
        mBundle.setBundleHeaderView(headerView);

        NotificationChildrenContainer childrenContainer = mBundle.getChildrenContainer();
        childrenContainer.setBundleHeaderViewModel(mock(BundleHeaderViewModel.class));
        mBundle.setUserLocked(true);

        Assert.assertEquals(
                "During swipe open, bundle should show the expanded number of children",
                NotificationChildrenContainer.NUMBER_OF_CHILDREN_BUNDLE_EXPANDED,
                childrenContainer.getMaxAllowedVisibleChildren());
    }

    @Test
    public void testGetMaxAllowedVisibleChildren_likeCollapsed() {
        Assert.assertEquals(mChildrenContainer.getMaxAllowedVisibleChildren(true),
+2 −1
Original line number Diff line number Diff line
@@ -1025,7 +1025,8 @@ public class NotificationChildrenContainer extends ViewGroup
    @VisibleForTesting
    int getMaxAllowedVisibleChildren(boolean likeCollapsed) {
        if (isBundle()) {
            if (mContainingNotification.isGroupExpanded()) {
            if (mContainingNotification.isGroupExpanded()
                    || mContainingNotification.isUserLocked()) {
                return getNumberOfChildrenWhenExpanded();
            } else {
                return getNumberOfChildrenWhenCollapsed();