18

I was really surprised that such a Widget gets deprecated.
I want a simple gallery that scrolls left and right, shows a picture on the whole Activity screen, and most important is that you cant swipe more than 1 image in any direction, even if the scroll speed is fast it changes to the next image.

So which Widget should I use? Or should I use a simple ImageView and handle all the swipes and add an animation?

Omar
  • 7,085
  • 13
  • 58
  • 106

1 Answers1

24

It states in the docs:

This widget is no longer supported. Other horizontally scrolling widgets include HorizontalScrollView and ViewPager from the support library.

HorizontalScrollView will be closer to what you are looking for I think.

I suspect that Gallery was deprecated because it did not properly use convertView with its adapter. Which meant that it had to create a new view for every item which was a drain on performance.

Another option you have is to use the 3rd party created EcoGallery which Joseph Earl created to overcome the issue, this version does recycle its views properly. Unfortunately that pastebin link is the only reference to it I can find online now.

FoamyGuy
  • 45,328
  • 16
  • 118
  • 151
  • 3
    If OP wants only 1 image to be swiped at a time, wouldn't ViewPager the closer one? Unless he wants it to be continuous... – yarian Dec 17 '12 at 22:50