本文整理汇总了Java中android.support.v17.leanback.widget.PlaybackControlsRow.setPrimaryActionsAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java PlaybackControlsRow.setPrimaryActionsAdapter方法的具体用法?Java PlaybackControlsRow.setPrimaryActionsAdapter怎么用?Java PlaybackControlsRow.setPrimaryActionsAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v17.leanback.widget.PlaybackControlsRow
的用法示例。
在下文中一共展示了PlaybackControlsRow.setPrimaryActionsAdapter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupUI
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void setupUI() {
VideoFragment videoFragment = (VideoFragment) getFragmentManager().findFragmentById(R.id.video_fragment);
mGlue = new VideoFragmentGlueHost(videoFragment);
mGlue.setSurfaceHolderCallback(this);
mGlue.setOnActionClickedListener(this);
mControlsRow = new PlaybackControlsRow(mSelectedLink);
ArrayObjectAdapter adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
mPlayPauseAction = new PlaybackControlsRow.PlayPauseAction(this);
mPlayPauseAction.nextIndex(); // set to play
adapter.add(new PlaybackControlsRow.RewindAction(this));
adapter.add(mPlayPauseAction);
adapter.add(new PlaybackControlsRow.FastForwardAction(this));
mControlsRow.setPrimaryActionsAdapter(adapter);
PlaybackControlsRowPresenter presenter = new PlaybackControlsRowPresenter(new DetailsPresenter());
mGlue.setPlaybackRow(mControlsRow);
mGlue.setPlaybackRowPresenter(presenter);
}
示例2: setupPlaybackControlItemsToInitialisingState
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void setupPlaybackControlItemsToInitialisingState() {
mRowsAdapter.clear();
mPlaybackControlsRow = new PlaybackControlsRow(mStreamInfo);
mPlaybackControlsRow.setCurrentTime(0);
mPlaybackControlsRow.setBufferedProgress(0);
ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);
Activity activity = getActivity();
mPlayPauseAction = new PlayPauseAction(activity);
mPrimaryActionsAdapter.add(mPlayPauseAction);
setupSecondaryRowPlaybackControl(presenterSelector);
mRowsAdapter.add(mPlaybackControlsRow);
mRowsAdapter.notifyArrayItemRangeChanged(0, mRowsAdapter.size());
}
示例3: addPlaybackControlsRow
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void addPlaybackControlsRow(MediaMetadata 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);
}
示例4: addPlaybackControlsRow
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
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);
}