This is my touch listener:
var touchListener = OnTouchListener { view, motionEvent ->
val action = motionEvent.action
when (action and MotionEvent.ACTION_MASK) {
MotionEvent.ACTION_POINTER_DOWN -> {
Toast.makeText(activity, " Two Fingers Tapped Once. Yeeeyy :)", Toast.LENGTH_SHORT).show()
// set the mTwoFingersTapped flag to TRUE when we tap with 2 fingers at once
twoFingers = true
}
}
false
}
And in my click listener I do this:
if (!twoFingers) {
todoListener.onCommunicationInfoClicked(addressableReference)
} else {
todoListener.onLongClicked(todoItem)
twoFingers = false
Toast.makeText(activity, " Two Fingers Tapped Once. Yeeeyy :)", Toast.LENGTH_SHORT).show()
}
This works on android phone, if I tap with 2 fingers and I get desired effect. However I tap with 2 fingers on chromebook touchpad and nothing happens
After listening and posting the finger counter and events and etc. I did manage to make it work like this:
But not quite happy with it.