mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 20:15:09 +01:00
More fixes to the reader nav
This commit is contained in:
parent
a6a2ef6399
commit
23702bfd66
@ -23,6 +23,7 @@ import android.widget.SeekBar
|
|||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.core.view.GestureDetectorCompat
|
import androidx.core.view.GestureDetectorCompat
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
@ -220,6 +221,9 @@ class ReaderActivity :
|
|||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
menuVisible = savedInstanceState.getBoolean(::menuVisible.name)
|
menuVisible = savedInstanceState.getBoolean(::menuVisible.name)
|
||||||
|
binding.readerNav.root.isVisible = menuVisible
|
||||||
|
} else {
|
||||||
|
binding.readerNav.root.gone()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.chaptersSheet.chaptersBottomSheet.setup(this)
|
binding.chaptersSheet.chaptersBottomSheet.setup(this)
|
||||||
@ -399,7 +403,7 @@ class ReaderActivity :
|
|||||||
return@setOnTouchListener false
|
return@setOnTouchListener false
|
||||||
}
|
}
|
||||||
if (it == pageSeekbar) {
|
if (it == pageSeekbar) {
|
||||||
readerNavGestureDetector.lockVertical
|
readerNavGestureDetector.lockVertical || !readerNavGestureDetector.hasScrollHorizontal
|
||||||
} else {
|
} else {
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class ReaderNavGestureDetector(private val activity: ReaderActivity) : GestureDe
|
|||||||
val newDistanceX = (e1?.rawX ?: 0f) - (e2?.rawX ?: 0f)
|
val newDistanceX = (e1?.rawX ?: 0f) - (e2?.rawX ?: 0f)
|
||||||
val newDistanceY = (e1?.rawY ?: 0f) - (e2?.rawY ?: 0f)
|
val newDistanceY = (e1?.rawY ?: 0f) - (e2?.rawY ?: 0f)
|
||||||
if ((!hasScrollHorizontal || lockVertical) && e2 != null) {
|
if ((!hasScrollHorizontal || lockVertical) && e2 != null) {
|
||||||
hasScrollHorizontal = abs(newDistanceX) > abs(newDistanceY) && abs(newDistanceX) > 80
|
hasScrollHorizontal = abs(newDistanceX) > abs(newDistanceY) && abs(newDistanceX) > 60
|
||||||
|
|
||||||
val modE = MotionEvent.obtain(e2)
|
val modE = MotionEvent.obtain(e2)
|
||||||
modE.setLocation(
|
modE.setLocation(
|
||||||
|
Loading…
Reference in New Issue
Block a user