Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-10-20 16:10:03 +02:00
commit 4f9be475cc

View file

@ -88,7 +88,12 @@ public class MapMarkersItemTouchHelperCallback extends ItemTouchHelper.Callback
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) {
return adapter.onItemMove(source.getAdapterPosition(), target.getAdapterPosition());
int from = source.getAdapterPosition();
int to = target.getAdapterPosition();
if (from == RecyclerView.NO_POSITION || to == RecyclerView.NO_POSITION) {
return false;
}
return adapter.onItemMove(from, to);
}
@Override