mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
修正
This commit is contained in:
parent
0dafecc75d
commit
fa985b86bd
|
@ -105,7 +105,6 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
|
|
||||||
// Init tab layout
|
// Init tab layout
|
||||||
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
|
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
|
||||||
new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> tab.setText(viewerViewPagerAdapter.getTabTitle(position))).attach();
|
|
||||||
|
|
||||||
// Init toolbar
|
// Init toolbar
|
||||||
Toolbar toolbar = view.findViewById(R.id.toolbar);
|
Toolbar toolbar = view.findViewById(R.id.toolbar);
|
||||||
|
@ -116,16 +115,22 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
lacertaLibrary.getCombinedDocumentToxiList(documentId).thenAccept(combinedDocumentToxiList -> {
|
lacertaLibrary.getCombinedDocumentToxiList(documentId).thenAccept(combinedDocumentToxiList -> {
|
||||||
logger.debug("ViewerContainerFragment", "combinedDocumentToxiList: " + combinedDocumentToxiList.size());
|
logger.debug("ViewerContainerFragment", "combinedDocumentToxiList: " + combinedDocumentToxiList.size());
|
||||||
for (ToxiDocumentModel toxiDocumentModel : combinedDocumentToxiList) {
|
for (ToxiDocumentModel toxiDocumentModel : combinedDocumentToxiList) {
|
||||||
|
logger.debug("ViewerContainerFragment", "titleCache: " + toxiDocumentModel.getTitleCache());
|
||||||
viewerViewPagerAdapter
|
viewerViewPagerAdapter
|
||||||
.addFragment(ViewerBodyFragment.newInstance(toxiDocumentModel.getChildDocumentId(), toxiDocumentModel.getTitleCache()),
|
.addFragment(ViewerBodyFragment.newInstance(toxiDocumentModel.getChildDocumentId(), toxiDocumentModel.getTitleCache()),
|
||||||
toxiDocumentModel.getTitleCache());
|
toxiDocumentModel.getTitleCache());
|
||||||
}
|
}
|
||||||
|
viewerViewPagerAdapter.notifyItemRangeChanged(0, combinedDocumentToxiList.size());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logger.debug("ViewerContainerFragment", "hasCombined: " + hasCombined);
|
logger.debug("ViewerContainerFragment", "hasCombined: " + hasCombined);
|
||||||
tabLayout.setVisibility(View.GONE);
|
tabLayout.setVisibility(View.GONE);
|
||||||
viewerViewPagerAdapter.addFragment(ViewerBodyFragment.newInstance(documentId, documentName), documentName);
|
viewerViewPagerAdapter.addFragment(ViewerBodyFragment.newInstance(documentId, documentName), documentName);
|
||||||
|
viewerViewPagerAdapter.notifyItemRangeChanged(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Attach tab layout to view pager
|
||||||
|
new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> tab.setText(viewerViewPagerAdapter.getTabTitle(position))).attach();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user