07-26-2012 06:06 AM
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
07-27-2012 09:57 AM
Hi there,
You could implement your own listening to Touch events:
https://developer.blackberry.com/cascades/referenc
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.j
Martin
07-29-2012 02:56 AM
Thanks
I will do that
BRs
Zongjun
10-15-2012 10:36 PM
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
}
}
}
}
10-15-2012 11:36 PM
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
}
}
}
}
Wednesday - last edited Wednesday
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.
Wednesday
Wednesday
you can check this link