0

How do I allow for new ACTION_DOWN touches while I am still holding my finger on the screen after having triggered a previous ACTION_DOWN event? It's probably easiest to show a gif of what I would like to achieve:

a short animation showing buttons being pressed sequentially

G is touched, the finger moves to A without releasing, and A gets appended to G above in the textview. The finger moves to S, which again is appended, and then the finger releases, triggering ACTION_UP.

Basically, I have a number of buttons, all of which have an onTouch Listener. When a button is pressed, the text-value of that button gets appended to a textview (just like the animation shows). But I can't figure out how to re-enable onTouch ACTION_DOWN for any button once the first one is pressed, and I am holding the finger down. Note: I am not interested in the drawing of the line that follows the finger

It's not that I need code; I can't even find anything on the basic logic. I have seen dozens of threads on here asking for something similar and none really help me. What is this feature called? It's not a multitouch gesture since I am only touching with one finger, one thing at a time- but in sequence without ACTION_UP. Some motion event? Do I work with focus? Do I need a canvas?

marts
  • 658
  • 1
  • 10
  • 15

1 Answers1

0

I think you should set a touch listener on your layout's view and try to get X and Y and detect if X and Y of the touch point are on your Views.

But the post is no case of greater than 2 views. You can refer the post.

Detect touch event on a view when dragged over from other view