Like many things in Android, you wouldn't think this would be such a hard problem but ohhh, by golly, would you be wrong. And, like many things in Android, the API doesn't even provide a reasonably extensible starting point. I'll be damned if I'm going to roll my own ListView, when all I want is to take the thing and turn it on its side. \rant
Okay, now that I'm done fuming, let's talk about the problem itself. What I need is basically something exactly like the Gallery
, but without the center-locking feature. I don't really need ListView
's listSelector but it's a nice-to-have. Mostly, I could do what I want with a LinearLayout
inside a ScrollView
, but I need the child views to come from a ListAdapter
and I would really like to have a view recycler. And I really don't want to write any layout code.
I peeked into the source code for some of these classes...
Gallery: It looks like I could use the Gallery if I override most of the 'onXyz' methods, copy all their source code, but refrain from calling scrollIntoSlots()
. But I'm sure that if I do that I'll run into some member field that's inaccessible or some other unforeseen consequence.
AbsSpinner: Since the mRecycler
field is package-private I doubt I'll be able to extend this class.
AbsListView: It looks like this class is only meant for vertical scrolling, so no help there.
AdapterView: I've never had to extend this class directly. If you tell me it's easy to do, and that it's easy to roll my own RecycleBin
, I'll be very skeptical but I'll give it a shot.
I suppose I could possibly copy both AbsSpinner
and Gallery
to get what I want... hopefully those classes aren't using some package-private variable I can't access. Do y'all think that's a good practice? Does anyone have any tutorials or third-party solutions that might put me in the right direction?