More crash fixes
Cette révision appartient à :
Parent
6cf84256fe
révision
4a6e2a5d99
2 fichiers modifiés avec 18 ajouts et 14 suppressions
|
@ -172,14 +172,16 @@ abstract class PagerReader : BaseReader() {
|
|||
protected fun createGestureDetector(): GestureDetector {
|
||||
return GestureDetector(activity, object : GestureDetector.SimpleOnGestureListener() {
|
||||
override fun onSingleTapConfirmed(e: MotionEvent): Boolean {
|
||||
val positionX = e.x
|
||||
if (isAdded) {
|
||||
val positionX = e.x
|
||||
|
||||
if (positionX < pager.width * LEFT_REGION) {
|
||||
if (tappingEnabled) onLeftSideTap()
|
||||
} else if (positionX > pager.width * RIGHT_REGION) {
|
||||
if (tappingEnabled) onRightSideTap()
|
||||
} else {
|
||||
readerActivity.toggleMenu()
|
||||
if (positionX < pager.width * LEFT_REGION) {
|
||||
if (tappingEnabled) onLeftSideTap()
|
||||
} else if (positionX > pager.width * RIGHT_REGION) {
|
||||
if (tappingEnabled) onRightSideTap()
|
||||
} else {
|
||||
readerActivity.toggleMenu()
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -127,14 +127,16 @@ class WebtoonReader : BaseReader() {
|
|||
protected fun createGestureDetector(): GestureDetector {
|
||||
return GestureDetector(context, object : SimpleOnGestureListener() {
|
||||
override fun onSingleTapConfirmed(e: MotionEvent): Boolean {
|
||||
val positionX = e.x
|
||||
if (isAdded) {
|
||||
val positionX = e.x
|
||||
|
||||
if (positionX < recycler.width * LEFT_REGION) {
|
||||
if (tappingEnabled) moveToPrevious()
|
||||
} else if (positionX > recycler.width * RIGHT_REGION) {
|
||||
if (tappingEnabled) moveToNext()
|
||||
} else {
|
||||
readerActivity.toggleMenu()
|
||||
if (positionX < recycler.width * LEFT_REGION) {
|
||||
if (tappingEnabled) moveToPrevious()
|
||||
} else if (positionX > recycler.width * RIGHT_REGION) {
|
||||
if (tappingEnabled) moveToNext()
|
||||
} else {
|
||||
readerActivity.toggleMenu()
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket