flexbox-layout icon indicating copy to clipboard operation
flexbox-layout copied to clipboard

Items disappear when using recyclerview with ItemTouchHelper for drag & drop using FlexboxLayoutManager

Open muzammilhussnain14 opened this issue 5 years ago • 4 comments

I am trying to implement item reordering by drag and drop in a RecyclerView using FlexboxLayoutManager . I attach ItemTouchHelper to my RecyclerView and than on function onItemMove I do following in my RecyclerView.AdapterImplementation

      override fun onMove(recyclerView: RecyclerView, fromVH: RecyclerView.ViewHolder, toVH: RecyclerView.ViewHolder){
        // swapping words in shuffled array
        Collections.swap(wordsShuffled, fromVH.adapterPosition, toVH.adapterPosition)
        // calling notify item moved to update UI
        notifyItemMoved(fromVH.adapterPosition, toVH.adapterPosition)
         //It messes up UI after notifyItemMoved some time few items disappear and sometime comeback in random order
    }

It messes up UI after notifyItemMoved some time few items disappear and sometime comeback in random order

muzammilhussnain14 avatar Sep 23 '18 14:09 muzammilhussnain14

Any news about this?

gregkorossy avatar Jan 23 '19 23:01 gregkorossy

FlexboxLayoutManager notifyItemMoved(startIndex, endIndex) Item disappears Any news about this?

zhaocheng19940105 avatar Mar 06 '19 13:03 zhaocheng19940105

There is no reply to this question?

zhaocheng19940105 avatar Mar 07 '19 04:03 zhaocheng19940105

@muzammilhussnain14 Do you have some solution for this bug?

navyifanr avatar Apr 16 '22 14:04 navyifanr