This commit is contained in:
ろむねこ 2024-01-25 14:36:34 +09:00
parent e51ce209dc
commit 58f9d81555
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -83,9 +83,15 @@ public class LacertaSelectDirDialog extends DialogFragment {
lacertaLibrary.getFolderList(targetDirId).thenAccept(libraryItemPage -> {
getActivity().runOnUiThread(() -> {
int currentCount = adapter.getItemCount();
adapter.notifyItemRangeRemoved(1, currentCount); // Backボタンを除くすべてのアイテムを削除
adapter.setListItems(libraryItemPage);
adapter.notifyItemRangeInserted(1, libraryItemPage.getListItems().size());
if (targetDirId == null) { // When root folder
adapter.setListItems(libraryItemPage);
adapter.notifyItemRangeRemoved(0, currentCount);
adapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size());
} else { // When child folder
adapter.setListItems(libraryItemPage);
adapter.notifyItemRangeRemoved(1, currentCount);
adapter.notifyItemRangeInserted(1, libraryItemPage.getListItems().size());
}
});
});
}