0

I have working sample of image gallery.

Now if I have 10 images in gallery, few of them gets displayed initially, lets say 3 (based on image thumbnail dimensions), and rest of the images can be viewed by scrolling the gallery.

I want to change this a bit.
Based on image thumbnail dimensions, few images should be displayed initially and instead of scrolling, there should be previous and next buttons, on click of which images will shift left or right.

Any help appreciated.

GAMA
  • 5,958
  • 14
  • 79
  • 126
  • you cam shift gallery content by using galleryView.setSelection(position)...but it's not much smooth transaction..let me know if u find anything related smooth animation on gallery. – CoDe Oct 26 '12 at 12:19

1 Answers1

1

You can use gallery and onButtonPress call onFling (for smooth scrolling, or simple select next image) event to change selected item. Or you can use LinearLayout, calculate image dimensions runtime, create child imageViews for parent linearLayout and onclick fill this views with your images

dilix
  • 3,761
  • 3
  • 31
  • 55
  • even if i add buttons, how can i stop gallery from scrolling? and gallery animation must remain intact. – GAMA Jul 17 '12 at 11:06
  • and about 2nd suggestion, it'll not give me the gallery's look-and-feel. – GAMA Jul 17 '12 at 11:07
  • for example you can extend default gallery and override onTouch event (return true; //for example) – dilix Jul 17 '12 at 11:18
  • "how can i stop gallery from scrolling" - now you can't scroll this gallery by drag it, only by buttons – dilix Jul 17 '12 at 11:23