Nishat Jahan
Nishat Jahan

Reputation: 399

How may I use touch gestures to scroll through a series of pictures?

How can I create a gesture activity in Blackberry in such a way that images appear one after another on different screens ? Can anybody explain me with an example ? I want the images to appear one after another on the mouse click when dragged from left side as well as right side

Upvotes: 1

Views: 594

Answers (2)

Nilanchala
Nilanchala

Reputation: 5941

use the below code to find the touchGESTURE.

protected boolean touchEvent(TouchEvent message) 
{
   switch(message.getEvent()) 
   {
      case TouchEvent.GESTURE:
         TouchGesture gesture = message.getGesture();
         switch(gesture.getEvent()) 
         {
           case TouchGesture.NAVIGATION_SWIPE:
             Dialog.alert("Swipe direction: " + gesture.getSwipeDirection()  
             +            ", "
             +            "\nMagnitude: " + gesture.getSwipeMagnitude());
             return true;
         }
   }
   return false;
}

for more info visit Swipe_gestures_trackpad

Upvotes: 2

Ray Vahey
Ray Vahey

Reputation: 3065

There's some sample code for this on the BlackBerry website.

Create a scrollable image field

http://supportforums.blackberry.com/t5/Java-Development/Create-a-scrollable-image-field/ta-p/444955

Also it sounds like you might find this introduction to touch gestures helpful

http://supportforums.blackberry.com/t5/Java-Development/Introduction-to-Touch-Gestures/ta-p/555363

Upvotes: 2

Related Questions