From df95ce4405fde6850fd0c17d7b3ea0f799e5f7e0 Mon Sep 17 00:00:00 2001 From: nero Date: Wed, 17 Jan 2024 11:15:05 +0900 Subject: [PATCH] =?UTF-8?q?Adapter=E3=81=AE=E3=81=A8=E3=81=93=E3=82=8D?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/feature/library/LibraryTopFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 ada38c82..17436908 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 @@ -101,9 +101,6 @@ public class LibraryTopFragment extends Fragment { // Use view.findViewById instead of findViewById RecyclerView documentRecyclerView = view.findViewById(R.id.document_list); - LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); - documentRecyclerView.setLayoutManager(layoutManager); - try { LacertaLibrary lacertaLibrary = new LacertaLibraryImpl(); // ドキュメントのメタデータを取得 @@ -126,9 +123,14 @@ public class LibraryTopFragment extends Fragment { // トーストメッセージでドキュメントの数を表示 Toast.makeText(getActivity(), "ドキュメント数: " + Integer.toString(metas.size()), Toast.LENGTH_LONG).show(); + LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); + documentRecyclerView.setLayoutManager(layoutManager); + // LibraryItemPageを使用してadapterを設定 DocumentAdapter adapter = new DocumentAdapter((ArrayList) metas); documentRecyclerView.setAdapter(adapter); + //RecyclerView の再描画 + documentRecyclerView.invalidate(); } else { // ドキュメントのメタデータが null の場合の処理 Toast.makeText(getContext(), "ドキュメントメタデータが取得できませんでした", Toast.LENGTH_LONG).show();