From 5d9d27105aa3d9267a9ce2f2cbe5c676006aa66f Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Wed, 26 Jul 2023 05:29:45 +0530 Subject: [PATCH] Fix compilation errors --- .../libretube/ui/listeners/AudioPlayerThumbnailListener.kt | 4 ++-- .../github/libretube/ui/listeners/PlayerGestureController.kt | 4 ++-- .../libretube/ui/views/SingleViewTouchableMotionLayout.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/listeners/AudioPlayerThumbnailListener.kt b/app/src/main/java/com/github/libretube/ui/listeners/AudioPlayerThumbnailListener.kt index 05e747704..4b1796438 100644 --- a/app/src/main/java/com/github/libretube/ui/listeners/AudioPlayerThumbnailListener.kt +++ b/app/src/main/java/com/github/libretube/ui/listeners/AudioPlayerThumbnailListener.kt @@ -47,12 +47,12 @@ class AudioPlayerThumbnailListener(context: Context, private val listener: Audio } override fun onScroll( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float ): Boolean { - val insideThreshHold = abs(e2.y - e1.y) <= MOVEMENT_THRESHOLD + val insideThreshHold = abs(e2.y - e1!!.y) <= MOVEMENT_THRESHOLD // If the movement is inside threshold or scroll is horizontal then return false if (!isMoving && (insideThreshHold || abs(distanceX) > abs(distanceY))) { diff --git a/app/src/main/java/com/github/libretube/ui/listeners/PlayerGestureController.kt b/app/src/main/java/com/github/libretube/ui/listeners/PlayerGestureController.kt index 7b9c61c87..05ed04669 100644 --- a/app/src/main/java/com/github/libretube/ui/listeners/PlayerGestureController.kt +++ b/app/src/main/java/com/github/libretube/ui/listeners/PlayerGestureController.kt @@ -135,14 +135,14 @@ class PlayerGestureController(activity: BaseActivity, private val listener: Play } override fun onScroll( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float ): Boolean { if (!isEnabled || scaleGestureDetector.isInProgress) return false - val insideThreshHold = abs(e2.y - e1.y) <= MOVEMENT_THRESHOLD + val insideThreshHold = abs(e2.y - e1!!.y) <= MOVEMENT_THRESHOLD val insideBorder = (e1.x < BORDER_THRESHOLD || e1.y < BORDER_THRESHOLD || e1.x > width - BORDER_THRESHOLD || e1.y > height - BORDER_THRESHOLD) diff --git a/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt b/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt index b3e63fb58..c25722a2a 100644 --- a/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt +++ b/app/src/main/java/com/github/libretube/ui/views/SingleViewTouchableMotionLayout.kt @@ -58,7 +58,7 @@ class SingleViewTouchableMotionLayout(context: Context, attributeSet: AttributeS } override fun onScroll( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float