android.support.v17.leanback.widget.HorizontalGridView Java Examples

The following examples show how to use android.support.v17.leanback.widget.HorizontalGridView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RowsSupportFragment.java    From adt-leanback-support with Apache License 2.0 6 votes vote down vote up
private void setupSharedViewPool(ItemBridgeAdapter.ViewHolder bridgeVh) {
    RowPresenter rowPresenter = (RowPresenter) bridgeVh.getPresenter();
    RowPresenter.ViewHolder rowVh = rowPresenter.getRowViewHolder(bridgeVh.getViewHolder());

    if (rowVh instanceof ListRowPresenter.ViewHolder) {
        HorizontalGridView view = ((ListRowPresenter.ViewHolder) rowVh).getGridView();
        // Recycled view pool is shared between all list rows
        if (mRecycledViewPool == null) {
            mRecycledViewPool = view.getRecycledViewPool();
        } else {
            view.setRecycledViewPool(mRecycledViewPool);
        }

        ItemBridgeAdapter bridgeAdapter =
                ((ListRowPresenter.ViewHolder) rowVh).getBridgeAdapter();
        if (mPresenterMapper == null) {
            mPresenterMapper = bridgeAdapter.getPresenterMapper();
        } else {
            bridgeAdapter.setPresenterMapper(mPresenterMapper);
        }
    }
}
 
Example #2
Source File: RowsFragment.java    From adt-leanback-support with Apache License 2.0 6 votes vote down vote up
private void setupSharedViewPool(ItemBridgeAdapter.ViewHolder bridgeVh) {
    RowPresenter rowPresenter = (RowPresenter) bridgeVh.getPresenter();
    RowPresenter.ViewHolder rowVh = rowPresenter.getRowViewHolder(bridgeVh.getViewHolder());

    if (rowVh instanceof ListRowPresenter.ViewHolder) {
        HorizontalGridView view = ((ListRowPresenter.ViewHolder) rowVh).getGridView();
        // Recycled view pool is shared between all list rows
        if (mRecycledViewPool == null) {
            mRecycledViewPool = view.getRecycledViewPool();
        } else {
            view.setRecycledViewPool(mRecycledViewPool);
        }

        ItemBridgeAdapter bridgeAdapter =
                ((ListRowPresenter.ViewHolder) rowVh).getBridgeAdapter();
        if (mPresenterMapper == null) {
            mPresenterMapper = bridgeAdapter.getPresenterMapper();
        } else {
            bridgeAdapter.setPresenterMapper(mPresenterMapper);
        }
    }
}
 
Example #3
Source File: BrowseFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
private boolean isVerticalScrolling() {
    // don't run transition
    return mHeadersFragment.getVerticalGridView().getScrollState()
            != HorizontalGridView.SCROLL_STATE_IDLE
            || mRowsFragment.getVerticalGridView().getScrollState()
            != HorizontalGridView.SCROLL_STATE_IDLE;
}
 
Example #4
Source File: BrowseSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
private boolean isVerticalScrolling() {
    // don't run transition
    return mHeadersSupportFragment.getVerticalGridView().getScrollState()
            != HorizontalGridView.SCROLL_STATE_IDLE
            || mRowsSupportFragment.getVerticalGridView().getScrollState()
            != HorizontalGridView.SCROLL_STATE_IDLE;
}
 
Example #5
Source File: TVDemoActivity.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private boolean isVerticalScrolling() {
	try {
		// don't run transition
		return getVerticalGridView(headersFragment).getScrollState()
				!= HorizontalGridView.SCROLL_STATE_IDLE
				|| getVerticalGridView(rowsFragment).getScrollState()
				!= HorizontalGridView.SCROLL_STATE_IDLE;
	} catch (Exception e) {
		e.printStackTrace();
	}

	return false;
}
 
Example #6
Source File: MainActivity.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
private boolean isVerticalScrolling() {
    try {
        // don't run transition
        return getVerticalGridView(headersFragment).getScrollState()
                != HorizontalGridView.SCROLL_STATE_IDLE
                || getVerticalGridView(rowsFragment).getScrollState()
                != HorizontalGridView.SCROLL_STATE_IDLE;
    } catch (Exception e) {
        e.printStackTrace();
    }

    return false;
}
 
Example #7
Source File: LiveDataRowPresenter.java    From leanback-showcase with Apache License 2.0 4 votes vote down vote up
public LiveDataRowPresenterViewHolder(View rootView, HorizontalGridView gridView, ListRowPresenter p) {
    super(rootView, gridView, p);
}