From 01f28ecd4dfb7f6f48cb6dc67f87d23a2dedfd0b 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 10:31:26 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=92=E6=AD=A3=E5=B8=B8=E3=81=AB=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/data/impl/LacertaLibraryImpl.java | 10 +++++++++- .../lacerta/feature/library/LibraryTopFragment.java | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index e080f7d0..809c6f75 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -81,10 +81,13 @@ public class LacertaLibraryImpl implements LacertaLibrary { LibraryItemPage libraryItemPage = new LibraryItemPage(); List folderEntities = getFolderEntitiesByPublicPath("/").join(); + logger.debug("LacertaLibraryImpl", "folderEntities.size(): " + folderEntities.size()); List documentEntities = getDocumentEntitiesByPublicPath("/").join(); + logger.debug("LacertaLibraryImpl", "documentEntities.size(): " + documentEntities.size()); ArrayList listItems = new ArrayList<>(); for (FolderEntity folderEntity : folderEntities) { + logger.debug("LacertaLibraryImpl", "folderEntity.name: " + folderEntity.name); ListItem listItem = new ListItem(); listItem.setItemType(ListItemType.ITEM_TYPE_FOLDER); listItem.setTitle(folderEntity.name); @@ -93,16 +96,21 @@ public class LacertaLibraryImpl implements LacertaLibrary { listItems.add(listItem); } for (DocumentEntity documentEntity : documentEntities) { + logger.debug("LacertaLibraryImpl", "documentEntity.title: " + documentEntity.title); ListItem listItem = new ListItem(); listItem.setItemType(ListItemType.ITEM_TYPE_DOCUMENT); listItem.setTitle(documentEntity.title); - listItem.setDescription(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm").format(documentEntity.updatedAt.toInstant())); +// listItem.setDescription(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm").format(documentEntity.updatedAt.toInstant())); listItem.setItemId(documentEntity.id); listItems.add(listItem); } + libraryItemPage.setPageTitle("/"); + libraryItemPage.setPageId("root"); libraryItemPage.setListItems(listItems); + logger.debug("LacertaLibraryImpl", "libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); + return libraryItemPage; }); } 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 48db1876..bb36392e 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 @@ -31,6 +31,7 @@ import one.nem.lacerta.data.Document; import one.nem.lacerta.data.LacertaLibrary; import one.nem.lacerta.model.document.DocumentMeta; import one.nem.lacerta.model.document.tag.DocumentTag; +import one.nem.lacerta.utils.LacertaLogger; @@ -45,6 +46,9 @@ public class LibraryTopFragment extends Fragment { @Inject LacertaLibrary lacertaLibrary; + @Inject + LacertaLogger logger; + public LibraryTopFragment() { // Required empty public constructor } @@ -82,9 +86,10 @@ public class LibraryTopFragment extends Fragment { recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); lacertaLibrary.getLibraryPage(10).thenAccept(libraryItemPage -> { + logger.debug("LibraryTopFragment", "Item selected! libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size()); listItemAdapter.setLibraryItemPage(libraryItemPage); getActivity().runOnUiThread(() -> { - listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size()); + listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1); }); });