From 84b9de17cf8ea4712a055b45cd6ae2c757ebbd89 Mon Sep 17 00:00:00 2001 From: nero Date: Fri, 12 Jan 2024 09:56:51 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83?= =?UTF-8?q?=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../library/LibraryFolderFragment.java | 38 ++++++++++--------- .../feature/library/LibraryTopFragment.java | 2 +- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryFolderFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryFolderFragment.java index 115de484..731dcfe3 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryFolderFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryFolderFragment.java @@ -8,25 +8,27 @@ import java.util.List; import java.util.Map; import one.nem.lacerta.model.document.DocumentMeta; + //フォルダ管理機能 -public class LibraryFolderFragment extends Fragment{ +public class LibraryFolderFragment extends Fragment { - private Map> folderMap; + private Map> folderMap; - public LibraryFolderFragment() { - folderMap = new HashMap<>(); - } - - public void addDocumentToFolder(String folderName, DocumentMeta documentMeta) { - if (!folderMap.containsKey(folderName)) { - folderMap.put(folderName, new ArrayList<>()); - } - - List documents = folderMap.get(folderName); - documents.add(documentMeta); - } - //フォルダに関連するドキュメントを取得するためのメソッド - public List getDocumentsInFolder(String folderName) { - return folderMap.getOrDefault(folderName, new ArrayList<>()); - } + public LibraryFolderFragment() { + folderMap = new HashMap<>(); } + + public void addDocumentToFolder(String folderName, DocumentMeta documentMeta) { + if (!folderMap.containsKey(folderName)) { + folderMap.put(folderName, new ArrayList<>()); + } + + List documents = folderMap.get(folderName); + documents.add(documentMeta); + } + + //フォルダに関連するドキュメントを取得するためのメソッド + public List getDocumentsInFolder(String folderName) { + return folderMap.getOrDefault(folderName, new ArrayList<>()); + } +} diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java index 59c1b559..abd7f7c2 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java @@ -94,7 +94,7 @@ public class LibraryTopFragment extends Fragment { documentRecyclerView.setLayoutManager(layoutManager); // ドキュメントのメタデータを取得 - List metas = document.getAllDocumentMetas(100); + List metas = document.getAllDocumentMetas(100); // ドキュメントをデフォルトフォルダに追加 // フォルダごとにドキュメントを管理する