I've implemented the interface GestureDetector.OnGestureListener on my Activity. It was working fine with Android API 32 but after updating the Android API level from 32 to 33, I'm unable to override it's methods. When I roll back to Android API 32 it works fine.
Here is how I'm implementing the interface:
class ABCActivity: AppCompatActivity(), GestureDetector.OnGestureListener {
override fun onDown(p0: MotionEvent?): Boolean = false
override fun onShowPress(p0: MotionEvent?) = Unit
override fun onSingleTapUp(p0: MotionEvent?): Boolean = false
override fun onLongPress(p0: MotionEvent?) = Unit
override fun onFling(p0: MotionEvent?, p1: MotionEvent?, p2: Float, p3: Float): Boolean = false
override fun onScroll(
event: MotionEvent?,
event1: MotionEvent?,
distanceX: Float,
distanceY: Float
): Boolean {
// My Logic
}
}