mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 23:21:49 +01:00
Minor UI fixes
This commit is contained in:
parent
c3f61e86b7
commit
a4b71f4d11
@ -77,10 +77,12 @@ class LibraryAdapter(private val fragment: LibraryFragment) : RecyclerViewPagerA
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the position of the item. Always assume the position has changed.
|
* Returns the position of the view.
|
||||||
*/
|
*/
|
||||||
override fun getItemPosition(`object`: Any?): Int {
|
override fun getItemPosition(obj: Any?): Int {
|
||||||
return POSITION_NONE
|
val view = obj as? LibraryCategoryView ?: return POSITION_NONE
|
||||||
|
val index = categories.indexOfFirst { it.id == view.category.id }
|
||||||
|
return if (index == -1) POSITION_NONE else index
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -41,7 +41,8 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
|
|||||||
/**
|
/**
|
||||||
* Category for this view.
|
* Category for this view.
|
||||||
*/
|
*/
|
||||||
private lateinit var category: Category
|
lateinit var category: Category
|
||||||
|
private set
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recycler view of the list of manga.
|
* Recycler view of the list of manga.
|
||||||
|
Loading…
Reference in New Issue
Block a user