diff --git a/app/src/main/java/io/nekohasekai/sagernet/ui/profiles/ProfileListFragment.kt b/app/src/main/java/io/nekohasekai/sagernet/ui/profiles/ProfileListFragment.kt index 1a234e243..ff14dfc7f 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/ui/profiles/ProfileListFragment.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/ui/profiles/ProfileListFragment.kt @@ -324,7 +324,9 @@ class ProfileListFragment : Fragment(R.layout.layout_profile_list) { override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { super.clearView(recyclerView, viewHolder) - adapter.endDrag() + // ItemTouchHelper may call this while the list is laying out the detached row. Finishing the + // drag's selection notifies the rows, which RecyclerView only allows after the layout. + recyclerView.post { adapter.endDrag() } } }).also { it.attachToRecyclerView(list) } }