Hi,
I have a layout with some panels and some view inside those panels.
What I want to do is make this layout catch a swipe gesture (left to right, eg.) without the other views in the layout (specifically inside the panels) catching that gesture (Touch event). Using Activity_touch didn't do much to help.
I've just read it but, if I put all the panels inside another panel will that panel catch the touch event, even if the other panels have views such as ScrollViews?
BTW, I can't test it right now.
Ok, I tested it again and here's what's going on:
When I Touch (not Click) a view inside a panel the panel's Touch event is not raised. Only if I first touch the panel itself then the touch event is registered. How can I make the panel handle ALL touch events?
I tried the Gestures library by adding a scrollview to the panel but it doesn't catch movements started on the scrollview. What I need is to catch horizontal movements no matter what view the user puts his finger on, just like it's in the link I gave above.
On a side note: using the gestures library I noticed that my tab (Galaxy 7'') supports 10 touch points simultaneously (if i had more fingers i would test for more )
This does sound a bit hard to do.
You could create an invisible panel on top, but I am not sure how and when to pass the events down to the scrollview if they are not needed.
Also, borrow some fingers from a few friends and see how many more touch points it supports
Erel,
I had tried with a transparent Panel on top to work with the touch event. Could this event be treated like the KeyPress event in returning True or False to indicate the OS wether the event is consumed or not. I tired it but it doesn't work.
Like: Sub Panele1_Touch (Action As Int, X As Float, Y As Float) As Boolean Return False
do you have success with this?
How have you forward the UP/DOWN events?
I am asking, because i also wanted to have such behavior in my app.
What i want to endup is to move to next/pevious panel only if 2 fingers are used for swiping.
Others should be forwarded to the underlying panel's activity, so that the other views (buttons, boxes) can react.
No I haven't.
What I tried was using a transparent panel's touch event to move panels forward and backward.
The problem is that on one panel there is a ScrollView, and as the touch event is already consumed by the top transparent panel the ScrollView doesn't scroll anymore. I saw in the Android documentation that the touch event returns True if it has been consumed, so I wondered if the touch event could be treated like the KeyPress event.
Maybe, the drag & drop code in the CheckList class may help you. I don't use a transparent panel, only a customized touch event handler. I decide if the finger moves are for the drag & drop panel or for the ScrollView.