views:

508

answers:

2

Hi All,

I have four images in the Gallery View. When we do swipe from left to right or right to left the Gallery View moves all the images i.e if I swipe from left to right from the first image then it will move to all the four images.

What I want is that when I swipe it should only move to the next image. Can someone let me know how is this possible?

Hope to get a reply soon.

Regards Sunil

A: 

You can implement this without using a Gallery: put an ImageView on your Layout and detect Swipes using GestureListener. On Left or right swipe, cycle through the imageList in appropriate direction and set the image in the ImageView. When you set the image, play appropriate slide left or slide right animation.

Samuh
I found manipulating the default behavior of Gallery widget non-trivial; this is just an alternative.
Samuh
A: 

I have tried with overriding the onFling method of Gallery. It has been close to what I want but not exact. Anyways, thanx a lot for your reply.

sunil