mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
非同期実行に変更
This commit is contained in:
parent
bf58f25cd5
commit
9a4d3a1310
|
@ -18,6 +18,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.CompletionException;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ public class LacertaApplyTagDialog extends DialogFragment {
|
||||||
private String negativeButtonText;
|
private String negativeButtonText;
|
||||||
private String documentId;
|
private String documentId;
|
||||||
private LacertaApplyTagDialogListener listener;
|
private LacertaApplyTagDialogListener listener;
|
||||||
|
private ArrayList<DocumentTag> registeredTags;
|
||||||
private ArrayList<DocumentTag> appliedTags;
|
private ArrayList<DocumentTag> appliedTags;
|
||||||
|
|
||||||
// Setter
|
// Setter
|
||||||
|
@ -152,9 +154,17 @@ public class LacertaApplyTagDialog extends DialogFragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAppliedTagList(String documentId) {
|
private CompletableFuture<Void> setAppliedTagList(String documentId) {
|
||||||
lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> {
|
return CompletableFuture.runAsync(() -> {
|
||||||
this.appliedTags = documentTags;
|
lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> {
|
||||||
|
this.appliedTags = documentTags;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setRegisteredTagList() {
|
||||||
|
lacertaLibrary.getTagList().thenAccept(documentTags -> {
|
||||||
|
this.registeredTags = documentTags;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user