Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Touch "Propogation" Problem

I have a list that opens a context menu when the list is long-pressed "selected".

 

I also have three different contains within each list item that listen to onTouch and wait for a TouchEvent with TouchType::Up.

 

I'm having a hard time determining how I can kill the touch signal when "select" happens. If I write a flag in the select function to indicate I've captured the signal, it's too late, since the "select" and touch up happen at the same time. If I try to capture the signal in "activated" I also get unwanted results. If I click and hold a touch target for a longish time (long enough to activate) but not long enough to select, I don't get the "TouchType::Up" event because I've captured the signal in activate.

 

I'm not sure if there's some sort of Touch Policy I can set on the container, or what, but basically all I need is for the touch event to die when the list item becomes "selected", but as I mentioned, doing this inside "select" itself is too late, as the event has already been captured by both the container and the image with the onTouch handler on it.

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Developer
Posts: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Re: Touch "Propogation" Problem

[ Edited ]

TouchPropogation.png

 

So the box should only respond to any touch where the item has been touched between 0 seconds and the time it takes to "select" the item. Note that the item will sometimes have been touched long enough to be "activated" and sometimes not.

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!