Search in sources :

Example 1 with InfoCardPresenter

use of org.jellyfin.androidtv.ui.presentation.InfoCardPresenter in project jellyfin-androidtv by jellyfin.

the class FullDetailsActivity method addInfoRows.

private void addInfoRows(ArrayObjectAdapter adapter) {
    if (KoinJavaComponent.<UserPreferences>get(UserPreferences.class).get(UserPreferences.Companion.getDebuggingEnabled()) && mBaseItem.getMediaSources() != null) {
        for (MediaSourceInfo ms : mBaseItem.getMediaSources()) {
            if (ms.getMediaStreams() != null && ms.getMediaStreams().size() > 0) {
                HeaderItem header = new HeaderItem("Media Details" + (ms.getContainer() != null ? " (" + ms.getContainer() + ")" : ""));
                ArrayObjectAdapter infoAdapter = new ArrayObjectAdapter(new InfoCardPresenter());
                for (MediaStream stream : ms.getMediaStreams()) {
                    infoAdapter.add(stream);
                }
                adapter.add(new ListRow(header, infoAdapter));
            }
        }
    }
}
Also used : UserPreferences(org.jellyfin.androidtv.preference.UserPreferences) MediaStream(org.jellyfin.apiclient.model.entities.MediaStream) HeaderItem(androidx.leanback.widget.HeaderItem) ArrayObjectAdapter(androidx.leanback.widget.ArrayObjectAdapter) ListRow(androidx.leanback.widget.ListRow) MediaSourceInfo(org.jellyfin.apiclient.model.dto.MediaSourceInfo) InfoCardPresenter(org.jellyfin.androidtv.ui.presentation.InfoCardPresenter)

Aggregations

ArrayObjectAdapter (androidx.leanback.widget.ArrayObjectAdapter)1 HeaderItem (androidx.leanback.widget.HeaderItem)1 ListRow (androidx.leanback.widget.ListRow)1 UserPreferences (org.jellyfin.androidtv.preference.UserPreferences)1 InfoCardPresenter (org.jellyfin.androidtv.ui.presentation.InfoCardPresenter)1 MediaSourceInfo (org.jellyfin.apiclient.model.dto.MediaSourceInfo)1 MediaStream (org.jellyfin.apiclient.model.entities.MediaStream)1