Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interception/propagation of touch events #61

Open
krisrok opened this issue Jun 7, 2016 · 1 comment
Open

interception/propagation of touch events #61

krisrok opened this issue Jun 7, 2016 · 1 comment

Comments

@krisrok
Copy link

krisrok commented Jun 7, 2016

intercepting touches: in my first example there is a GalleryView (of NControl.Controls) inside of a (vertical) ScrollView:

on android the ScrollView takes control of the touches as soon as there is vertical movement. the GalleryView then snaps back (receives a TouchCancelled).
on ios i cannot scroll vertically when touching the GalleryView. if i touch another control inside of the ScrollView i can scroll but as soon as i touched a GalleryView the vertical scrolling does not work anymore in all cases (haven't found out what's going on exactly).

on android i added a hack for "intercepting" the touches: upon touching the extended GalleryView fires an event which the extended ScrollView reacts to by setting it's InputTransparent to true (and later back to false).

propagating touches: in the second example i tried to implement some scrolling behaviour on my own by creating a class ScrollView2 (great naming, i know) extending NControlView:

the ScrollView2 does not render anything by itself, it only layouts it's children. but because it doesn't render it does not receive touches when a child get touched -- even if said child does not handle touches.
if i set the BackgroundColor of ScrollView2 to anything it receives the touches but only where it is directly touched.

is there any mechanism i overlooked? if not, do you plan to implement something like it?

@amalmo
Copy link

amalmo commented Apr 6, 2017

@chrfalch any solution to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants