From b7232d2723652befc623e29a6f5b1853c1ac544d 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:51:22 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E3=81=8B=E3=82=89=E3=82=82?= =?UTF-8?q?=E9=81=B8=E6=8A=9E=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F(=E3=81=AF=E3=81=9A=E3=81=A0?= =?UTF-8?q?=E3=81=91=E3=81=A9=E5=8B=95=E3=81=8B=E3=81=AA=E3=81=84=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88=E3=81=9A=E8=A6=8B?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=93=E3=81=A8=E3=81=AB?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerContainerFragment.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 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 f5fd50b0..1e6b6ff7 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 @@ -205,7 +205,10 @@ public class ViewerContainerFragment extends Fragment { PopupMenu popupMenu = new PopupMenu(getContext(), v); popupMenu.inflate(R.menu.viewer_tab_menu); popupMenu.setOnMenuItemClickListener(item -> { - if (item.getItemId() == R.id.action_rename) { + if (item.getItemId() == R.id.action_open_vcs_rev_list) { + showRevList(viewerViewPagerAdapter.getFragmentTargetId(position), viewerViewPagerAdapter.getFragmentTitle(position)); + return true; + } else if (item.getItemId() == R.id.action_rename) { renameCombinedDocument( documentId, viewerViewPagerAdapter.getFragmentTargetIdList().get(position), @@ -289,7 +292,7 @@ public class ViewerContainerFragment extends Fragment { toolbar.inflateMenu(R.menu.viewer_menu); toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.action_open_vcs_rev_list) { - showRevList(); + showRevList(this.documentId, this.documentName); return true; } else if (item.getItemId() == R.id.action_rename) { renameDocument(); @@ -313,15 +316,15 @@ public class ViewerContainerFragment extends Fragment { }); } - private void showRevList() { + private void showRevList(String targetId, String targetName) { LacertaSelectRevDialog lacertaSelectRevDialog = new LacertaSelectRevDialog(); - lacertaSelectRevDialog.setDocumentId(this.documentId).setTitle("リビジョンの選択").setMessage("リビジョンを選択してください。").setNegativeButtonText("キャンセル"); + lacertaSelectRevDialog.setDocumentId(targetId).setTitle("リビジョンの選択").setMessage("リビジョンを選択してください。").setNegativeButtonText("キャンセル"); lacertaSelectRevDialog.setListener(new LacertaSelectRevDialogListener() { @Override public void onItemSelected(String revId) { logger.debug("ViewerContainerFragment", "Dialog Result: revId: " + revId); getParentFragmentManager().beginTransaction() - .replace(R.id.nav_host_fragment, ViewerContainerFragment.newInstance(documentId, documentName, revId)) + .replace(R.id.nav_host_fragment, ViewerContainerFragment.newInstance(targetId, targetName, revId)) .commit(); }