NControl icon indicating copy to clipboard operation
NControl copied to clipboard

interception/propagation of touch events

Open krisrok opened this issue 8 years ago • 1 comments

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?

krisrok avatar Jun 07 '16 17:06 krisrok

@chrfalch any solution to this?

amalmo avatar Apr 06 '17 11:04 amalmo