I have a switch button (actually is a custom one) and I want to disable the swipe functionality for some reason; I want the user to be able to click it only. Is
switch
You can custom a view that extends Switch then override its onTouchEvent()
@Override public boolean onTouchEvent(MotionEvent ev) { boolean handle = ev.getActionMasked() == MotionEvent.ACTION_MOVE; return handle ? handle : super.onTouchEvent(ev); }
It should work.