I\'m using the new class provided by the design library : TabLayout. And I want in specific cases that the one I\'m using can\'t change tab anymore.
I manage to disa
Based on this excellent solution , if someone needs it in Kotlin :
val tabStrip = mTabLayout.getChildAt(0) as LinearLayout
for (i in 0..tabStrip.childCount) {
tabStrip.getChildAt(i).setOnTouchListener(object : View.OnTouchListener{
override fun onTouch(p0: View?, p1: MotionEvent?): Boolean {
return true
}
})
}
Or a more elegant solution with lambdas
mTabLayout.setOnTouchListener {v: View, m: MotionEvent ->
true
}