4

can someone help me and tell me is this possible in android. I need to have in my app a gridview alike widget, but with different item height and width, like this: enter image description here

So is this possible, and if so, what can I use to achieve this.

Thanks

Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117

4 Answers4

1

For this you need a work around or you can say a third party Library named as "AndroidStaggeredGrid"

You can check it on here

richq
  • 55,548
  • 20
  • 150
  • 144
Usman Kurd
  • 7,212
  • 7
  • 57
  • 86
0

@Darko,

Yes, it it possible to do like this in Android.

There are many ways to implement this. As you said GridView cannot be used to achieve this. For a normal user this will appear has grids.

Ways:

  1. Use fragment for each and every "grid" you can see and each fragment will have its layout to display either 2 or 3 images in grid (No gridview is required here too). Use ImageViews as usually.

  2. If the layout design is same, then you can define a single layout with internal design in the same format. Each row with imageviews - This is not encouraged by the way.

  3. Design layouts for each and every format of design per row. Inflate each particular row to a list (using custom adapter). Based on position in getView() you can control which row design to be added to list. Inbuilt scroll in ListView, so no problem!

I suggest you to go with number #1 or #3. Using fragments you will have better control.

If you come to know any better idea, please share!

Charan
  • 942
  • 1
  • 6
  • 18
0

It's StaggeredGridView

You can find an implementation at https://github.com/bulletnoid/StaggeredGridView

Sahir Saiyed
  • 518
  • 8
  • 17
-3

It's possible using GridLayout. More details in the link.

http://developer.android.com/reference/android/widget/GridLayout.html

Nitin Sethi
  • 1,416
  • 1
  • 11
  • 19