mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
登録されているタグ一覧の取得を切り出し
This commit is contained in:
parent
9a4d3a1310
commit
f2f4c77016
|
@ -135,21 +135,20 @@ public class LacertaApplyTagDialog extends DialogFragment {
|
||||||
private CompletableFuture<ArrayList<DocumentTagApplyTagDialogExtendedModel>> getDocumentTagArrayList(String documentId) {
|
private CompletableFuture<ArrayList<DocumentTagApplyTagDialogExtendedModel>> getDocumentTagArrayList(String documentId) {
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList = new ArrayList<>();
|
ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList = new ArrayList<>();
|
||||||
lacertaLibrary.getTagList().thenAccept(documentTags -> {
|
setRegisteredTagList().thenAccept(Void -> {
|
||||||
setAppliedTagList(documentId);
|
setAppliedTagList(documentId).join();
|
||||||
for (int i = 0; i < documentTags.size(); i++) {
|
for (int i = 0; i < this.registeredTags.size(); i++) {
|
||||||
boolean isChecked = false;
|
boolean isChecked = false;
|
||||||
for (int j = 0; j < this.appliedTags.size(); j++) {
|
for (int j = 0; j < this.appliedTags.size(); j++) {
|
||||||
if (documentTags.get(i).getId().equals(this.appliedTags.get(j).getId())) {
|
if (this.registeredTags.get(i).getId().equals(this.appliedTags.get(j).getId())) {
|
||||||
isChecked = true;
|
isChecked = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel(
|
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel(
|
||||||
new DocumentTag(documentTags.get(i).getId(), documentTags.get(i).getName(), documentTags.get(i).getColor()), isChecked));
|
new DocumentTag(this.registeredTags.get(i).getId(), this.registeredTags.get(i).getName(), this.registeredTags.get(i).getColor()), isChecked));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return documentTagArrayList;
|
return documentTagArrayList;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -162,10 +161,12 @@ public class LacertaApplyTagDialog extends DialogFragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRegisteredTagList() {
|
private CompletableFuture<Void> setRegisteredTagList() {
|
||||||
|
return CompletableFuture.runAsync(() -> {
|
||||||
lacertaLibrary.getTagList().thenAccept(documentTags -> {
|
lacertaLibrary.getTagList().thenAccept(documentTags -> {
|
||||||
this.registeredTags = documentTags;
|
this.registeredTags = documentTags;
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user