Tapping category name now expands backdrop

This commit is contained in:
Jay 2020-05-18 17:58:18 -04:00
parent a03ee4943f
commit 511fa31798
3 changed files with 5 additions and 2 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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
}
}
}