diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index e54c38e61b..46880ac22c 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -67,7 +67,6 @@ public class AdapterFolder extends RecyclerView.Adapter prev = new ArrayList<>(); private List next = new ArrayList<>(); @@ -749,51 +741,6 @@ public class AdapterFolder extends RecyclerView.Adapter= items.size() || - to < 0 || to >= items.size()) - return; - - if (from < to) - for (int i = from; i < to; i++) - Collections.swap(items, i, i + 1); - else - for (int i = from; i > to; i--) - Collections.swap(items, i, i - 1); - notifyItemMoved(from, to); - - List order = new ArrayList<>(); - for (int i = 0; i < items.size(); i++) - order.add(items.get(i).id); - - Bundle args = new Bundle(); - args.putLongArray("order", Helper.toLongArray(order)); - - new SimpleTask() { - @Override - protected Void onExecute(Context context, Bundle args) { - final long[] order = args.getLongArray("order"); - - final DB db = DB.getInstance(context); - db.runInTransaction(new Runnable() { - @Override - public void run() { - for (int i = 0; i < order.length; i++) - db.folder().setFolderOrder(order[i], i); - } - }); - - return null; - } - - @Override - protected void onException(Bundle args, Throwable ex) { - Helper.unexpectedError(context, owner, ex); - - } - }.execute(context, owner, args, "folders:order"); - } - @Override @NonNull public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {