use of android.support.v17.leanback.widget.ControlButtonPresenterSelector 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);
}
Aggregations