Viewer navigation (#3869)

* Viewer navigation

Co-authored-by: Harsh Parekh <h.x.dev@outlook.com>

* Match current reader behavior and add ability to invert it

* A bit of clean up

* Clean up inversion

* Only create navigator when changed

and change tap zone when invertTapping is changed

* Clean up PagerConfig

* Change how Viewer navigation works

* Add Edge Navigation

Co-authored-by: Harsh Parekh <h.x.dev@outlook.com>
This commit is contained in:
Andreas E
2021-01-02 00:41:20 +01:00
committed by GitHub
parent 71ece73d99
commit d69e9034ab
19 changed files with 350 additions and 58 deletions
@@ -0,0 +1,15 @@
package eu.kanade.tachiyomi.util.lang
import android.graphics.RectF
import eu.kanade.tachiyomi.data.preference.PreferenceValues
fun RectF.invert(invertMode: PreferenceValues.TappingInvertMode): RectF {
val horizontal = invertMode.shouldInvertHorizontal
val vertical = invertMode.shouldInvertVertical
return when {
horizontal && vertical -> RectF(1f - this.right, 1f - this.bottom, 1f - this.left, 1f - this.top)
vertical -> RectF(this.left, 1f - this.bottom, this.right, 1f - this.top)
horizontal -> RectF(1f - this.right, this.top, 1f - this.left, this.bottom)
else -> this
}
}