Checking if finger is over certain view not working in Android
I am working on a paint app with the following layout:
https://i.stack.imgur.com/VBW8X.png▾
For the paint app, I detect touch events on the Canvas using onTouchEvent. I have one problem, I want to also detect touch events in which the user begins the swipe on the root and then hovers over the Canvas.
To achieve this, I added the following code:
binding.root.setOnTouchListener { _, motionEvent ->
val hitRect = Rect()...