mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix pages sticking when using split pages
happened because of the recent changes
This commit is contained in:
parent
f0c034f83e
commit
7faa67687d
1 changed files with 3 additions and 2 deletions
|
@ -140,12 +140,13 @@ class PagerViewerAdapter(private val viewer: PagerViewer) : ViewPagerAdapter() {
|
|||
override fun getItemPosition(view: Any): Int {
|
||||
if (view is PositionableView) {
|
||||
val position = joinedItems.indexOfFirst {
|
||||
val secondPage = it.second as? ReaderPage
|
||||
if (it.first is InsertPage && view.item is Pair<*, *>) {
|
||||
((view.item as? Pair<*, *>?)?.first as? InsertPage)?.let { viewPage ->
|
||||
return@indexOfFirst (it.first as? InsertPage)?.isFromSamePage(viewPage) == true
|
||||
return@indexOfFirst (it.first as? InsertPage)?.isFromSamePage(viewPage) == true &&
|
||||
(it.first as? InsertPage)?.firstHalf == viewPage.firstHalf
|
||||
}
|
||||
}
|
||||
val secondPage = it.second as? ReaderPage
|
||||
view.item == it.first to secondPage
|
||||
}
|
||||
if (position != -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue