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

Commit 2321e2a3 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Merge "Fix problem with ListView accessibility focus" into oc-dev

am: 36bceefa

Change-Id: I868f3d17778d00a2a45cb95694e45fcf857942e4
parents 4c51b447 36bceefa
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -6873,9 +6873,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                    mTransientStateViews.put(position, scrap);
                } else {
                    // Otherwise, we'll have to remove the view and start over.
                    clearScrapForRebind(scrap);
                    getSkippedScrap().add(scrap);
                }
            } else {
                clearScrapForRebind(scrap);
                if (mViewTypeCount == 1) {
                    mCurrentScrap.add(scrap);
                } else {
@@ -7098,12 +7100,12 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                        }
                    } else if (params.scrappedFromPosition == position) {
                        final View scrap = scrapViews.remove(i);
                        clearAccessibilityFromScrap(scrap);
                        clearScrapForRebind(scrap);
                        return scrap;
                    }
                }
                final View scrap = scrapViews.remove(size - 1);
                clearAccessibilityFromScrap(scrap);
                clearScrapForRebind(scrap);
                return scrap;
            } else {
                return null;
@@ -7117,7 +7119,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            }
        }

        private void clearAccessibilityFromScrap(View view) {
        private void clearScrapForRebind(View view) {
            view.clearAccessibilityFocus();
            view.setAccessibilityDelegate(null);
        }
+1 −1
Original line number Diff line number Diff line
@@ -1639,7 +1639,7 @@ public class ListView extends AbsListView {
                    final View focusChild = getAccessibilityFocusedChild(focusHost);
                    if (focusChild != null) {
                        if (!dataChanged || isDirectChildHeaderOrFooter(focusChild)
                                || focusChild.hasTransientState() || mAdapterHasStableIds) {
                                || (focusChild.hasTransientState() && mAdapterHasStableIds)) {
                            // The views won't be changing, so try to maintain
                            // focus on the current host and virtual view.
                            accessibilityFocusLayoutRestoreView = focusHost;