mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
いろいろ
This commit is contained in:
parent
80941c39d6
commit
b756eea9bb
|
@ -33,6 +33,7 @@ import one.nem.lacerta.component.common.picker.LacertaDirPickerDialog;
|
|||
import one.nem.lacerta.component.common.picker.LacertaFilePickerDialog;
|
||||
import one.nem.lacerta.data.Document;
|
||||
import one.nem.lacerta.data.LacertaLibrary;
|
||||
import one.nem.lacerta.model.ListItemType;
|
||||
import one.nem.lacerta.model.document.page.Page;
|
||||
import one.nem.lacerta.model.document.tag.DocumentTag;
|
||||
import one.nem.lacerta.model.pref.ToxiDocumentModel;
|
||||
|
@ -149,14 +150,13 @@ public class ViewerContainerFragment extends Fragment {
|
|||
document.getDocumentPageListByFileNameList(this.documentId, pagePathList).thenApply(pageList -> {
|
||||
logger.debug("ViewerContainerFragment", "pageList: " + pageList.size());
|
||||
// 暫定: 履歴を遡って表示している場合は結合を無視する(処理自体は単純だけどUI側の対応をする時間がないので)
|
||||
this.hasCombined = false;
|
||||
tabLayout.setVisibility(View.GONE);
|
||||
|
||||
viewerViewPagerAdapter.setFragmentTargetIdList(new ArrayList<String>(){{add(documentId);}}); // TODO-rca: 読みにくいので直接追加できるようにする
|
||||
viewerViewPagerAdapter.setFragmentTitleList(new ArrayList<String>(){{add(documentName);}}); // TODO-rca: 読みにくいので直接追加できるようにする
|
||||
|
||||
viewerViewPagerAdapter.setFragmentRevisionList(new ArrayList<String>(){{add(revId);}}); // TODO-rca: 読みにくいので直接追加できるようにする
|
||||
viewerViewPagerAdapter.notifyItemRangeChanged(0, pageList.size());
|
||||
toolbar.setSubtitle("リビジョン: " + revId);
|
||||
return null;
|
||||
});
|
||||
return null;
|
||||
|
@ -165,6 +165,8 @@ public class ViewerContainerFragment extends Fragment {
|
|||
|
||||
// Get document page
|
||||
if (this.hasCombined) { // 結合親の場合
|
||||
// バージョンを遡る操作を非表示
|
||||
toolbar.getMenu().findItem(R.id.action_open_vcs_rev_list).setVisible(false);
|
||||
logger.debug("ViewerContainerFragment", "hasCombined: " + hasCombined);
|
||||
lacertaLibrary.getCombinedDocumentToxiList(documentId).thenAccept(combinedDocumentToxiList -> {
|
||||
logger.debug("ViewerContainerFragment", "combinedDocumentToxiList: " + combinedDocumentToxiList.size());
|
||||
|
@ -175,6 +177,7 @@ public class ViewerContainerFragment extends Fragment {
|
|||
combinedDocumentToxiList.stream().map(ToxiDocumentModel::getTitleCache).collect(Collectors.toCollection(ArrayList::new)));
|
||||
|
||||
viewerViewPagerAdapter.notifyItemRangeChanged(0, combinedDocumentToxiList.size());
|
||||
toolbar.setSubtitle("結合ドキュメント");
|
||||
});
|
||||
} else { // それ以外の場合
|
||||
logger.debug("ViewerContainerFragment", "hasCombined: " + hasCombined);
|
||||
|
@ -184,6 +187,12 @@ public class ViewerContainerFragment extends Fragment {
|
|||
viewerViewPagerAdapter.notifyItemRangeChanged(0, 1);
|
||||
}
|
||||
|
||||
// サブタイトルとしてパスを表示(暫定)
|
||||
lacertaLibrary.getPublicPath(documentId, ListItemType.ITEM_TYPE_DOCUMENT).thenAccept(publicPath -> {
|
||||
logger.debug("ViewerContainerFragment", "publicPath: " + publicPath);
|
||||
toolbar.setSubtitle("/" + publicPath.parent().getStringPath());
|
||||
});
|
||||
|
||||
// Attach tab layout to view pager
|
||||
new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> {
|
||||
View customView = LayoutInflater.from(getContext()).inflate(R.layout.viewer_custom_tab, null);
|
||||
|
|
Loading…
Reference in New Issue
Block a user