Reputation: 1931
As you know in leanback library there is a ListRowPresenter
which presents its items via HorizontalGridView
. (see its source here) But can we have a Presenter using VerticalGrid
?
I want the last row of my BrowseFragment
becomes vertically scrollable (with how many rows as it need and fixed column number!) and instead of setNumRows
I would write setNumVolumns
...
Is it possible in leanback?
UPDATE 1 :
In order to use a presenter in BrowseFragmen
t, it should be a child of RowPresenter
. VerticalGridPresenter
is not so you can not use it in a browse fragment at all. I am looking for a something like ListRowPresenter
which is built using VerticalGridView
. (ListRowPresenter
uses HorizontalGridView
)
Upvotes: 4
Views: 1681
Reputation: 553
Yes, there is a presenter called VerticalGridPresenter
that exists for this purpose. It has a method public void setNumberOfColumns(int numColumns)
to set the number of columns. If this does not suit your needs you will probably have to write a custom presenter.
Upvotes: 3