Search in sources :

Example 1 with CustomListRowPresenter

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

the class PlaybackFragment method initPresenters.

private void initPresenters() {
    mRowPresenter = new CustomListRowPresenter() {

        @Override
        protected void onBindRowViewHolder(RowPresenter.ViewHolder holder, Object item) {
            super.onBindRowViewHolder(holder, item);
            // Set position of item inside first row (playlist items)
            if (mRowsSupportFragment != null && mRowsSupportFragment.getVerticalGridView().getSelectedPosition() == 0) {
                int index = getSuggestedItemIndex();
                if (index > 0) {
                    ViewHolder vh = (ViewHolder) holder;
                    vh.getGridView().setSelectedPosition(index);
                }
            }
        }

        @Override
        protected void onRowViewSelected(RowPresenter.ViewHolder holder, boolean selected) {
            super.onRowViewSelected(holder, selected);
            updatePlayerBackground();
        }
    };
    mCardPresenter = new VideoCardPresenter();
}
Also used : ViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder) ViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder) VideoCardPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.VideoCardPresenter) CustomListRowPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomListRowPresenter) RowPresenter(androidx.leanback.widget.RowPresenter) ListRowPresenter(androidx.leanback.widget.ListRowPresenter) CustomListRowPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomListRowPresenter)

Example 2 with CustomListRowPresenter

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

the class SearchTagsFragmentBase method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mProgressBarManager = new ProgressBarManager();
    mResultsPresenter = new CustomListRowPresenter();
    mResultsAdapter = new ArrayObjectAdapter(mResultsPresenter);
    mSearchTagsAdapter = new TagAdapter(getActivity(), "");
    setSearchResultProvider(this);
    setupListeners();
}
Also used : TagAdapter(com.liskovsoft.smartyoutubetv2.tv.adapter.vineyard.TagAdapter) ProgressBarManager(com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.misc.ProgressBarManager) ArrayObjectAdapter(androidx.leanback.widget.ArrayObjectAdapter) CustomListRowPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomListRowPresenter)

Example 3 with CustomListRowPresenter

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

the class MultipleRowsFragment method setupAdapter.

private void setupAdapter() {
    if (mVideoGroupAdapters == null) {
        mVideoGroupAdapters = new HashMap<>();
    }
    if (mRowsAdapter == null) {
        mRowPresenter = new CustomListRowPresenter();
        mRowsAdapter = new ArrayObjectAdapter(mRowPresenter);
        setAdapter(mRowsAdapter);
    }
}
Also used : ArrayObjectAdapter(androidx.leanback.widget.ArrayObjectAdapter) CustomListRowPresenter(com.liskovsoft.smartyoutubetv2.tv.presenter.CustomListRowPresenter)

Aggregations

CustomListRowPresenter (com.liskovsoft.smartyoutubetv2.tv.presenter.CustomListRowPresenter)3 ArrayObjectAdapter (androidx.leanback.widget.ArrayObjectAdapter)2 ListRowPresenter (androidx.leanback.widget.ListRowPresenter)1 RowPresenter (androidx.leanback.widget.RowPresenter)1 ViewHolder (androidx.leanback.widget.RowPresenter.ViewHolder)1 TagAdapter (com.liskovsoft.smartyoutubetv2.tv.adapter.vineyard.TagAdapter)1 VideoCardPresenter (com.liskovsoft.smartyoutubetv2.tv.presenter.VideoCardPresenter)1 ProgressBarManager (com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.misc.ProgressBarManager)1