Is there a way to revert a swipe action and restore the view holder to its initial position after the swipe is completed and onSwiped is called
With the latest anndroidX packages I still have this issue, so I needed to adjust @jimmy0251 solution a bit to reset the item correctly (his solution would only work for the first swipe).
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
clipAdapter.notifyItemChanged(viewHolder.adapterPosition)
itemTouchHelper.startSwipe(viewHolder)
}
Note that startSwipe() resets the item's recovery animations correctly.