Search in sources :

Example 1 with PlayPauseAction

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

the class TvPlaybackFragment method addPlaybackControlsRow.

private void addPlaybackControlsRow(MediaMetadataCompat metadata) {
    mPlaybackControlsRow = new PlaybackControlsRow(new MutableMediaMetadataHolder(metadata));
    mRowsAdapter.add(mPlaybackControlsRow);
    resetPlaybackRow();
    ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
    mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
    mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);
    mPlayPauseAction = new PlayPauseAction(getActivity());
    mSkipNextAction = new PlaybackControlsRow.SkipNextAction(getActivity());
    mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(getActivity());
    mPrimaryActionsAdapter.add(mSkipPreviousAction);
    mPrimaryActionsAdapter.add(mPlayPauseAction);
    mPrimaryActionsAdapter.add(mSkipNextAction);
}
Also used : SkipPreviousAction(android.support.v17.leanback.widget.PlaybackControlsRow.SkipPreviousAction) PlayPauseAction(android.support.v17.leanback.widget.PlaybackControlsRow.PlayPauseAction) ArrayObjectAdapter(android.support.v17.leanback.widget.ArrayObjectAdapter) SkipNextAction(android.support.v17.leanback.widget.PlaybackControlsRow.SkipNextAction) ControlButtonPresenterSelector(android.support.v17.leanback.widget.ControlButtonPresenterSelector) PlaybackControlsRow(android.support.v17.leanback.widget.PlaybackControlsRow)

Aggregations

ArrayObjectAdapter (android.support.v17.leanback.widget.ArrayObjectAdapter)1 ControlButtonPresenterSelector (android.support.v17.leanback.widget.ControlButtonPresenterSelector)1 PlaybackControlsRow (android.support.v17.leanback.widget.PlaybackControlsRow)1 PlayPauseAction (android.support.v17.leanback.widget.PlaybackControlsRow.PlayPauseAction)1 SkipNextAction (android.support.v17.leanback.widget.PlaybackControlsRow.SkipNextAction)1 SkipPreviousAction (android.support.v17.leanback.widget.PlaybackControlsRow.SkipPreviousAction)1