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); }); });