| 
														
															@@ -1,4 +1,4 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-package eu.kanade.tachiyomi.ui.catalogue.browse 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+package eu.kanade.tachiyomi.ui.source.browse 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import android.content.res.Configuration 
														 | 
														
														 | 
														
															 import android.content.res.Configuration 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import android.os.Bundle 
														 | 
														
														 | 
														
															 import android.os.Bundle 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -23,7 +23,7 @@ import eu.kanade.tachiyomi.R 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import eu.kanade.tachiyomi.data.database.models.Category 
														 | 
														
														 | 
														
															 import eu.kanade.tachiyomi.data.database.models.Category 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import eu.kanade.tachiyomi.data.database.models.Manga 
														 | 
														
														 | 
														
															 import eu.kanade.tachiyomi.data.database.models.Manga 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import eu.kanade.tachiyomi.data.preference.PreferencesHelper 
														 | 
														
														 | 
														
															 import eu.kanade.tachiyomi.data.preference.PreferencesHelper 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import eu.kanade.tachiyomi.databinding.CatalogueControllerBinding 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import eu.kanade.tachiyomi.databinding.SourceControllerBinding 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import eu.kanade.tachiyomi.source.CatalogueSource 
														 | 
														
														 | 
														
															 import eu.kanade.tachiyomi.source.CatalogueSource 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import eu.kanade.tachiyomi.source.model.FilterList 
														 | 
														
														 | 
														
															 import eu.kanade.tachiyomi.source.model.FilterList 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import eu.kanade.tachiyomi.source.online.HttpSource 
														 | 
														
														 | 
														
															 import eu.kanade.tachiyomi.source.online.HttpSource 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -51,8 +51,8 @@ import uy.kohesive.injekt.injectLazy 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /** 
														 | 
														
														 | 
														
															 /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  * Controller to manage the catalogues available in the app. 
														 | 
														
														 | 
														
															  * Controller to manage the catalogues available in the app. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  */ 
														 | 
														
														 | 
														
															  */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        NucleusController<BrowseCataloguePresenter>(bundle), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+open class BrowseSourceController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        NucleusController<BrowseSourcePresenter>(bundle), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FlexibleAdapter.OnItemClickListener, 
														 | 
														
														 | 
														
															         FlexibleAdapter.OnItemClickListener, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FlexibleAdapter.OnItemLongClickListener, 
														 | 
														
														 | 
														
															         FlexibleAdapter.OnItemLongClickListener, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         FlexibleAdapter.EndlessScrollListener, 
														 | 
														
														 | 
														
															         FlexibleAdapter.EndlessScrollListener, 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -77,7 +77,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /** 
														 | 
														
														 | 
														
															     /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * Sheet containing filter items. 
														 | 
														
														 | 
														
															      * Sheet containing filter items. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    private var filterSheet: CatalogueFilterSheet? = null 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private var filterSheet: SourceFilterSheet? = null 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /** 
														 | 
														
														 | 
														
															     /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * Recycler view with the list of results. 
														 | 
														
														 | 
														
															      * Recycler view with the list of results. 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -99,7 +99,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private var progressItem: ProgressItem? = null 
														 | 
														
														 | 
														
															     private var progressItem: ProgressItem? = null 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    private lateinit var binding: CatalogueControllerBinding 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private lateinit var binding: SourceControllerBinding 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     init { 
														 | 
														
														 | 
														
															     init { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         setHasOptionsMenu(true) 
														 | 
														
														 | 
														
															         setHasOptionsMenu(true) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -109,12 +109,12 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return presenter.source.name 
														 | 
														
														 | 
														
															         return presenter.source.name 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    override fun createPresenter(): BrowseCataloguePresenter { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        return BrowseCataloguePresenter(args.getLong(SOURCE_ID_KEY)) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    override fun createPresenter(): BrowseSourcePresenter { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return BrowseSourcePresenter(args.getLong(SOURCE_ID_KEY)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { 
														 | 
														
														 | 
														
															     override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        binding = CatalogueControllerBinding.inflate(inflater) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        binding = SourceControllerBinding.inflate(inflater) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return binding.root 
														 | 
														
														 | 
														
															         return binding.root 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -136,7 +136,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return 
														 | 
														
														 | 
														
															             return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        filterSheet = CatalogueFilterSheet( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        filterSheet = SourceFilterSheet( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             activity!!, 
														 | 
														
														 | 
														
															             activity!!, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             onSearchClicked = { 
														 | 
														
														 | 
														
															             onSearchClicked = { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 val allDefault = presenter.sourceFilters == presenter.source.getFilterList() 
														 | 
														
														 | 
														
															                 val allDefault = presenter.sourceFilters == presenter.source.getFilterList() 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -188,17 +188,17 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL)) 
														 | 
														
														 | 
														
															                 addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } else { 
														 | 
														
														 | 
														
															         } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            (binding.catalogueView.inflate(R.layout.catalogue_recycler_autofit) as AutofitRecyclerView).apply { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            (binding.catalogueView.inflate(R.layout.source_recycler_autofit) as AutofitRecyclerView).apply { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 numColumnsSubscription = getColumnsPreferenceForCurrentOrientation().asObservable() 
														 | 
														
														 | 
														
															                 numColumnsSubscription = getColumnsPreferenceForCurrentOrientation().asObservable() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         .doOnNext { spanCount = it } 
														 | 
														
														 | 
														
															                         .doOnNext { spanCount = it } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         .skip(1) 
														 | 
														
														 | 
														
															                         .skip(1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         // Set again the adapter to recalculate the covers height 
														 | 
														
														 | 
														
															                         // Set again the adapter to recalculate the covers height 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        .subscribe { adapter = this@BrowseCatalogueController.adapter } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        .subscribe { adapter = this@BrowseSourceController.adapter } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 (layoutManager as GridLayoutManager).spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { 
														 | 
														
														 | 
														
															                 (layoutManager as GridLayoutManager).spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     override fun getSpanSize(position: Int): Int { 
														 | 
														
														 | 
														
															                     override fun getSpanSize(position: Int): Int { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         return when (adapter?.getItemViewType(position)) { 
														 | 
														
														 | 
														
															                         return when (adapter?.getItemViewType(position)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                            R.layout.catalogue_grid_item, null -> 1 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                            R.layout.source_grid_item, null -> 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                             else -> spanCount 
														 | 
														
														 | 
														
															                             else -> spanCount 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         } 
														 | 
														
														 | 
														
															                         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -231,7 +231,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { 
														 | 
														
														 | 
														
															     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        inflater.inflate(R.menu.catalogue_list, menu) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        inflater.inflate(R.menu.source_browse, menu) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         // Initialize search menu 
														 | 
														
														 | 
														
															         // Initialize search menu 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         val searchItem = menu.findItem(R.id.action_search) 
														 | 
														
														 | 
														
															         val searchItem = menu.findItem(R.id.action_search) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -246,7 +246,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         val searchEventsObservable = searchView.queryTextChangeEvents() 
														 | 
														
														 | 
														
															         val searchEventsObservable = searchView.queryTextChangeEvents() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .skip(1) 
														 | 
														
														 | 
														
															                 .skip(1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                .filter { router.backstack.lastOrNull()?.controller() == this@BrowseCatalogueController } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .filter { router.backstack.lastOrNull()?.controller() == this@BrowseSourceController } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .share() 
														 | 
														
														 | 
														
															                 .share() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         val writingObservable = searchEventsObservable 
														 | 
														
														 | 
														
															         val writingObservable = searchEventsObservable 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .filter { !it.isSubmitted } 
														 | 
														
														 | 
														
															                 .filter { !it.isSubmitted } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -323,7 +323,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @param page the current page. 
														 | 
														
														 | 
														
															      * @param page the current page. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @param mangas the list of manga of the page. 
														 | 
														
														 | 
														
															      * @param mangas the list of manga of the page. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    fun onAddPage(page: Int, mangas: List<CatalogueItem>) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    fun onAddPage(page: Int, mangas: List<SourceItem>) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         val adapter = adapter ?: return 
														 | 
														
														 | 
														
															         val adapter = adapter ?: return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         hideProgressBar() 
														 | 
														
														 | 
														
															         hideProgressBar() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (page == 1) { 
														 | 
														
														 | 
														
															         if (page == 1) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -434,7 +434,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (!isListMode || !view.context.connectivityManager.isActiveNetworkMetered) { 
														 | 
														
														 | 
														
															         if (!isListMode || !view.context.connectivityManager.isActiveNetworkMetered) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             // Initialize mangas if going to grid view or if over wifi when going to list view 
														 | 
														
														 | 
														
															             // Initialize mangas if going to grid view or if over wifi when going to list view 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             val mangas = (0 until adapter.itemCount).mapNotNull { 
														 | 
														
														 | 
														
															             val mangas = (0 until adapter.itemCount).mapNotNull { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                (adapter.getItem(it) as? CatalogueItem)?.manga 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                (adapter.getItem(it) as? SourceItem)?.manga 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             presenter.initializeMangas(mangas) 
														 | 
														
														 | 
														
															             presenter.initializeMangas(mangas) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -458,13 +458,13 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @param manga the manga to find. 
														 | 
														
														 | 
														
															      * @param manga the manga to find. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @return the holder of the manga or null if it's not bound. 
														 | 
														
														 | 
														
															      * @return the holder of the manga or null if it's not bound. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    private fun getHolder(manga: Manga): CatalogueHolder? { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private fun getHolder(manga: Manga): SourceHolder? { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         val adapter = adapter ?: return null 
														 | 
														
														 | 
														
															         val adapter = adapter ?: return null 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         adapter.allBoundViewHolders.forEach { holder -> 
														 | 
														
														 | 
														
															         adapter.allBoundViewHolders.forEach { holder -> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            val item = adapter.getItem(holder.adapterPosition) as? CatalogueItem 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            val item = adapter.getItem(holder.adapterPosition) as? SourceItem 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (item != null && item.manga.id!! == manga.id!!) { 
														 | 
														
														 | 
														
															             if (item != null && item.manga.id!! == manga.id!!) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                return holder as CatalogueHolder 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                return holder as SourceHolder 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -495,7 +495,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @return true if the item should be selected, false otherwise. 
														 | 
														
														 | 
														
															      * @return true if the item should be selected, false otherwise. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     override fun onItemClick(view: View, position: Int): Boolean { 
														 | 
														
														 | 
														
															     override fun onItemClick(view: View, position: Int): Boolean { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        val item = adapter?.getItem(position) as? CatalogueItem ?: return false 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        val item = adapter?.getItem(position) as? SourceItem ?: return false 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         router.pushController(MangaController(item.manga, true).withFadeTransaction()) 
														 | 
														
														 | 
														
															         router.pushController(MangaController(item.manga, true).withFadeTransaction()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return false 
														 | 
														
														 | 
														
															         return false 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -512,7 +512,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     override fun onItemLongClick(position: Int) { 
														 | 
														
														 | 
														
															     override fun onItemLongClick(position: Int) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         val activity = activity ?: return 
														 | 
														
														 | 
														
															         val activity = activity ?: return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        val manga = (adapter?.getItem(position) as? CatalogueItem?)?.manga ?: return 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        val manga = (adapter?.getItem(position) as? SourceItem?)?.manga ?: return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (manga.favorite) { 
														 | 
														
														 | 
														
															         if (manga.favorite) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             MaterialDialog.Builder(activity) 
														 | 
														
														 | 
														
															             MaterialDialog.Builder(activity) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -576,7 +576,7 @@ open class BrowseCatalogueController(bundle: Bundle) : 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         presenter.changeMangaFavorite(manga) 
														 | 
														
														 | 
														
															         presenter.changeMangaFavorite(manga) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         presenter.updateMangaCategories(manga, categories) 
														 | 
														
														 | 
														
															         presenter.updateMangaCategories(manga, categories) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        val position = adapter?.currentItems?.indexOfFirst { it -> (it as CatalogueItem).manga.id == manga.id } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        val position = adapter?.currentItems?.indexOfFirst { it -> (it as SourceItem).manga.id == manga.id } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (position != null) { 
														 | 
														
														 | 
														
															         if (position != null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             adapter?.notifyItemChanged(position) 
														 | 
														
														 | 
														
															             adapter?.notifyItemChanged(position) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 |