How to intercept the swipe to left movement to navigate to previous screen and disable the navigation ?
I have tried to intercept the action and return false
but it does not work:
@SuppressLint("ClickableViewAccessibility")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.setOnTouchListener{ v, event ->
Timber.d("~ TouchEvent: ${event.toString()}")
when(event.action){
ACTION_DOWN -> {
false
}
ACTION_MOVE -> {
false
}
}
}
}
Is there a way to disable the swipe to previous screen gesture ?
reference: Detect common gestures