非同期実行に変更

This commit is contained in:
r-ca 2024-01-29 00:38:03 +09:00
parent bf58f25cd5
commit 9a4d3a1310
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -18,6 +18,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import javax.inject.Inject;
@ -49,6 +50,7 @@ public class LacertaApplyTagDialog extends DialogFragment {
private String negativeButtonText;
private String documentId;
private LacertaApplyTagDialogListener listener;
private ArrayList<DocumentTag> registeredTags;
private ArrayList<DocumentTag> appliedTags;
// Setter
@ -152,10 +154,18 @@ public class LacertaApplyTagDialog extends DialogFragment {
});
}
private void setAppliedTagList(String documentId) {
private CompletableFuture<Void> setAppliedTagList(String documentId) {
return CompletableFuture.runAsync(() -> {
lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> {
this.appliedTags = documentTags;
});
});
}
private void setRegisteredTagList() {
lacertaLibrary.getTagList().thenAccept(documentTags -> {
this.registeredTags = documentTags;
});
}
}