From b756eea9bb67293d76c9dc034ea07d42250c28d9 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, 29 Jan 2024 11:21:28 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=84=E3=82=8D=E3=81=84=E3=82=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerContainerFragment.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java index 791901a9..f5fd50b0 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerContainerFragment.java @@ -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(){{add(documentId);}}); // TODO-rca: 読みにくいので直接追加できるようにする viewerViewPagerAdapter.setFragmentTitleList(new ArrayList(){{add(documentName);}}); // TODO-rca: 読みにくいので直接追加できるようにする viewerViewPagerAdapter.setFragmentRevisionList(new ArrayList(){{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);