M mindful Active Member Licensed User Oct 12, 2018 #1 Panel receives only the Touch event. If I have an activity with all the events of a panel (Click, LongClick and Touch) only the touch will be received. If I remove the Touch sub then the click and LongClick will be received. Is this by design ? As I have read some other posts some people use click and touch events together and this is what I want to do also. I have created a test project - a zip file is attached to the first file of another post : https://www.b4x.com/android/forum/threads/button-always-on-top-of-panel.98175/
Panel receives only the Touch event. If I have an activity with all the events of a panel (Click, LongClick and Touch) only the touch will be received. If I remove the Touch sub then the click and LongClick will be received. Is this by design ? As I have read some other posts some people use click and touch events together and this is what I want to do also. I have created a test project - a zip file is attached to the first file of another post : https://www.b4x.com/android/forum/threads/button-always-on-top-of-panel.98175/
DonManfred Expert Licensed User Longtime User Oct 12, 2018 #2 return false from the touch event if you do not want to handle the result. Return true if you want to consume the touch. Upvote 0
return false from the touch event if you do not want to handle the result. Return true if you want to consume the touch.
M mindful Active Member Licensed User Oct 12, 2018 #3 DonManfred said: return false from the touch event Click to expand... I just tried and it doesn't work. when I type Private Sub the Space and Tab and select the Panel and then the Touch event ... this generates a Sub without a As (return) Boolean. So I added one myself and tested but no luck. Only The touch event is received. Code: Copy Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean Log("Panel1_Touch") Return False End Sub Sub Panel1_Click Log("Panel1_Click") End Sub Sub Panel1_LongClick Log("Panel1_LongClick") End Sub Upvote 0
DonManfred said: return false from the touch event Click to expand... I just tried and it doesn't work. when I type Private Sub the Space and Tab and select the Panel and then the Touch event ... this generates a Sub without a As (return) Boolean. So I added one myself and tested but no luck. Only The touch event is received. Code: Copy Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean Log("Panel1_Touch") Return False End Sub Sub Panel1_Click Log("Panel1_Click") End Sub Sub Panel1_LongClick Log("Panel1_LongClick") End Sub
DonManfred Expert Licensed User Longtime User Oct 12, 2018 #4 i may be wrong with the consuming. I may have another situation in mind Looks like you need to emulate/recognize the click or longclick by yourself if you are using the touch event https://www.b4x.com/android/forum/threads/event-touch-longclick.80062/#post-507009 Upvote 0
i may be wrong with the consuming. I may have another situation in mind Looks like you need to emulate/recognize the click or longclick by yourself if you are using the touch event https://www.b4x.com/android/forum/threads/event-touch-longclick.80062/#post-507009
M mindful Active Member Licensed User Oct 12, 2018 #5 DonManfred said: Looks like you need to emulate/recognize the click or longclick by yourself if you are using the touch event Click to expand... This is no problem for me. I am creating an xui custom view and in b4j the pane touch and mouseclick are received. As I saw in b4a that i have the click and touch i thought that i can use them both. I will report a bug for this thing. Maybe a notice should pe placed if this really is a bug. Upvote 0
DonManfred said: Looks like you need to emulate/recognize the click or longclick by yourself if you are using the touch event Click to expand... This is no problem for me. I am creating an xui custom view and in b4j the pane touch and mouseclick are received. As I saw in b4a that i have the click and touch i thought that i can use them both. I will report a bug for this thing. Maybe a notice should pe placed if this really is a bug.
Semen Matusovskiy Well-Known Member Licensed User Oct 12, 2018 #6 Panelwrapper in ontouch raises an event (instead of callback) and returns true in any case. Anyway if to set OnTouchListener using inline java, all works like expected. Upvote 0
Panelwrapper in ontouch raises an event (instead of callback) and returns true in any case. Anyway if to set OnTouchListener using inline java, all works like expected.