mirror of
				https://github.com/lacerta-doc/Lacerta.git
				synced 2025-10-30 15:00:49 +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.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; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user