削除した後フリーズしないように(Workaround)

This commit is contained in:
ろむねこ 2024-01-29 12:59:56 +09:00
parent 9288360eb4
commit 2fcab4e931
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -320,7 +320,6 @@ public class LibraryPageFragment extends Fragment {
toolbar.setNavigationIcon(null); toolbar.setNavigationIcon(null);
} }
if (this.folderId == null) toolbar.getMenu().findItem(R.id.menu_item_delete_folder).setVisible(false); // ルートフォルダの場合は削除ボタンを非表示にする
toolbar.setTitle(title); toolbar.setTitle(title);
toolbar.getMenu().clear(); toolbar.getMenu().clear();
toolbar.inflateMenu(R.menu.dir_menu); toolbar.inflateMenu(R.menu.dir_menu);
@ -349,12 +348,23 @@ public class LibraryPageFragment extends Fragment {
return false; return false;
} }
}); });
if (this.folderId == null) toolbar.getMenu().findItem(R.id.menu_item_delete_folder).setVisible(false); // ルートフォルダの場合は削除ボタンを非表示にする
}); });
} }
private void deleteMe() { private void deleteMe() {
lacertaLibrary.deleteFolder(this.folderId).thenAccept(aVoid -> { lacertaLibrary.deleteFolder(this.folderId).thenAccept(aVoid -> {
Navigation.findNavController(requireView()).popBackStack(); // Move to root
getActivity().runOnUiThread(() -> {
Navigation.findNavController(requireView()).popBackStack(R.id.feature_library_top_fragment, false);
// Refresh
updateItem(this.folderId);
// Update toolbar
toolbarSetup(this.toolbar, false, "ライブラリ");
});
}); });
} }