| 
					
				 | 
			
			
				@@ -94,6 +94,11 @@ class LibraryController( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     val libraryMangaRelay: BehaviorRelay<LibraryMangaEvent> = BehaviorRelay.create() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * Relay to notify the library's viewpager to select all manga 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    val selectAllRelay: PublishRelay<Int> = PublishRelay.create() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * Number of manga per row in grid mode. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -409,6 +414,7 @@ class LibraryController( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             R.id.action_move_to_category -> showChangeMangaCategoriesDialog() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             R.id.action_delete -> showDeleteMangaDialog() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            R.id.action_select_all -> selectAllCategoryManga() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             else -> return false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return true 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -496,6 +502,12 @@ class LibraryController( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private fun selectAllCategoryManga() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        adapter?.categories?.getOrNull(library_pager.currentItem)?.id?.let { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            selectAllRelay.call(it) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (requestCode == REQUEST_IMAGE_OPEN) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (data == null || resultCode != Activity.RESULT_OK) return 
			 |