mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
編集に追従してタブのタイトルも正しく変わるように
This commit is contained in:
parent
d691ee0126
commit
d393087ff6
|
@ -148,14 +148,18 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
|
|
||||||
ImageButton imageButton = customView.findViewById(R.id.tab_modify);
|
ImageButton imageButton = customView.findViewById(R.id.tab_modify);
|
||||||
imageButton.setOnClickListener(v -> {
|
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);
|
tab.setCustomView(customView);
|
||||||
}).attach();
|
}).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());
|
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
|
||||||
builder.setTitle("アイテム名の変更");
|
builder.setTitle("アイテム名の変更");
|
||||||
builder.setMessage("アイテム名を入力してください");
|
builder.setMessage("アイテム名を入力してください");
|
||||||
|
@ -172,6 +176,7 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
lacertaLibrary.updateTitleCache(parentId, childId, textInputEditText.getText().toString()), (aVoid, aVoid2) -> {
|
lacertaLibrary.updateTitleCache(parentId, childId, textInputEditText.getText().toString()), (aVoid, aVoid2) -> {
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
Toast.makeText(getContext(), "変更しました", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "変更しました", Toast.LENGTH_SHORT).show();
|
||||||
|
updateTabTitle(position, textInputEditText.getText().toString());
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
});
|
});
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user