3

I've a design, where I have to have multiple headers while using VerticalGridSupportFragment. I know, that headers can be easily added if you use ListRow, where you just pass in headerItem and adapter, but if not mistaken, then that is not a possibility for VGS Fragment.

How can I achieve this? Maybe small example?

The data I have:

BIG-OBJ:
    title: "1"
    list-of-small-objs: small1, small2, small3
BIG-OBJ2:
    title: "2"
    list-of-small-objs: small1, small2, small3
...

Image of the idea:

enter image description here

So I want to display headerItem as BIG-OBJ.title and it's content as BIG-OBJ.list-of-small-objs.

  1. Can this be done using VGS Fragment?
  2. Small example of the same idea would be great.
MaaAn13
  • 264
  • 5
  • 24
  • 54

1 Answers1

2

VerticalGridSupportFragment is for creating leanback vertical grids that renders a vertical grid of objects given a VerticalGridPresenter and an ObjectAdapter.

I think you can use HeadersSupportFragment that contains a list of row headers.

You can check the code from this blog post.

Jessica Rodriguez
  • 2,899
  • 1
  • 12
  • 27