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

Commit d2705871 authored by Omar Miatello's avatar Omar Miatello Committed by Automerger Merge Worker
Browse files

Merge "NotificationChildrenContainer apply the roundness on...

Merge "NotificationChildrenContainer apply the roundness on NotificationHeaderViewWrapper too" into tm-qpr-dev am: ac576e7e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20911787



Change-Id: If07afb58e0b571bdeabeb11db67f6a332e56d5d8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7f4e56e0 ac576e7e
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1431,6 +1431,22 @@ public class NotificationChildrenContainer extends ViewGroup
    @Override
    public void applyRoundnessAndInvalidate() {
        boolean last = true;
        if (mUseRoundnessSourceTypes) {
            if (mNotificationHeaderWrapper != null) {
                mNotificationHeaderWrapper.requestTopRoundness(
                        /* value = */ getTopRoundness(),
                        /* sourceType = */ FROM_PARENT,
                        /* animate = */ false
                );
            }
            if (mNotificationHeaderWrapperLowPriority != null) {
                mNotificationHeaderWrapperLowPriority.requestTopRoundness(
                        /* value = */ getTopRoundness(),
                        /* sourceType = */ FROM_PARENT,
                        /* animate = */ false
                );
            }
        }
        for (int i = mAttachedChildren.size() - 1; i >= 0; i--) {
            ExpandableNotificationRow child = mAttachedChildren.get(i);
            if (child.getVisibility() == View.GONE) {
+26 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.systemui.statusbar.notification.LegacySourceType;
import com.android.systemui.statusbar.notification.SourceType;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.NotificationTestHelper;
import com.android.systemui.statusbar.notification.row.wrapper.NotificationHeaderViewWrapper;

import org.junit.Assert;
import org.junit.Before;
@@ -216,4 +217,29 @@ public class NotificationChildrenContainerTest extends SysuiTestCase {
        Assert.assertEquals(1f, mChildrenContainer.getBottomRoundness(), 0.001f);
        Assert.assertEquals(1f, notificationRow.getBottomRoundness(), 0.001f);
    }

    @Test
    public void applyRoundnessAndInvalidate_should_be_immediately_applied_on_header() {
        mChildrenContainer.useRoundnessSourceTypes(true);

        NotificationHeaderViewWrapper header = mChildrenContainer.getNotificationHeaderWrapper();
        Assert.assertEquals(0f, header.getTopRoundness(), 0.001f);

        mChildrenContainer.requestTopRoundness(1f, SourceType.from(""), false);

        Assert.assertEquals(1f, header.getTopRoundness(), 0.001f);
    }

    @Test
    public void applyRoundnessAndInvalidate_should_be_immediately_applied_on_headerLowPriority() {
        mChildrenContainer.useRoundnessSourceTypes(true);
        mChildrenContainer.setIsLowPriority(true);

        NotificationHeaderViewWrapper header = mChildrenContainer.getNotificationHeaderWrapper();
        Assert.assertEquals(0f, header.getTopRoundness(), 0.001f);

        mChildrenContainer.requestTopRoundness(1f, SourceType.from(""), false);

        Assert.assertEquals(1f, header.getTopRoundness(), 0.001f);
    }
}