adding a crashfix

This commit is contained in:
tibbi 2022-10-29 15:44:48 +02:00
parent 3989eca8e8
commit 80ec710edd
1 changed files with 5 additions and 0 deletions

View File

@ -388,6 +388,11 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
private fun initModeSwitcher() { private fun initModeSwitcher() {
val gestureDetector = GestureDetector(this, object : GestureDetector.SimpleOnGestureListener() { val gestureDetector = GestureDetector(this, object : GestureDetector.SimpleOnGestureListener() {
override fun onFling(event1: MotionEvent, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { override fun onFling(event1: MotionEvent, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {
// these can be null even if the docs say they cannot
if (event1 == null && event2 == null) {
return true
}
val deltaX = event1.x - event2.x val deltaX = event1.x - event2.x
val deltaXAbs = abs(deltaX) val deltaXAbs = abs(deltaX)