Android Question About Scroll and Swipe

LucaMs

Expert
Licensed User
Longtime User
An our friend in the Italian forum needed to create a particular scroll effect but overlaying a transparent panel, the underlying views were not accessible. He solved with the coordinates x, y.

But I would like to know:

there must be something that allows this effect "inside" of Android (perhaps I could say "natively"?).

The normal view HorizontalScrollView: adding to it a few buttons you can scroll but also click on the buttons. I do not think this view internally do calculations on a panel using the x, y coordinates of a touch event etc.

And I could list other examples.
 

LucaMs

Expert
Licensed User
Longtime User
It is not a problem.

Not easy to explain.

An our friend had a lot of labels, fifty, I think. He wanted to change their text using a swipe; superimposing them a transparent panel, the label did not react to clicks. Thanks to the coordinates of the panel touch event, He could detect which label was involved.

I think that there might exist an intrinsic mechanism in Android for this kind of situations. As in HorizontalScrollView.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If you are using Reflector to add the touch event to the panel then you can return False from the touch event to make let the event pass to the next views. However this is not so simple as you still need to decide whether the user is swiping or clicking.


It is probably simplest to use the built in gesture detector: http://www.b4x.com/android/forum/threads/lib-gesture-detector.21502/#content
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Thanks for the reply, but I can not formulate the question well (I seem to remember that the friend has tried with the normal panel touch event and also with that library).

I suppose (I guess) that there is something in Android "automatic", already included in the system, such as events, for example.

In many apps we can see some full screen scroll/swipe over views, eg Viber.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…