From 511fa317984e5e512b2bb82ff05723b8e0c4c5be Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 18 May 2020 17:58:18 -0400 Subject: [PATCH] Tapping category name now expands backdrop --- .../eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt | 1 + .../java/eu/kanade/tachiyomi/ui/library/LibraryController.kt | 2 ++ .../eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt index 6c47e30cdd..7768a39659 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt @@ -210,6 +210,7 @@ class LibraryCategoryAdapter(val controller: LibraryController) : fun startReading(position: Int) fun onItemReleased(position: Int) fun canDrag(): Boolean + fun openCategoriesBackdrop() fun updateCategory(catId: Int): Boolean fun sortCategory(catId: Int, sortBy: Int) fun selectAll(position: Int) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 9aad8fa7c3..6909a1d87b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -1113,6 +1113,8 @@ class LibraryController( } } + override fun openCategoriesBackdrop() = showCategories(true) + override fun updateCategory(catId: Int): Boolean { val category = (adapter.getItem(catId) as? LibraryHeaderItem)?.category ?: return false val inQueue = LibraryUpdateService.categoryInQueue(category.id) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt index fc794067aa..c5f86c5102 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHeaderHolder.kt @@ -45,7 +45,7 @@ class LibraryHeaderHolder(val view: View, private val adapter: LibraryCategoryAd adapter.libraryListener.manageCategory(adapterPosition) true } - sectionText.setOnClickListener { toggleCategory() } + sectionText.setOnClickListener { adapter.libraryListener.openCategoriesBackdrop() } sortText.setOnClickListener { it.post { showCatSortOptions() } } checkboxImage.setOnClickListener { selectAll() } updateButton.drawable.mutate() @@ -262,4 +262,4 @@ class LibraryHeaderHolder(val view: View, private val adapter: LibraryCategoryAd super.onLongClick(view) return false } -} \ No newline at end of file +}