更新処理改善

This commit is contained in:
ろむねこ 2024-01-26 15:32:47 +09:00
parent 21b198bc35
commit b0effa21a4
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -80,10 +80,17 @@ public class SettingTagManageFragment extends Fragment {
updateTagList();
}
/**
* タグリストを更新する
*/
private void updateTagList() {
lacertaLibrary.getTagList().thenAccept(documentTags -> {
int currentTagCount = this.adapter.getItemCount();
this.adapter.setDocumentTags(documentTags);
this.adapter.notifyDataSetChanged();
if (currentTagCount != this.adapter.getItemCount()) {
this.adapter.notifyItemRangeRemoved(0, currentTagCount);
this.adapter.notifyItemRangeInserted(0, this.adapter.getItemCount());
}
});
}