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

Commit 08cf458c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Bundles] Fix gap during header swipe to expand" into main

parents 1cccb222 51b1f6eb
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();