From b434bc93a32f5193092bbfb87e20b61b94fd1fb6 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 22 Mar 2020 12:43:53 -0400 Subject: [PATCH] Add fast scroller in catalogues/extensions lists --- .../ui/catalogue/CatalogueController.kt | 2 ++ .../ui/extension/ExtensionController.kt | 1 + .../res/layout/catalogue_main_controller.xml | 10 +++++++ .../main/res/layout/extension_controller.xml | 30 ++++++++++++++----- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt index fcb5db5d10..21bdd03b89 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt @@ -30,6 +30,7 @@ import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController import eu.kanade.tachiyomi.ui.catalogue.latest.LatestUpdatesController import eu.kanade.tachiyomi.ui.setting.SettingsSourcesController +import kotlinx.android.synthetic.main.catalogue_main_controller.fast_scroller import kotlinx.android.synthetic.main.catalogue_main_controller.recycler import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -108,6 +109,7 @@ class CatalogueController : NucleusController(), recycler.layoutManager = LinearLayoutManager(view.context) recycler.adapter = adapter recycler.addItemDecoration(SourceDividerItemDecoration(view.context)) + adapter?.fastScroller = fast_scroller requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt index 4bac6bf9b5..f316bc33cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt @@ -77,6 +77,7 @@ open class ExtensionController : NucleusController(), ext_recycler.layoutManager = LinearLayoutManager(view.context) ext_recycler.adapter = adapter ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(view.context)) + adapter?.fastScroller = fast_scroller } override fun onDestroyView(view: View) { diff --git a/app/src/main/res/layout/catalogue_main_controller.xml b/app/src/main/res/layout/catalogue_main_controller.xml index 5156716be7..c2947e342a 100644 --- a/app/src/main/res/layout/catalogue_main_controller.xml +++ b/app/src/main/res/layout/catalogue_main_controller.xml @@ -1,6 +1,7 @@ @@ -10,4 +11,13 @@ android:layout_height="wrap_content" tools:listitem="@layout/catalogue_main_controller_card" /> + + diff --git a/app/src/main/res/layout/extension_controller.xml b/app/src/main/res/layout/extension_controller.xml index df6fe2d0ae..523b979132 100644 --- a/app/src/main/res/layout/extension_controller.xml +++ b/app/src/main/res/layout/extension_controller.xml @@ -1,14 +1,30 @@ - - + android:layout_height="match_parent"> - + + + + + + +