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