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

Commit c9f22934 authored by Adam Powell's avatar Adam Powell
Browse files

Preserve ResolverDrawerLayout fully collapsed state across relayout

Fix a bug where a relayout that grows the size of ResolverDrawerLayout
content would cause it to get stuck in a half-collapsed state. This
could also lead to janky touch interaction behavior in
onStopNestedScroll as it animates to the fully open/closed state after
clicking in a descendant list.

Bug 21202727

Change-Id: I5f0a8b19fc079c57fcf2be7c6fa7627b1cb12a3c
parent ebb1d76e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -661,13 +661,20 @@ public class ResolverDrawerLayout extends ViewGroup {
            }
        }

        final int oldCollapsibleHeight = mCollapsibleHeight;
        mCollapsibleHeight = Math.max(0,
                heightUsed - alwaysShowHeight - getMaxCollapsedHeight());
        mUncollapsibleHeight = heightUsed - mCollapsibleHeight;

        if (isLaidOut()) {
            final boolean isCollapsedOld = mCollapseOffset != 0;
            if (oldCollapsibleHeight < mCollapsibleHeight
                    && mCollapseOffset == oldCollapsibleHeight) {
                // Stay closed even at the new height.
                mCollapseOffset = mCollapsibleHeight;
            } else {
                mCollapseOffset = Math.min(mCollapseOffset, mCollapsibleHeight);
            }
            final boolean isCollapsedNew = mCollapseOffset != 0;
            if (isCollapsedOld != isCollapsedNew) {
                notifyViewAccessibilityStateChangedIfNeeded(