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
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition
My Carrier: 00201003883386
Accepted Solution

How to do Swipe gesture in Cascades?

Hi All

        I found (Tap, Double tap, Pinch,Long press) exist out of the box.   What about Swipe gesture? does it exist out of the box or there is a workaround to do it?

 

I tried doing it before using  normal touch events but was not accurate

When you are young, work to learn. Not to earn !
Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: How to do Swipe gesture in Cascades?

It does not exist out of the box unfortunately. I too am in need of such functionality.

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Developer
Posts: 18
Registered: ‎11-08-2012
My Device: Blackberry 10 Dev Alpha B
My Carrier: ??

Re: How to do Swipe gesture in Cascades?

explore these:

 TouchType, TouchEnterEvent, TouchExitEvent

If you find my post helpful, please click like Smiley Happy
Developer
Developer
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -

Re: How to do Swipe gesture in Cascades?

[ Edited ]

look into the touch() signal, after that it is just some math:

 

- calculate distance travelled on screen between the event.isDown() and event.isUp() signals (using event.windowX or event.windowY)

- if the distance travailled exceeds D, then based on a positive or negative value, you have your swipe

- you can improve by calculating the time spent between the event.isDown() and event.isUp() signals...time and distance will give you speed which is an important factor for improving swipe detection

- make sure you also handle the event.isCancel() event...it mess things up a lot !

 

EDIT: i did a feature request on this a while ago but still waiting on RIM to make this a public item: https://www.blackberry.com/jira/browse/BBTEN-497

Developer
Posts: 1,632
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: How to do Swipe gesture in Cascades?

Direction swipe should be part of the OS.  We shouldn't have to figure this out.

Why did RIM not include these events?  They already have the touch, tap, double tap etc...

 

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: How to do Swipe gesture in Cascades?

perhaps someone figured it out and can put it at github ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: How to do Swipe gesture in Cascades?

@ekke, not sure if you were being sarcastic but this has been solved and is on github.  Johan presented this app at BBJam Americas: https://github.com/blackberry/Cascades-Community-Samples/tree/master/stumpers/bbjamcarousel

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: How to do Swipe gesture in Cascades?


bcs925 wrote:

@ekke, not sure if you were being sarcastic but this has been solved and is on github.  Johan presented this app at BBJam Americas: https://github.com/blackberry/Cascades-Community-Samples/tree/master/stumpers/bbjamcarousel


thx mentioning this ...

 

I should have known, because I was sitting at the round table where Johan presented the stumpers ;-)

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner