mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 07:51:52 +01:00
Chapter list starts at top for unfaved manga
This commit is contained in:
parent
73d1b6ac27
commit
c8656526df
@ -250,7 +250,7 @@ class ChaptersController() : NucleusController<ChaptersPresenter>(),
|
||||
private fun scrollToUnread() {
|
||||
if (adapter?.items.isNullOrEmpty()) return
|
||||
if (scrollToUnread) {
|
||||
val index = presenter.getFirstUnreadIndex()
|
||||
val index = presenter.getFirstUnreadIndex() ?: return
|
||||
val centerOfScreen =
|
||||
if (startingChapterYPos != null) startingChapterYPos!!.toInt() - recycler.top - 96
|
||||
else recycler.height / 2 - 96
|
||||
|
@ -415,7 +415,10 @@ class ChaptersPresenter(
|
||||
return manga.sortDescending()
|
||||
}
|
||||
|
||||
fun getFirstUnreadIndex(): Int {
|
||||
fun getFirstUnreadIndex(): Int? {
|
||||
if (!manga.favorite) {
|
||||
return null
|
||||
}
|
||||
val index = chapters.sortedByDescending { it.source_order }.indexOfFirst { !it.read }
|
||||
return if (sortDescending()) (chapters.size - 1) - index
|
||||
else index
|
||||
|
Loading…
Reference in New Issue
Block a user