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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Super Contributor
SumiGhosh
Posts: 307
Registered: ‎09-20-2011
My Carrier: Vodafone

Swipe in java.

Hi all,

 is there a Swipe functionality in BlackBerry java. Can anyone help me any tutorial for that.

Please use plain text.
Developer
hemant_sain
Posts: 106
Registered: ‎12-09-2011
My Carrier: Aircel

Re: Swipe in java.

Hi SumiGhosh,

 

Are you taking abut touch swipe or anything else?

Please use plain text.
Developer
pbrebs
Posts: 40
Registered: ‎09-08-2011
My Carrier: AIS

Re: Swipe in java.

Yes - TouchGesture.SWIPE

Please use plain text.
Developer
hemant_sain
Posts: 106
Registered: ‎12-09-2011
My Carrier: Aircel

Re: Swipe in java.

go through this link:

 

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/ui/TouchGesture.html

 

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);
}

 

Please use plain text.