Java Code Examples for androidx.leanback.widget.ArrayObjectAdapter#size()

The following examples show how to use androidx.leanback.widget.ArrayObjectAdapter#size() . 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: SelectServerFragment.java    From jellyfin-androidtv with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addAdditionalRows(ArrayObjectAdapter rowAdapter) {
    super.addAdditionalRows(rowAdapter);

    HeaderItem serverHeader = new HeaderItem(rowAdapter.size(), mApplication.getString(R.string.lbl_select_server));
    ItemRowAdapter serverAdapter = new ItemRowAdapter(mServers.toArray(new ServerInfo[0]), new CardPresenter(), rowAdapter);
    serverAdapter.Retrieve();
    rowAdapter.add(new ListRow(serverHeader, serverAdapter));

    HeaderItem gridHeader = new HeaderItem(rowAdapter.size(), mApplication.getString(R.string.lbl_other_options));

    GridButtonPresenter mGridPresenter = new GridButtonPresenter();
    ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(mGridPresenter);
    gridRowAdapter.add(new GridButton(ENTER_MANUALLY, mApplication.getString(R.string.lbl_enter_manually), R.drawable.tile_edit));
    rowAdapter.add(new ListRow(gridHeader, gridRowAdapter));
}
 
Example 2
Source File: EnhancedBrowseFragment.java    From jellyfin-androidtv with GNU General Public License v2.0 6 votes vote down vote up
protected void addAdditionalRows(ArrayObjectAdapter rowAdapter) {
    if (showViews) {
        HeaderItem gridHeader = new HeaderItem(rowAdapter.size(), mApplication.getString(R.string.lbl_views));

        GridButtonPresenter mGridPresenter = new GridButtonPresenter();
        ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(mGridPresenter);
        switch (itemTypeString) {
            case "Movie":
                gridRowAdapter.add(new GridButton(SUGGESTED, mApplication.getString(R.string.lbl_suggested), R.drawable.tile_suggestions));
                addStandardViewButtons(gridRowAdapter);
                break;
            case "MusicAlbum":
                gridRowAdapter.add(new GridButton(ALBUMS, TvApp.getApplication().getString(R.string.lbl_albums), R.drawable.tile_audio));
                gridRowAdapter.add(new GridButton(ARTISTS, TvApp.getApplication().getString(R.string.lbl_artists), R.drawable.tile_artists));
                gridRowAdapter.add(new GridButton(GENRES, mApplication.getString(R.string.lbl_genres), R.drawable.tile_genres));
                gridRowAdapter.add(new GridButton(SEARCH, mApplication.getString(R.string.lbl_search), R.drawable.tile_search));
                break;
            default:
                addStandardViewButtons(gridRowAdapter);
                break;
        }
        rowAdapter.add(new ListRow(gridHeader, gridRowAdapter));

    }

}
 
Example 3
Source File: BrowseFolderFragment.java    From jellyfin-androidtv with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addAdditionalRows(ArrayObjectAdapter rowAdapter) {
    super.addAdditionalRows(rowAdapter);
    if (showViews) {
        HeaderItem gridHeader = new HeaderItem(rowAdapter.size(), mApplication.getString(R.string.lbl_views));

        GridButtonPresenter mGridPresenter = new GridButtonPresenter();
        ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(mGridPresenter);
        gridRowAdapter.add(new GridButton(BY_LETTER, mApplication.getString(R.string.lbl_by_letter), R.drawable.tile_letters));
        if (itemTypeString != null && itemTypeString.equals("Movie"))
            gridRowAdapter.add(new GridButton(SUGGESTED, mApplication.getString(R.string.lbl_suggested), R.drawable.tile_suggestions));
        gridRowAdapter.add(new GridButton(GENRES, mApplication.getString(R.string.lbl_genres), R.drawable.tile_genres));
        gridRowAdapter.add(new GridButton(PERSONS, mApplication.getString(R.string.lbl_performers), R.drawable.tile_actors));
        rowAdapter.add(new ListRow(gridHeader, gridRowAdapter));
    }
}
 
Example 4
Source File: HomeFragmentFooterRow.java    From jellyfin-androidtv with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addToRowsAdapter(CardPresenter cardPresenter, ArrayObjectAdapter rowsAdapter) {
    HeaderItem header = new HeaderItem(rowsAdapter.size(), activity.getString(R.string.lbl_settings));
    GridButtonPresenter presenter = new GridButtonPresenter();

    ArrayObjectAdapter adapter = new ArrayObjectAdapter(presenter);
    adapter.add(new GridButton(SETTINGS, activity.getString(R.string.lbl_settings), R.drawable.tile_settings));
    adapter.add(new GridButton(LOGOUT, activity.getString(R.string.lbl_logout), R.drawable.tile_logout));

    rowsAdapter.add(new ListRow(header, adapter));
}
 
Example 5
Source File: BrowseRecordingsFragment.java    From jellyfin-androidtv with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void addAdditionalRows(ArrayObjectAdapter rowAdapter) {
    HeaderItem gridHeader = new HeaderItem(rowAdapter.size(), mApplication.getString(R.string.lbl_views));

    GridButtonPresenter mGridPresenter = new GridButtonPresenter();
    ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(mGridPresenter);
    gridRowAdapter.add(new GridButton(SCHEDULE, TvApp.getApplication().getString(R.string.lbl_schedule), R.drawable.tile_port_time));
    gridRowAdapter.add(new GridButton(SERIES, mActivity.getString(R.string.lbl_series_recordings), R.drawable.tile_port_series_timer));
    rowAdapter.add(new ListRow(gridHeader, gridRowAdapter));
}