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

Commit ad05586f authored by Adrian Roos's avatar Adrian Roos
Browse files

Notifications: Fix janky group expansion animation

Fixes an issue with the group expansion animation
by reverting a change introduced in I9dd91b85432e3d4309e0eb78a7b03ada87c3554e

Change-Id: Ia1e118a14ca2e420d0b0a23723676cf65d72f85b
Merged-In: Ia1e118a14ca2e420d0b0a23723676cf65d72f85b
Fixes: 38355658
Test: add notification group, test that clicking on the expansion icon shows a smooth animation
parent a239ed1c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -535,8 +535,8 @@ public class NotificationChildrenContainer extends ViewGroup {
            firstOverflowIndex = getMaxAllowedVisibleChildren(true /* likeCollapsed */);
        }

        boolean childrenExpanded = !mContainingNotification.isGroupExpansionChanging()
                && mChildrenExpanded;
        boolean childrenExpandedAndNotAnimating = mChildrenExpanded
                && !mContainingNotification.isGroupExpansionChanging();
        for (int i = 0; i < childCount; i++) {
            ExpandableNotificationRow child = mChildren.get(i);
            if (!firstChild) {
@@ -544,7 +544,7 @@ public class NotificationChildrenContainer extends ViewGroup {
                    yPosition += NotificationUtils.interpolate(mChildPadding, mDividerHeight,
                            expandFactor);
                } else {
                    yPosition += childrenExpanded ? mDividerHeight : mChildPadding;
                    yPosition += mChildrenExpanded ? mDividerHeight : mChildPadding;
                }
            } else {
                if (expandingToExpandedGroup) {
@@ -553,7 +553,7 @@ public class NotificationChildrenContainer extends ViewGroup {
                            mNotificatonTopPadding + mDividerHeight,
                            expandFactor);
                } else {
                    yPosition += childrenExpanded ? mNotificatonTopPadding + mDividerHeight : 0;
                    yPosition += mChildrenExpanded ? mNotificatonTopPadding + mDividerHeight : 0;
                }
                firstChild = false;
            }
@@ -565,7 +565,7 @@ public class NotificationChildrenContainer extends ViewGroup {
            childState.hidden = false;
            // When the group is expanded, the children cast the shadows rather than the parent
            // so use the parent's elevation here.
            childState.zTranslation = childrenExpanded
            childState.zTranslation = childrenExpandedAndNotAnimating
                    ? mContainingNotification.getTranslationZ()
                    : 0;
            childState.dimmed = parentState.dimmed;
@@ -619,7 +619,7 @@ public class NotificationChildrenContainer extends ViewGroup {
                mHeaderViewState = new ViewState();
            }
            mHeaderViewState.initFrom(mNotificationHeader);
            mHeaderViewState.zTranslation = childrenExpanded
            mHeaderViewState.zTranslation = childrenExpandedAndNotAnimating
                    ? mContainingNotification.getTranslationZ()
                    : 0;
        }