From 2fcab4e9315a9cdcc3f378572929bd178411ea85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 29 Jan 2024 12:59:56 +0900 Subject: [PATCH] =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=97=E3=81=9F=E5=BE=8C?= =?UTF-8?q?=E3=83=95=E3=83=AA=E3=83=BC=E3=82=BA=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB(Workaround)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/library/LibraryPageFragment.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java index 2a00bdb0..3ba134c0 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryPageFragment.java @@ -320,7 +320,6 @@ public class LibraryPageFragment extends Fragment { toolbar.setNavigationIcon(null); } - if (this.folderId == null) toolbar.getMenu().findItem(R.id.menu_item_delete_folder).setVisible(false); // ルートフォルダの場合は削除ボタンを非表示にする toolbar.setTitle(title); toolbar.getMenu().clear(); toolbar.inflateMenu(R.menu.dir_menu); @@ -349,12 +348,23 @@ public class LibraryPageFragment extends Fragment { return false; } }); + + if (this.folderId == null) toolbar.getMenu().findItem(R.id.menu_item_delete_folder).setVisible(false); // ルートフォルダの場合は削除ボタンを非表示にする }); } private void deleteMe() { 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, "ライブラリ"); + }); }); }