Repository navigation
Fix crash when a profile drag ends during layout - #190
Open
DaniilBorovskiy1809 wants to merge 1 commit into
Open
DaniilBorovskiy1809 wants to merge 1 commit into
DaniilBorovskiy1809 wants to merge 1 commit into
Conversation
ItemTouchHelper can call clearView() from RecyclerView.dispatchLayout() when the dragged row is detached. endDrag() then finishes the selection started by the long press and notifies the rows, which RecyclerView forbids while it is laying out. Post endDrag() so the selection finishes after the layout.
DaniilBorovskiy1809
force-pushed
the
fix/drag-end-during-layout
branch
from
December 5, 2026 17:48
764e64b to
5624143
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The app can crash when a profile drag ends while the list is laying out:
ItemTouchHelpercan callclearView()fromRecyclerView.dispatchLayout()when the dragged row is detached.adapter.endDrag()then finishes the selection started by the drag's long press and callsnotifyItemRangeChanged(), which RecyclerView does not allow while computing a layout.Fix
Post
endDrag()to the list so the selection is finished after the current layout pass. This matches the existingclearView()handling inDnsServerListDialog.The stack trace was reproduced on 2.0.7; the same code path is still present on
main.