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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 17
Registered: ‎07-17-2012
My Device: N/A
My Carrier: N/A

How can use swipe/flick gesture in cascade application

Hi, 

 

I want to use flick guesture in Cascade application, but I found there is only long press, tap and pinch event in Cascade.  How can I complete flick action with Cascade? Should I use touch down, move to emulate  flick action?

 

thanks/BRs

Zongjun

Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: How can use swipe/flick gesture in cascade application

Hi there,

You could implement your own listening to Touch events:
https://developer.blackberry.com/cascades/reference/bb__cascades__touchevent.html

If you would like to post a feature request for a complete flick gesture event, I suggest you post a feature request here:
https://www.blackberry.com/jira/secure/Dashboard.jspa

Martin

Contributor
Posts: 17
Registered: ‎07-17-2012
My Device: N/A
My Carrier: N/A

Re: How can use swipe/flick gesture in cascade application

Thanks

 

I will do that

 

BRs

Zongjun

Contributor
Posts: 11
Registered: ‎10-05-2012
My Device: Blackberry 10 Dev Alpha Device
My Carrier: Rogers

Re: How can use swipe/flick gesture in cascade application

I thought I would share my code I used to simulate a swipe.  I wish the Touch event included a velocity attribute so that I know that the user is actually doing a swipe.

 

                onTouch: {

                    if (event.isDown()) {

                        downX = event.windowX;

                        downY = event.windowY;

                    } else if (event.isUp()) {

                        var yDiff = downY - event.windowY;

                        // take absolute value of yDiff

                        if (yDiff < 0) yDiff = -1 * yDiff;

                        // I check if the minimum y movement is less than 200.  Don't want to move left or right if 

                        // the user is actually want to move up or down.

                        if ((yDiff) < 200) {

                            if ((downX - event.windowX) > 320) {

                                // move right

                            } else if ((event.windowX - downX) > 320) {

                                 // move left

                            }

                        }

                    }

                }

 
Highlighted
Contributor
Posts: 11
Registered: ‎10-05-2012
My Device: Blackberry 10 Dev Alpha Device
My Carrier: Rogers

Re: How can use swipe/flick gesture in cascade application

Forgot to mention that I defined two properties downX and downY

 

    property int downX: 0

    property int downY: 0

    onTouch: {

                    if (event.isDown()) {

                        downX = event.windowX;

                        downY = event.windowY;

                    } else if (event.isUp()) {

                        var yDiff = downY - event.windowY;

                        // take absolute value of yDiff

                        if (yDiff < 0) yDiff = -1 * yDiff;

                        // I check if the minimum y movement is less than 200.  Don't want to move left or right if 

                        // the user is actually want to move up or down.

                        if ((yDiff) < 200) {

                            if ((downX - event.windowX) > 320) {

                                // move right

                            } else if ((event.windowX - downX) > 320) {

                                 // move left

                            }

                        }

                    }

                }

 
New Developer
Posts: 11
Registered: ‎03-14-2013
My Device: z10 , q10
My Carrier: vodaphone

Re: How can use swipe/flick gesture in cascade application

[ Edited ]

Will the touchpoint be different for Q10, i tried this code on Q10 and its a bit jerky (Q10 - swipe right to left is sticky). Dont we have anything in the framework for this.

Developer
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: How can use swipe/flick gesture in cascade application

There is no swipe gesture in Cascades - only in NDK. So you need to use touch events as mentioned above.
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
New Member
Posts: 3
Registered: ‎06-12-2013
My Device: 8520
My Carrier: t&t

Re: How can use swipe/flick gesture in cascade application

you can check this link