In the Google Play app, how is the ViewGroup showi

2019-01-18 06:38发布

问题:

The Google Play application presents the top lists of different categories in a GridView-like way (screenshot). I'm pretty sure that it's not a standard GridView, since when I scroll all the way to the bottom, it shows a screen-wide "Loading" item, which is not possible with standard GridViews to my knowledge.

Can I find the code for this ViewGroup somewhere? If not what would be the best way to implement such a ViewGroup? I was thinking about handling this with ListView, but it'd require a quite messy adapter that puts multiple list-items in a single row, according to the screen-width available.

回答1:

To answer my own question:

I disassembled the Google Play app and found that they're using simple ListView here, with a BucketListAdapter. This adapter presents the list-elements in a GridView-like way, splitting them to columns. This way they could also use list footers and headers.

I've rolled my own implementation of this, if anyone's interested, it can be found here: https://github.com/rzsombor/bucket-list-adapter. It's still working in progress stuff however.