1

I'm using an approach for this thread in order to make gallery change one image per swipe. My problem is that for this image-change to happen user has to drag image for at least 50% of the width of the gallery, which can become unacceptable on large devices.

So, I need to make the drag-distance smaller than it is now(50% by default). How can I achieve it ?

Community
  • 1
  • 1
user1462299
  • 4,247
  • 5
  • 22
  • 30

1 Answers1

2

I would suggest two options:

1: Instead of the Gallery use the ViewPager from the Support Library. When using the ViewPager you only drag one page at a time without the carousel effect of the gallery.

http://developer.android.com/reference/android/support/v4/view/ViewPager.html

2: If you want to stick with the Gallery: Yaaic (an IRC client) used the Gallery as well in earlier versions and it was too easy to scroll several pages with one fling so we reduced the sensitivity of the Gallery in this commit:

https://github.com/pocmo/Yaaic/commit/db91a85676210c7f36510861c38b935d87d65bb9

pocmo
  • 660
  • 6
  • 24
  • I've found a solution http://stackoverflow.com/questions/2373617/how-to-stop-scrolling-in-a-gallery-widget, but thanks for your suggestions ! – user1462299 Jul 03 '12 at 09:34