-1

I'd like to recreate the same Layout as the Android Spotify app but i'm not sure what kind of layout to use.

What i basically want to do is this:

[Header] <-- TextView

[][][][] <--- Horizontal ListView

[sub-header] <-- TextView

[] []

[] []

[] [] <-- GridView with 2 columns (that i can dynamically add items)

And i want the entire screen to be scrollable.

Do i need tu use a ScrollView? how can i put a GridView in?

1 Answers1

0

You can use listView and gridView. You don't need a scrollView. The trick will be creating custom adapters for your ListView and GridView. In those adapters, you can overwrite the "getView" method and programatically add items (like imageViews, etc.) You add the listview and gridview in the xml file, and then populate them with other items using the adapter.

An example of creating a custom adapter can be found here.

Community
  • 1
  • 1
bguggs
  • 46
  • 3
  • Thanks for that answer! Finally, I used the library [Bucket List Adapter](https://github.com/rzsombor/bucket-list-adapter) with this lib I can use a Header for my "GridView". I put the `HorizontalListView` in that Header. The only problem with that library is that I can't properly add the number of columns i want for the "GridView" that is actually a ListView but otherwise, that works well. – Alexandre Nussbaumer Jul 23 '14 at 07:45