mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-14 05:15:10 +01:00
parent
17f0754405
commit
ba2d5e4a6d
@ -159,15 +159,14 @@ class LibraryHeaderItem(
|
||||
|
||||
val isAscending = category.isAscending()
|
||||
val sortingMode = category.sortingMode()
|
||||
val sortDrawable = if (category.isHidden) R.drawable.ic_expand_more_24dp
|
||||
else when {
|
||||
val sortDrawable = when {
|
||||
sortingMode == LibrarySort.DRAG_AND_DROP || sortingMode == null -> R.drawable.ic_sort_white_24dp
|
||||
if (sortingMode == LibrarySort.DATE_ADDED || sortingMode == LibrarySort.LATEST_CHAPTER || sortingMode == LibrarySort.LAST_READ) !isAscending else isAscending -> R.drawable.ic_arrow_down_white_24dp
|
||||
else -> R.drawable.ic_arrow_up_white_24dp
|
||||
}
|
||||
|
||||
sortText.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, sortDrawable, 0)
|
||||
sortText.setText(if (category.isHidden) R.string.collasped else category.sortRes())
|
||||
sortText.setText(category.sortRes())
|
||||
expandImage.setImageResource(
|
||||
if (category.isHidden) R.drawable.ic_expand_more_24dp
|
||||
else R.drawable.ic_expand_less_24dp)
|
||||
@ -210,10 +209,6 @@ class LibraryHeaderItem(
|
||||
private fun showCatSortOptions() {
|
||||
val category =
|
||||
(adapter.getItem(adapterPosition) as? LibraryHeaderItem)?.category ?: return
|
||||
if (category.isHidden) {
|
||||
adapter.libraryListener.toggleCategoryVisibility(adapterPosition)
|
||||
return
|
||||
}
|
||||
// Create a PopupMenu, giving it the clicked view for an anchor
|
||||
val popup = PopupMenu(itemView.context, sortText)
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/collapse_arrow"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/select_all"
|
||||
|
Loading…
Reference in New Issue
Block a user