Another option for handling touch events is to use a GestureDetectorCompat object (developer.android.com/reference/androidx/core/view/GestureDetectorCompat). Instead of adding logic to detect events like a swipe or a fling, the GestureDetectorCompat has listeners that do the heavy lifting and notify you when a particular event occurs.
Many cases do not require the full control provided by overriding the onTouch function, so using the GestureDetectorCompat instead is a great choice.