diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ComponentViewerTopFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ComponentViewerTopFragment.java index e319c02c..ba81a71d 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ComponentViewerTopFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ComponentViewerTopFragment.java @@ -71,10 +71,12 @@ public class ComponentViewerTopFragment extends Fragment { recyclerView.setAdapter(viewerBodyAdapter); document.getDocument(documentId).thenAccept(documentDetail -> { - ArrayList pages = documentDetail.getPages(); - viewerBodyAdapter.setPages(pages); + viewerBodyAdapter.setPages(documentDetail.getPages()); +// getActivity().runOnUiThread(() -> { +// viewerBodyAdapter.notifyItemRangeChanged(0, pages.size()); +// }); getActivity().runOnUiThread(() -> { - viewerBodyAdapter.notifyItemRangeChanged(0, pages.size()); + viewerBodyAdapter.notifyDataSetChanged(); }); }); diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java index 0fec6757..6c971144 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java @@ -139,9 +139,11 @@ public class DocumentImpl implements Document { DocumentDetail detail = new DocumentDetail(); getPagesByXmlMeta(documentId).thenCompose(xmlMetaPageModels -> getPagesByXmlMetaPageModel(documentId, xmlMetaPageModels)).thenAccept(pages -> { + logger.debug(TAG, "pages: " + pages.size()); detail.setMeta(meta); detail.setPages(pages); - }); + }).join(); + return detail; }); }