Open aloklearning opened 6 years ago
try changing onItemMove like this,
@Override
public boolean onItemMove (int fromPosition, int toPosition) {
File item = files.get(fromPosition);
files.remove(fromPosition);
files.add(toPosition, item);
notifyItemMoved(fromPosition, toPosition);
return true;
}
Since my drag and drop is working fine but still the item which has been moved is not updating its position. The code is like this :
public class EditVideoActivity extends AppCompatActivity implements OnStartDragListener{
and my RecyclerViewAdapter is here . :
In my logcat if I select the first one that is at pos = 0 then after dragging to pos = 1 and selecting the same again it will give the selected pos = 0 only.