09-26-2012 01:57 AM
Hi all,
is there a Swipe functionality in BlackBerry java. Can anyone help me any tutorial for that.
09-26-2012 02:21 AM
Hi SumiGhosh,
Are you taking abut touch swipe or anything else?
09-26-2012 08:20 AM
Yes - TouchGesture.SWIPE
09-27-2012 02:11 AM
go through this link:
http://www.blackberry.com/developers/docs/5.0.0api
and you can use this small code also:
protected boolean touchEvent(TouchEvent message) {
switch(message.getEvent()) {
case TouchEvent.GESTURE:
TouchGesture gesture = message.getGesture();
switch(gesture.getEvent()) {
case TouchGesture.SWIPE:
if(gesture.getSwipeDirection() == TouchGesture.SWIPE_EAST) {
Dialog.alert("Eastward swipe occurred");
return true;
} else if(gesture.getSwipeDirection() == TouchGesture.SWIPE_WEST) {
Dialog.alert("Westward swipe occurred");
return true;
}
}
}
return super.touchEvent(message);
}