Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a ListRowPresenter which uses VerticalGrid instead of HorizontalGridView?

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 BrowseFragment, 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)

like image 591
Saleh Avatar asked Oct 19 '25 05:10

Saleh


1 Answers

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.

like image 76
Benjamin Breiby Avatar answered Oct 21 '25 20:10

Benjamin Breiby