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

Commit 973d778b authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am f58462f0: am 0d5fe0dd: am 4c6b2900: Merge "Clear accessibility focus from...

am f58462f0: am 0d5fe0dd: am 4c6b2900: Merge "Clear accessibility focus from recycled views when needed" into klp-dev

* commit 'f58462f0':
  Clear accessibility focus from recycled views when needed
parents 28cf65a6 f58462f0
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -2254,6 +2254,13 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                }
            } else {
                isScrap[0] = true;

                // Clear any system-managed transient state so that we can
                // recycle this view and bind it to different data.
                if (child.isAccessibilityFocused()) {
                    child.clearAccessibilityFocus();
                }

                child.dispatchFinishTemporaryDetach();
            }
        } else {
@@ -5073,6 +5080,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                    count++;
                    int position = firstPosition + i;
                    if (position >= headerViewsCount && position < footerViewsStart) {
                        // The view will be rebound to new data, clear any
                        // system-managed transient state.
                        if (child.isAccessibilityFocused()) {
                            child.clearAccessibilityFocus();
                        }
                        mRecycler.addScrapView(child, position);
                    }
                }
@@ -5091,6 +5103,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                    count++;
                    int position = firstPosition + i;
                    if (position >= headerViewsCount && position < footerViewsStart) {
                        // The view will be rebound to new data, clear any
                        // system-managed transient state.
                        if (child.isAccessibilityFocused()) {
                            child.clearAccessibilityFocus();
                        }
                        mRecycler.addScrapView(child, position);
                    }
                }
@@ -6664,8 +6681,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te

            lp.scrappedFromPosition = position;

            // Don't scrap header or footer views, or views that should
            // otherwise not be recycled.
            // Remove but don't scrap header or footer views, or views that
            // should otherwise not be recycled.
            final int viewType = lp.viewType;
            if (!shouldRecycleViewType(viewType)) {
                return;
@@ -6704,6 +6721,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                    mScrapViews[viewType].add(scrap);
                }

                // Clear any system-managed transient state.
                if (scrap.isAccessibilityFocused()) {
                    scrap.clearAccessibilityFocus();
                }

                scrap.setAccessibilityDelegate(null);

                if (mRecyclerListener != null) {