Unified executor model

This commit is contained in:
M66B
2022-12-13 10:52:39 +01:00
parent 101371854b
commit 6988d4c552
33 changed files with 147 additions and 297 deletions

View File

@@ -59,7 +59,6 @@ import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
public class AdapterContact extends RecyclerView.Adapter<AdapterContact.ViewHolder> {
private Fragment parentFragment;
@@ -80,9 +79,6 @@ public class AdapterContact extends RecyclerView.Adapter<AdapterContact.ViewHold
private NumberFormat NF = NumberFormat.getNumberInstance();
private static final ExecutorService executor =
Helper.getBackgroundExecutor(1, "contacts");
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private View view;
private ImageView ivType;
@@ -470,7 +466,7 @@ public class AdapterContact extends RecyclerView.Adapter<AdapterContact.ViewHold
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(parentFragment.getParentFragmentManager(), ex);
}
}.setExecutor(executor).execute(context, owner, new Bundle(), "contacts:filter");
}.serial().execute(context, owner, new Bundle(), "contacts:filter");
}
public void search(String query) {