From 611c5b516d79480228a82f4ef9a0c0392b406cd2 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, 22 Jan 2024 18:40:24 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E5=AE=9F=E8=A3=85?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/library/LibraryPageFragment.java | 37 +------------------ 1 file changed, 1 insertion(+), 36 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 71f5fb16..e5f70c48 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 @@ -91,8 +91,6 @@ public class LibraryPageFragment extends Fragment { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_library_top, container, false); - setHasOptionsMenu(true); - return view; } @@ -193,6 +191,7 @@ public class LibraryPageFragment extends Fragment { } private void createFolder() { + // TODO-rca: デザインをMaterial Design 3に合わせたカスタムダイアログにする AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("フォルダの作成"); builder.setMessage("フォルダ名を入力してください"); @@ -211,40 +210,6 @@ public class LibraryPageFragment extends Fragment { }); builder.show(); } - - @Override - public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { - inflater.inflate(R.menu.dir_menu, menu); - super.onCreateOptionsMenu(menu, inflater); - } - - // Selected - @Override - public boolean onOptionsItemSelected(@NonNull MenuItem item) { - if (item.getItemId() == R.id.menu_item_create_new_folder) { - AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); - builder.setTitle("フォルダの作成"); - builder.setMessage("フォルダ名を入力してください"); - final android.widget.EditText input = new android.widget.EditText(getContext()); - input.setText("フォルダ名"); - builder.setView(input); - builder.setPositiveButton("作成", (dialog, which) -> { - lacertaLibrary.createFolder(null, input.getText().toString()).thenAccept(folderId -> { - logger.debug("LibraryTopFragment", "folderId: " + folderId); - }); - // Refresh - updateItem(); - }); - builder.setNegativeButton("キャンセル", (dialog, which) -> { - dialog.cancel(); - }); - builder.show(); - return true; - } else { - return super.onOptionsItemSelected(item); - } - } - private void updateItem() { lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> { logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size());