Controlling the drag and drop events with ItemTouchHelper.SimpleCallback on my RecyclerView as follow:
@Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
int fromPosition = viewHolder.getAdapterPosition();
int toPosition = target.getAdapterPosition();
Collections.swap(adapter.getShelves(), fromPosition, toPosition);
adapter.notifyItemMoved(fromPosition, toPosition);
return true;
}
The item dragging with a long press. When the dragging item overflows the screen, the scrolling is starting to its direction by stages normally. The part of the holder for dragging is top of the item so there isn't any problem when dragging down but dragging up is very difficult for people because the fingers overflow the device. How to start dragging to up/down when don't just reached, or before certain margin to screen bounds?