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

Commit a9d976f3 authored by Phil Weaver's avatar Phil Weaver
Browse files

Don't invalidate list data during layout.

When a FastScroller is enabled, we were invalidating the
list data during layout, which left the UI in a bad state.
Long-presses didn't work properly, and TalkBack touches
were impossible to perform.

Bug: 31160338

Test: Manually tested long pressing, and verified
that TalkBack now works with the TestActivity in ag/1567328.
Change-Id: Iecd2d597259748a3ecbf5573950e565a0e9faa42
(cherry picked from commit 2112742b)
parent a3c03ba7
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -2168,7 +2168,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        }
        }


        layoutChildren();
        layoutChildren();
        mInLayout = false;


        mOverscrollMax = (b - t) / OVERSCROLL_LIMIT_DIVISOR;
        mOverscrollMax = (b - t) / OVERSCROLL_LIMIT_DIVISOR;


@@ -2176,6 +2175,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        if (mFastScroll != null) {
        if (mFastScroll != null) {
            mFastScroll.onItemCountChanged(getChildCount(), mItemCount);
            mFastScroll.onItemCountChanged(getChildCount(), mItemCount);
        }
        }
        mInLayout = false;
    }
    }


    /**
    /**
@@ -2705,6 +2705,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
     * fail to relayout them properly to accommodate for new bounds.
     * fail to relayout them properly to accommodate for new bounds.
     */
     */
    void handleBoundsChange() {
    void handleBoundsChange() {
        if (mInLayout) {
            return;
        }
        final int childCount = getChildCount();
        final int childCount = getChildCount();
        if (childCount > 0) {
        if (childCount > 0) {
            mDataChanged = true;
            mDataChanged = true;