0

I'm trying to get a layout design like this and for that I'm using the GitHub library https://github.com/maurycyw/StaggeredGridView as recommendation made in other questions in this website. My problem is that I can't get a design like that, with colls and rows that are spanned. This library requires as atribute the number of colls that you want to use but in the image I put in this question, you don't have a fixed number of colls so I suppossed that maybe exists some span.

I have already downloaded the author sample project but I can't advance in the good way. This sample offers an app with 2 cols and the views are inflated like Pinterest style but as image show, it has spanned cols, some rows have 2 items, other 3...

enter image description here

In my custom adapter that extends from BaseAdapter, in getView() method, I use LayoutParams, the property span, to set the num of cols that I want to put together but the app always crash. I don't know if this library really can do this.

I have tried other solutions. I used the StaggeredView class that was in support V4 but now that class is deleted from the .jar. With that library I get to make work but I cant work with that because I use the latest and some method and properties dont exist any more. (I followed this one https://github.com/chrisjenx/StaggeredGridView that worked with Google class)

Other thing I though is use a ListView inflating a complex relativelayout and then put inside the elements.

I also tried this other library https://github.com/felipecsl/AsymmetricGridView but only support 2 span.

It's easy to do with a GridLayout but I need ListView that supports recycling.

korima
  • 306
  • 5
  • 12
  • Did you tried this https://github.com/huewu/PinterestLikeAdapterView – Biraj Zalavadia Oct 22 '14 at 09:03
  • I have not tried that library but the title suggest a Pinterest style and the image I put I think is other kind of display. In Pinterest I think there isnt spanned cols. – korima Oct 22 '14 at 09:07
  • 1
    I think this was created by listview with different view layout for each row. – mmlooloo Oct 22 '14 at 09:40
  • @mmlooloo I supposed too. And then, for each row I inflate in getView() method, I set on that the items I want? I mean, I don't have to inflate a view for each item. I have to inflate a full row and control inside the method the items that I have to set on it, not? – korima Oct 22 '14 at 10:02

0 Answers0