Search in sources :

Example 1 with VerticalGridPresenter

use of android.support.v17.leanback.widget.VerticalGridPresenter in project android-UniversalMusicPlayer by googlesamples.

the class TvVerticalGridFragment method setupFragment.

private void setupFragment() {
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter();
    gridPresenter.setNumberOfColumns(NUM_COLUMNS);
    setGridPresenter(gridPresenter);
    mAdapter = new ArrayObjectAdapter(new CardPresenter(getActivity()));
    setAdapter(mAdapter);
    setOnItemViewClickedListener(new ItemViewClickedListener());
}
Also used : VerticalGridPresenter(android.support.v17.leanback.widget.VerticalGridPresenter) OnItemViewClickedListener(android.support.v17.leanback.widget.OnItemViewClickedListener) ArrayObjectAdapter(android.support.v17.leanback.widget.ArrayObjectAdapter)

Example 2 with VerticalGridPresenter

use of android.support.v17.leanback.widget.VerticalGridPresenter in project vlc-android by videolan.

the class GridFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = getActivity();
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter();
    gridPresenter.setNumberOfColumns(NUM_COLUMNS);
    setGridPresenter(gridPresenter);
    mAdapter = new ArrayObjectAdapter(new CardPresenter(mContext));
    mAdapter.clear();
    setAdapter(mAdapter);
}
Also used : VerticalGridPresenter(android.support.v17.leanback.widget.VerticalGridPresenter) CardPresenter(org.videolan.vlc.gui.tv.CardPresenter) ArrayObjectAdapter(android.support.v17.leanback.widget.ArrayObjectAdapter)

Example 3 with VerticalGridPresenter

use of android.support.v17.leanback.widget.VerticalGridPresenter in project vlc-android by GeoffreyMetais.

the class GridFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = getActivity();
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter();
    gridPresenter.setNumberOfColumns(NUM_COLUMNS);
    setGridPresenter(gridPresenter);
    mAdapter = new ArrayObjectAdapter(new CardPresenter(mContext));
    mAdapter.clear();
    setAdapter(mAdapter);
}
Also used : VerticalGridPresenter(android.support.v17.leanback.widget.VerticalGridPresenter) CardPresenter(org.videolan.vlc.gui.tv.CardPresenter) ArrayObjectAdapter(android.support.v17.leanback.widget.ArrayObjectAdapter)

Example 4 with VerticalGridPresenter

use of android.support.v17.leanback.widget.VerticalGridPresenter in project butter-android by butterproject.

the class TVMediaGridFragment method setupUi.

private void setupUi() {
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter();
    gridPresenter.setNumberOfColumns(NUM_COLUMNS);
    setGridPresenter(gridPresenter);
    ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
    presenterSelector.addClassPresenter(MediaCardItem.class, new MediaCardPresenter(getActivity(), picasso));
    presenterSelector.addClassPresenter(LoadingCardItem.class, new LoadingCardPresenter(getActivity()));
    adapter = new GridPagingAdapter(presenterSelector);
    setAdapter(adapter);
    pagingManager = new GridPagingManager<>();
    pagingManager.init(NUM_COLUMNS, adapter, this);
    setOnItemViewClickedListener(this);
    setOnItemViewSelectedListener(this);
}
Also used : GridPagingAdapter(butter.droid.tv.manager.internal.paging.GridPagingAdapter) VerticalGridPresenter(android.support.v17.leanback.widget.VerticalGridPresenter) LoadingCardPresenter(butter.droid.tv.presenters.LoadingCardPresenter) ClassPresenterSelector(android.support.v17.leanback.widget.ClassPresenterSelector) MediaCardPresenter(butter.droid.tv.presenters.MediaCardPresenter)

Aggregations

VerticalGridPresenter (android.support.v17.leanback.widget.VerticalGridPresenter)4 ArrayObjectAdapter (android.support.v17.leanback.widget.ArrayObjectAdapter)3 CardPresenter (org.videolan.vlc.gui.tv.CardPresenter)2 ClassPresenterSelector (android.support.v17.leanback.widget.ClassPresenterSelector)1 OnItemViewClickedListener (android.support.v17.leanback.widget.OnItemViewClickedListener)1 GridPagingAdapter (butter.droid.tv.manager.internal.paging.GridPagingAdapter)1 LoadingCardPresenter (butter.droid.tv.presenters.LoadingCardPresenter)1 MediaCardPresenter (butter.droid.tv.presenters.MediaCardPresenter)1