From 896366a62503c12164d9e25c88456bab5a4122d7 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Fri, 6 Nov 2015 00:43:19 +0100 Subject: [PATCH] Fix dragging --- .../java/de/danoeh/antennapod/fragment/QueueFragment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index 4031e7065..73bdb90df 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -173,7 +173,6 @@ public class QueueFragment extends Fragment { public void onEventMainThread(FeedItemEvent event) { Log.d(TAG, "onEvent(" + event + ")"); - IntList positions = new IntList(); for(int i=0, size = event.items.size(); i < size; i++) { FeedItem item = event.items.get(i); int pos = FeedItemUtil.indexOfItemWithId(queue, item.getId()); @@ -367,7 +366,9 @@ public class QueueFragment extends Fragment { int from = viewHolder.getAdapterPosition(); int to = target.getAdapterPosition(); Log.d(TAG, "move(" + from + ", " + to + ")"); - DBWriter.moveQueueItem(from, to, true); + Collections.swap(queue, from, to); + recyclerAdapter.notifyItemMoved(from, to); + DBWriter.moveQueueItem(from, to, false); return true; }