Merge "Fix the IllegalArgumentException from RecyclerView" am: 8f793f5e4f

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2216421

Change-Id: Iad4eab5a28611ea7e8473f34ebb8af9b00158a0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-09-14 04:28:19 +00:00
committed by Automerger Merge Worker

View File

@@ -148,11 +148,11 @@ public class HighlightablePreferenceGroupAdapter extends PreferenceGroupAdapter
}, DELAY_COLLAPSE_DURATION_MILLIS);
}
// Remove the animator as early as possible to avoid a RecyclerView crash.
recyclerView.setItemAnimator(null);
// Scroll to correct position after 600 milliseconds.
root.postDelayed(() -> {
mHighlightRequested = true;
// Remove the animator to avoid a RecyclerView crash.
recyclerView.setItemAnimator(null);
recyclerView.smoothScrollToPosition(position);
mHighlightPosition = position;
}, DELAY_HIGHLIGHT_DURATION_MILLIS);