len 8 anni fa
parent
commit
faa61923fb

+ 10 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReaderAdapter.kt

@@ -1,5 +1,6 @@
 package eu.kanade.tachiyomi.ui.reader.viewer.pager
 
+import android.support.v4.view.PagerAdapter
 import android.view.View
 import android.view.ViewGroup
 import eu.kanade.tachiyomi.R
@@ -34,4 +35,13 @@ class PagerReaderAdapter(private val reader: PagerReader) : ViewPagerAdapter() {
         return pages.size
     }
 
+    override fun getItemPosition(obj: Any): Int {
+        val view = obj as PageView
+        return if (view.page in pages) {
+            PagerAdapter.POSITION_UNCHANGED
+        } else {
+            PagerAdapter.POSITION_NONE
+        }
+    }
+
 }