mirror of
				https://github.com/lacerta-doc/Lacerta.git
				synced 2025-10-31 15:30:49 +00:00 
			
		
		
		
	実装
This commit is contained in:
		
							parent
							
								
									d9a9cd0743
								
							
						
					
					
						commit
						f1d947e159
					
				| @ -37,6 +37,8 @@ import one.nem.lacerta.model.document.page.Page; | |||||||
| import one.nem.lacerta.model.document.tag.DocumentTag; | import one.nem.lacerta.model.document.tag.DocumentTag; | ||||||
| import one.nem.lacerta.model.pref.ToxiDocumentModel; | import one.nem.lacerta.model.pref.ToxiDocumentModel; | ||||||
| import one.nem.lacerta.utils.LacertaLogger; | import one.nem.lacerta.utils.LacertaLogger; | ||||||
|  | import one.nem.lacerta.vcs.LacertaVcs; | ||||||
|  | import one.nem.lacerta.vcs.factory.LacertaVcsFactory; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * A simple {@link Fragment} subclass. |  * A simple {@link Fragment} subclass. | ||||||
| @ -57,6 +59,9 @@ public class ViewerContainerFragment extends Fragment { | |||||||
|     @Inject |     @Inject | ||||||
|     Document document; |     Document document; | ||||||
| 
 | 
 | ||||||
|  |     @Inject | ||||||
|  |     LacertaVcsFactory lacertaVcsFactory; | ||||||
|  | 
 | ||||||
|     // Variables |     // Variables | ||||||
|     private String documentId; |     private String documentId; | ||||||
|     private String documentName; |     private String documentName; | ||||||
| @ -137,6 +142,26 @@ public class ViewerContainerFragment extends Fragment { | |||||||
|         Toolbar toolbar = view.findViewById(R.id.toolbar); |         Toolbar toolbar = view.findViewById(R.id.toolbar); | ||||||
|         initToolbar(toolbar, true, documentName); |         initToolbar(toolbar, true, documentName); | ||||||
| 
 | 
 | ||||||
|  |         if (this.revId != null) { // Revが指定されている場合 | ||||||
|  |             LacertaVcs lacertaVcs = lacertaVcsFactory.create(documentId); | ||||||
|  |             lacertaVcs.getDocumentPagePathListRev(this.revId).thenApply(pagePathList -> { | ||||||
|  |                 logger.debug("ViewerContainerFragment", "pagePathList: " + pagePathList.size()); | ||||||
|  |                 document.getDocumentPageListByFileNameList(this.documentId, pagePathList).thenApply(pageList -> { | ||||||
|  |                     logger.debug("ViewerContainerFragment", "pageList: " + pageList.size()); | ||||||
|  |                     // 暫定: 履歴を遡って表示している場合は結合を無視する | ||||||
|  |                     this.hasCombined = false; | ||||||
|  | 
 | ||||||
|  |                     viewerViewPagerAdapter.setFragmentTargetIdList(new ArrayList<String>(){{add(documentId);}}); // TODO-rca: 読みにくいので直接追加できるようにする | ||||||
|  |                     viewerViewPagerAdapter.setFragmentTitleList(new ArrayList<String>(){{add(documentName);}}); // TODO-rca: 読みにくいので直接追加できるようにする | ||||||
|  | 
 | ||||||
|  |                     viewerViewPagerAdapter.setFragmentRevisionList(new ArrayList<String>(){{add(revId);}}); // TODO-rca: 読みにくいので直接追加できるようにする | ||||||
|  |                     viewerViewPagerAdapter.notifyItemRangeChanged(0, pageList.size()); | ||||||
|  |                     return null; | ||||||
|  |                 }); | ||||||
|  |                 return null; | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         // Get document page |         // Get document page | ||||||
|         if (this.hasCombined) { // 結合親の場合 |         if (this.hasCombined) { // 結合親の場合 | ||||||
|             logger.debug("ViewerContainerFragment", "hasCombined: " + hasCombined); |             logger.debug("ViewerContainerFragment", "hasCombined: " + hasCombined); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user