From a0f89de1ac19f7eb23b09b46ad13bc36ada750f4 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 19:41:54 +0900 Subject: [PATCH] WIP --- .../feature/library/LibraryPageFragment.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 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 412bbbbb..922076d8 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 @@ -52,6 +52,8 @@ public class LibraryPageFragment extends Fragment { private String folderId; private String title; private String publicPath; + private String currentId; + private String parentId; private PublicPath currentPublicPath; @Inject @@ -68,12 +70,12 @@ public class LibraryPageFragment extends Fragment { // Required empty public constructor } - public static LibraryPageFragment newInstance(String folderId, String title, String publicPath) { + public static LibraryPageFragment newInstance(String folderId, String title, String parentId) { LibraryPageFragment fragment = new LibraryPageFragment(); Bundle args = new Bundle(); args.putString("folderId", folderId); args.putString("title", title); - args.putString("publicPath", publicPath); + args.putString("publicPath", parentId); fragment.setArguments(args); return fragment; } @@ -130,17 +132,18 @@ public class LibraryPageFragment extends Fragment { if (getArguments() != null) { this.folderId = getArguments().getString("folderId"); this.title = getArguments().getString("title"); - this.publicPath = getArguments().getString("publicPath"); + this.parentId = getArguments().getString("parentId"); // Log logger.debug("LibraryTopFragment", "args" + ", folderId: " + this.folderId + ", title: " + this.title - + ", publicPath: " + this.publicPath); + + ", parentId: " + this.parentId); } if (this.folderId == null) { // Root toolbarSetup(view.findViewById(R.id.library_toolbar), false, "ライブラリ", "Placeholder"); lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> { + this.currentId = libraryItemPage.getPageId(); // Currentを保存 logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); listItemAdapter.setLibraryItemPage(libraryItemPage); getActivity().runOnUiThread(() -> { @@ -151,6 +154,7 @@ public class LibraryPageFragment extends Fragment { } else { // Root以外 toolbarSetup(view.findViewById(R.id.library_toolbar), true, this.title, "Placeholder"); lacertaLibrary.getLibraryPage(this.folderId, 10).thenAccept(libraryItemPage -> { + this.currentId = libraryItemPage.getPageId(); // Currentを保存 logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); listItemAdapter.setLibraryItemPage(libraryItemPage); getActivity().runOnUiThread(() -> { @@ -214,7 +218,8 @@ public class LibraryPageFragment extends Fragment { input.setText("フォルダ名"); builder.setView(input); builder.setPositiveButton("作成", (dialog, which) -> { - lacertaLibrary.createFolder(this.currentPublicPath.getStringPath(), input.getText().toString()).thenAccept(folderId -> { + logger.debug("LibraryTopFragment", "Creating folder: Name: " + input.getText().toString() + ", publicPath: " + publicPath); + lacertaLibrary.createFolder("hoge", input.getText().toString()).thenAccept(folderId -> { logger.debug("LibraryTopFragment", "folderId: " + folderId); }); // Refresh