mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 20:01:53 +01:00
Disable clicking on dyamnic category headers
Normal categories clicking has been reverted to collasping
This commit is contained in:
parent
59c2da3f91
commit
a8d577e790
@ -210,7 +210,6 @@ class LibraryCategoryAdapter(val controller: LibraryController) :
|
|||||||
fun startReading(position: Int)
|
fun startReading(position: Int)
|
||||||
fun onItemReleased(position: Int)
|
fun onItemReleased(position: Int)
|
||||||
fun canDrag(): Boolean
|
fun canDrag(): Boolean
|
||||||
fun openCategoriesBackdrop()
|
|
||||||
fun updateCategory(catId: Int): Boolean
|
fun updateCategory(catId: Int): Boolean
|
||||||
fun sortCategory(catId: Int, sortBy: Int)
|
fun sortCategory(catId: Int, sortBy: Int)
|
||||||
fun selectAll(position: Int)
|
fun selectAll(position: Int)
|
||||||
|
@ -600,26 +600,6 @@ class LibraryController(
|
|||||||
return adapter.headerItems.firstOrNull() as? LibraryHeaderItem
|
return adapter.headerItems.firstOrNull() as? LibraryHeaderItem
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getCategoryOrder(): Int? {
|
|
||||||
val position =
|
|
||||||
(recycler.layoutManager as LinearLayoutManager).findFirstCompletelyVisibleItemPosition()
|
|
||||||
var order = when (val item = adapter.getItem(position)) {
|
|
||||||
is LibraryHeaderItem -> item.category.order
|
|
||||||
is LibraryItem -> item.header.category.order
|
|
||||||
else -> null
|
|
||||||
}
|
|
||||||
if (order == null) {
|
|
||||||
val fPosition =
|
|
||||||
(recycler.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition()
|
|
||||||
order = when (val item = adapter.getItem(fPosition)) {
|
|
||||||
is LibraryHeaderItem -> item.category.order
|
|
||||||
is LibraryItem -> item.header.category.order
|
|
||||||
else -> null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return order
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
|
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
|
||||||
return inflater.inflate(R.layout.library_list_controller, container, false)
|
return inflater.inflate(R.layout.library_list_controller, container, false)
|
||||||
}
|
}
|
||||||
@ -1155,8 +1135,6 @@ class LibraryController(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun openCategoriesBackdrop() = showCategories(true)
|
|
||||||
|
|
||||||
override fun updateCategory(position: Int): Boolean {
|
override fun updateCategory(position: Int): Boolean {
|
||||||
val category = (adapter.getItem(position) as? LibraryHeaderItem)?.category ?: return false
|
val category = (adapter.getItem(position) as? LibraryHeaderItem)?.category ?: return false
|
||||||
val inQueue = LibraryUpdateService.categoryInQueue(category.id)
|
val inQueue = LibraryUpdateService.categoryInQueue(category.id)
|
||||||
|
@ -43,10 +43,11 @@ class LibraryHeaderHolder(val view: View, private val adapter: LibraryCategoryAd
|
|||||||
category_header_layout.setOnClickListener { toggleCategory() }
|
category_header_layout.setOnClickListener { toggleCategory() }
|
||||||
updateButton.setOnClickListener { addCategoryToUpdate() }
|
updateButton.setOnClickListener { addCategoryToUpdate() }
|
||||||
sectionText.setOnLongClickListener {
|
sectionText.setOnLongClickListener {
|
||||||
|
val category = (adapter.getItem(adapterPosition) as? LibraryHeaderItem)?.category
|
||||||
adapter.libraryListener.manageCategory(adapterPosition)
|
adapter.libraryListener.manageCategory(adapterPosition)
|
||||||
true
|
category?.isDynamic == false
|
||||||
}
|
}
|
||||||
sectionText.setOnClickListener { adapter.libraryListener.openCategoriesBackdrop() }
|
sectionText.setOnClickListener { toggleCategory() }
|
||||||
sortText.setOnClickListener { it.post { showCatSortOptions() } }
|
sortText.setOnClickListener { it.post { showCatSortOptions() } }
|
||||||
checkboxImage.setOnClickListener { selectAll() }
|
checkboxImage.setOnClickListener { selectAll() }
|
||||||
updateButton.drawable.mutate()
|
updateButton.drawable.mutate()
|
||||||
@ -86,6 +87,14 @@ class LibraryHeaderHolder(val view: View, private val adapter: LibraryCategoryAd
|
|||||||
}
|
}
|
||||||
val category = item.category
|
val category = item.category
|
||||||
|
|
||||||
|
if (category.isDynamic) {
|
||||||
|
category_header_layout.background = null
|
||||||
|
sectionText.background = null
|
||||||
|
} else {
|
||||||
|
category_header_layout.setBackgroundResource(R.drawable.list_item_selector)
|
||||||
|
sectionText.setBackgroundResource(R.drawable.square_ripple)
|
||||||
|
}
|
||||||
|
|
||||||
if (category.isAlone) sectionText.text = ""
|
if (category.isAlone) sectionText.text = ""
|
||||||
else sectionText.text = category.name
|
else sectionText.text = category.name
|
||||||
if (category.sourceId != null) {
|
if (category.sourceId != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user