Search in sources :

Example 1 with CustomVerticalGridPresenter

use of com.liskovsoft.smartyoutubetv2.tv.presenter.CustomVerticalGridPresenter in project SmartTubeNext by yuliskov.

the class VideoGridFragment method setupAdapter.

private void setupAdapter() {
    VerticalGridPresenter presenter = new CustomVerticalGridPresenter();
    presenter.setNumberOfColumns(GridFragmentHelper.getMaxColsNum(getContext(), R.dimen.card_width, mVideoGridScale));
    setGridPresenter(presenter);
    if (mGridAdapter == null) {
        mGridAdapter = new VideoGroupObjectAdapter(mCardPresenter);
        setAdapter(mGridAdapter);
    }
}
Also used : CustomVerticalGridPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomVerticalGridPresenter) VerticalGridPresenter(androidx.leanback.widget.VerticalGridPresenter) CustomVerticalGridPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomVerticalGridPresenter) VideoGroupObjectAdapter(com.liskovsoft.smartyoutubetv2.tv.adapter.VideoGroupObjectAdapter)

Example 2 with CustomVerticalGridPresenter

use of com.liskovsoft.smartyoutubetv2.tv.presenter.CustomVerticalGridPresenter in project SmartTubeNext by yuliskov.

the class MultiVideoGridFragment method setupAdapter.

private void setupAdapter() {
    // Left vertical list of channels
    VerticalGridPresenter presenter1 = new CustomVerticalGridPresenter(R.layout.lb_vertical_grid1, R.id.browse_grid1);
    presenter1.setNumberOfColumns(1);
    // Right grid of channel's content
    VerticalGridPresenter presenter2 = new CustomVerticalGridPresenter(R.layout.lb_vertical_grid2, R.id.browse_grid2);
    presenter2.setNumberOfColumns(GridFragmentHelper.getMaxColsNum(getContext(), R.dimen.card_width, mVideoGridScale) - 1);
    setGridPresenter1(presenter1);
    setGridPresenter2(presenter2);
    if (mGridAdapter1 == null) {
        mGridAdapter1 = new VideoGroupObjectAdapter(mCardPresenter1);
        setAdapter1(mGridAdapter1);
    }
    if (mGridAdapter2 == null) {
        mGridAdapter2 = new VideoGroupObjectAdapter(mCardPresenter2);
        setAdapter2(mGridAdapter2);
    }
}
Also used : CustomVerticalGridPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomVerticalGridPresenter) VerticalGridPresenter(androidx.leanback.widget.VerticalGridPresenter) CustomVerticalGridPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomVerticalGridPresenter) VideoGroupObjectAdapter(com.liskovsoft.smartyoutubetv2.tv.adapter.VideoGroupObjectAdapter)

Aggregations

VerticalGridPresenter (androidx.leanback.widget.VerticalGridPresenter)2 VideoGroupObjectAdapter (com.liskovsoft.smartyoutubetv2.tv.adapter.VideoGroupObjectAdapter)2 CustomVerticalGridPresenter (com.liskovsoft.smartyoutubetv2.tv.presenter.CustomVerticalGridPresenter)2