From d393087ff65b08da10235cb3ab12464125c8b32f Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 29 Jan 2024 02:49:04 +0900 Subject: [PATCH] =?UTF-8?q?=E7=B7=A8=E9=9B=86=E3=81=AB=E8=BF=BD=E5=BE=93?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=82=BF=E3=83=96=E3=81=AE=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=88=E3=83=AB=E3=82=82=E6=AD=A3=E3=81=97=E3=81=8F=E5=A4=89?= =?UTF-8?q?=E3=82=8F=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerContainerFragment.java | 9 +++++++-- 1 file changed, 7 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 ff1834e6..6152d199 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 @@ -148,14 +148,18 @@ public class ViewerContainerFragment extends Fragment { ImageButton imageButton = customView.findViewById(R.id.tab_modify); imageButton.setOnClickListener(v -> { - renameCombinedDocument(this.documentId, viewerViewPagerAdapter.getFragmentTargetId(position), viewerViewPagerAdapter.getFragmentTitle(position)); + renameCombinedDocument( + this.documentId, + viewerViewPagerAdapter.getFragmentTargetId(position), + viewerViewPagerAdapter.getFragmentTitle(position), + position); }); tab.setCustomView(customView); }).attach(); } - private void renameCombinedDocument(String parentId, String childId, String current) { + private void renameCombinedDocument(String parentId, String childId, String current, int position) { // TODO-rca: 無理やりpositionを渡してるのでなんとかする MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext()); builder.setTitle("アイテム名の変更"); builder.setMessage("アイテム名を入力してください"); @@ -172,6 +176,7 @@ public class ViewerContainerFragment extends Fragment { lacertaLibrary.updateTitleCache(parentId, childId, textInputEditText.getText().toString()), (aVoid, aVoid2) -> { getActivity().runOnUiThread(() -> { Toast.makeText(getContext(), "変更しました", Toast.LENGTH_SHORT).show(); + updateTabTitle(position, textInputEditText.getText().toString()); dialog.dismiss(); }); return null;