1

I've got a little problem;

I've been searching for something like a horizontal listview, the almost perfect I found was the Gallery, I even got it working. Thing is: it's too old :P

Now I found a perfect replacement the "Viewpager", but I can't seem to find a way to use something like an Arrayadapter to fill the Viewpager like a listview.

Can someone help me with an example or give me something else I should use?

Thanks in advance ;)

DjeDjeDiego
  • 21
  • 1
  • 4
  • Look here, http://stackoverflow.com/q/10082163/1323014, if you have more question, ask me. – Marckaraujo Jan 25 '13 at 19:08
  • Thank you for your comment, but I believe that's not what I want exactly. What I basically want is a horizontal listview which'll get a page in the middle (just like Galley). And Gallery is exactly what I want, expect that it isn't supported anymore. And is it possible to make Arrayadapter as Adapter of the ViewPager? – DjeDjeDiego Jan 29 '13 at 08:07
  • Gallery is still supported, do you want a working code? – Marckaraujo Jan 29 '13 at 12:04
  • What I meant was that Gallery was deprecated since API 16 and the sad thing is that I already used it and made a working thing. What I want (if possible) is to change the gallery. Making a Horizontalscrollview or a ViewPager where it inflates and gets the text of Textview from an enum (an array I guess). And inflate it just like Gallery did or like Listview does. But all I can find about Viewpager is that you need to set each page with it's own layout and all. So can you help me with that? Like with code or a link which is a bit in my direction. Sorry for the stupidness of my question :P – DjeDjeDiego Jan 29 '13 at 19:42

2 Answers2

1

Check this out: http://spacetech.dk/android-viewpager-with-listview-pages.html

Only thing left to do is to replace in your layout this:

android:orientation="vertical"

with this:

android:orientation="horizontal"

Hope this helped.

Saran
  • 3,845
  • 3
  • 37
  • 59
  • I tried it, but the thing is, the orientation doesn't matter here. I tested it, but do you know by what I should do to make a Gallery without the use of Gallery sins it's deprecated? – DjeDjeDiego Jan 30 '13 at 21:13
  • Possibly this can help you: https://github.com/JakeWharton/Android-DirectionalViewPager/ – Saran Feb 04 '13 at 16:24
0

Two Way Gridview https://github.com/jess-anders/two-way-gridview the easiest. While viewpager has its own PagerAdapter

Dev Gurung
  • 1,290
  • 14
  • 16