If I'm understanding you correctly, you are asking if there is a way to simply ignore certain items passed into the adapter for a GridView
? No there is not. You would have to remove the items you wish to skip from the adapter. Otherwise, you could do what that link suggested in that you simply draw a blank space for any item you want to skip.
Update
Well, when I put my idea for you on paper it didn't pan out. The ultimate solution requires some heavy customization on not just the adapter side but also on the widget side. What you need (and what I was trying to do) is a way to organize the images via it's ordering type. So you'd have a list of images for those that start with 'a'. And another list of images for those that start with 'b'. Then use a Map
of the ordering type to find those lists. The problem is that the normal ListAdapter
just doesn't cater to this setup. What would is an ExpandableListAdapter
. Your problem could easily be solved with an ExpandableListView
if it supported GridView
I found this post where the code for a custom ExpandableGridView was created. The person posting the question was looking for a solution for a similar problem. I suggest trying it out and seeing if it works for you.
There's also this open source library that seems to have a lot of attention: ExpandableGridView