本文整理汇总了Java中android.support.v17.leanback.widget.PlaybackControlsRowPresenter类的典型用法代码示例。如果您正苦于以下问题:Java PlaybackControlsRowPresenter类的具体用法?Java PlaybackControlsRowPresenter怎么用?Java PlaybackControlsRowPresenter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlaybackControlsRowPresenter类属于android.support.v17.leanback.widget包,在下文中一共展示了PlaybackControlsRowPresenter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupUI
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的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: createControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
getControlsRow().setSecondaryActionsAdapter(adapter);
mFastForwardAction = (PlaybackControlsRow.FastForwardAction) getPrimaryActionsAdapter()
.lookup(ACTION_FAST_FORWARD);
mRewindAction = (PlaybackControlsRow.RewindAction) getPrimaryActionsAdapter()
.lookup(ACTION_REWIND);
presenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
dispatchAction(action);
}
});
return presenter;
}
示例3: initUi
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void initUi() {
PlaybackControlsRowPresenter presenter = mediaControllerHelper.createControlsRowAndPresenter();
rows = new ArrayObjectAdapter(presenter);
rows.add(mediaControllerHelper.getControlsRow());
setAdapter(rows);
setOnItemViewClickedListener(new OnItemViewClickedListener() {
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
RowPresenter.ViewHolder rowViewHolder, Row row) {
if (item instanceof Action) {
mediaControllerHelper.onActionClicked((Action) item);
}
}
});
}
示例4: createControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
ArrayObjectAdapter adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
getControlsRow().setSecondaryActionsAdapter(adapter);
mFastForwardAction = (PlaybackControlsRow.FastForwardAction) getPrimaryActionsAdapter()
.lookup(ACTION_FAST_FORWARD);
mRewindAction = (PlaybackControlsRow.RewindAction) getPrimaryActionsAdapter()
.lookup(ACTION_REWIND);
// odebrani zbytecnych tlacitek
/*
adapter.add(mThumbsDownAction);
adapter.add(mRepeatAction);
adapter.add(mThumbsUpAction);
*/
if (PlaybackOverlayActivity.supportsPictureInPicture(getContext())) {
adapter.add(mPipAction);
}
presenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
dispatchAction(action);
}
});
return presenter;
}
示例5: onStart
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public void onStart() {
super.onStart();
// Set up UI
Video video = getActivity().getIntent().getParcelableExtra(VideoDetailsActivity.VIDEO);
if (!updateSelectedVideo(video)) {
return;
}
mGlue = new PlaybackControlHelper(getActivity(), this, mSelectedVideo);
PlaybackControlsRowPresenter controlsRowPresenter = mGlue.createControlsRowAndPresenter();
PlaybackControlsRow controlsRow = mGlue.getControlsRow();
mMediaControllerCallback = mGlue.createMediaControllerCallback();
mMediaController = getActivity().getMediaController();
mMediaController.registerCallback(mMediaControllerCallback);
ClassPresenterSelector ps = new ClassPresenterSelector();
ps.addClassPresenter(PlaybackControlsRow.class, controlsRowPresenter);
ps.addClassPresenter(ListRow.class, new ListRowPresenter());
mRowsAdapter = new ArrayObjectAdapter(ps);
mRowsAdapter.add(controlsRow);
addOtherRows();
updatePlaybackRow();
setAdapter(mRowsAdapter);
startPlaying();
}
示例6: createControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
ArrayObjectAdapter adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
getControlsRow().setSecondaryActionsAdapter(adapter);
mFastForwardAction = (PlaybackControlsRow.FastForwardAction) getPrimaryActionsAdapter()
.lookup(ACTION_FAST_FORWARD);
mRewindAction = (PlaybackControlsRow.RewindAction) getPrimaryActionsAdapter()
.lookup(ACTION_REWIND);
adapter.add(mThumbsDownAction);
adapter.add(mRepeatAction);
adapter.add(mThumbsUpAction);
if (PlaybackOverlayActivity.supportsPictureInPicture(getContext())) {
adapter.add(mPipAction);
}
presenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
dispatchAction(action);
}
});
return presenter;
}
示例7: onStart
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public void onStart() {
super.onStart();
// Set up UI
Video video = getActivity().getIntent().getParcelableExtra(VideoDetailsActivity.VIDEO);
if (!updateSelectedVideo(video)) {
return;
}
mGlue = new PlaybackControlHelper(getActivity(), this, mSelectedVideo);
PlaybackControlsRowPresenter controlsRowPresenter = mGlue.createControlsRowAndPresenter();
PlaybackControlsRow controlsRow = mGlue.getControlsRow();
mMediaControllerCallback = mGlue.createMediaControllerCallback();
//
mMediaController = getActivity().getMediaController();
mMediaController.registerCallback(mMediaControllerCallback);
//
ClassPresenterSelector ps = new ClassPresenterSelector();
ps.addClassPresenter(PlaybackControlsRow.class, controlsRowPresenter);
ps.addClassPresenter(ListRow.class, new ListRowPresenter());
mRowsAdapter = new ArrayObjectAdapter(ps);
mRowsAdapter.add(controlsRow);
addOtherRows();
updatePlaybackRow();
setAdapter(mRowsAdapter);
startPlaying();
}
示例8: setUpRows
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void setUpRows() {
PlaybackControlsRowPresenter controlsRowPresenter =
mPlaybackControlHelper.createControlsRowAndPresenter();
ClassPresenterSelector selector = new ClassPresenterSelector();
selector.addClassPresenter(PlaybackControlsRow.class, controlsRowPresenter);
selector.addClassPresenter(ListRow.class, new ListRowPresenter());
mRowsAdapter = new ArrayObjectAdapter(selector);
mRowsAdapter.add(mPlaybackControlHelper.getControlsRow());
mRelatedRecordingsRow = getRelatedRecordingsRow();
setAdapter(mRowsAdapter);
}
示例9: initialisePlaybackControlPresenter
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void initialisePlaybackControlPresenter() {
ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
mPlaybackControlsRowPresenter = new PlaybackControlsRowPresenter(new DescriptionPresenter());
mPlaybackControlsRowPresenter.setSecondaryActionsHidden(false);
presenterSelector.addClassPresenter(PlaybackControlsRow.class, mPlaybackControlsRowPresenter);
presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
mRowsAdapter = new ArrayObjectAdapter(presenterSelector);
setAdapter(mRowsAdapter);
}
示例10: onCreateControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
protected void onCreateControlsRowAndPresenter() {
super.onCreateControlsRowAndPresenter();
PlaybackControlsRowPresenter presenter = (PlaybackControlsRowPresenter)
getPlaybackRowPresenter();
presenter.setProgressColor(getContext().getResources().getColor(
R.color.player_progress_color));
presenter.setBackgroundColor(getContext().getResources().getColor(
R.color.player_background_color));
}
示例11: setupControlsRowPresenter
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
/**
* Use this method to setup the {@link PlaybackControlsRowPresenter}. It'll be called
* <u>after</u> the {@link PlaybackControlsRowPresenter} has been created and the primary and
* secondary actions have been added.
*
* @param presenter The PlaybackControlsRowPresenter used to display the controls.
*/
public void setupControlsRowPresenter(PlaybackControlsRowPresenter presenter) {
// TODO: [email protected] move into resources
presenter.setProgressColor(getContext().getResources().getColor(
R.color.player_progress_color_default));
presenter.setBackgroundColor(getContext().getResources().getColor(
R.color.player_background_color_default));
}
示例12: createControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
mControlsRow = getControlsRow();
// Add secondary actions and change the control row color.
ArrayObjectAdapter secondaryActions = new ArrayObjectAdapter(
new ControlButtonPresenterSelector());
mControlsRow.setSecondaryActionsAdapter(secondaryActions);
addSecondaryActions(secondaryActions);
setupControlsRowPresenter(presenter);
return presenter;
}
示例13: addPlaybackControlsRow
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void addPlaybackControlsRow() {
final PlaybackControlsRowPresenter controlsPresenter = mGlue
.createControlsRowAndPresenter();
mRowsAdapter = new ArrayObjectAdapter(controlsPresenter);
mRowsAdapter.add(mGlue.getControlsRow());
setAdapter(mRowsAdapter);
setOnItemViewClickedListener(this);
}
示例14: resetControlsToPrimaryActions
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void resetControlsToPrimaryActions(ItemBridgeAdapter.ViewHolder vh) {
if (vh == null && getVerticalGridView() != null) {
vh = (ItemBridgeAdapter.ViewHolder) getVerticalGridView().findViewHolderForPosition(0);
}
if (vh == null) {
mResetControlsToPrimaryActionsPending = true;
} else if (vh.getPresenter() instanceof PlaybackControlsRowPresenter) {
mResetControlsToPrimaryActionsPending = false;
((PlaybackControlsRowPresenter) vh.getPresenter()).showPrimaryActions(
(PlaybackControlsRowPresenter.ViewHolder) vh.getViewHolder());
}
}
示例15: loadDescriptionAnimator
import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void loadDescriptionAnimator() {
AnimatorUpdateListener listener = new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator arg0) {
if (getVerticalGridView() == null) {
return;
}
ItemBridgeAdapter.ViewHolder adapterVh = (ItemBridgeAdapter.ViewHolder)
getVerticalGridView().findViewHolderForPosition(0);
if (adapterVh != null && adapterVh.getViewHolder()
instanceof PlaybackControlsRowPresenter.ViewHolder) {
final Presenter.ViewHolder vh = ((PlaybackControlsRowPresenter.ViewHolder)
adapterVh.getViewHolder()).mDescriptionViewHolder;
if (vh != null) {
vh.view.setAlpha((Float) arg0.getAnimatedValue());
}
}
}
};
mDescriptionFadeInAnimator = loadAnimator(
getActivity(), R.animator.lb_playback_description_fade_in);
mDescriptionFadeInAnimator.addUpdateListener(listener);
mDescriptionFadeInAnimator.setInterpolator(mLogDecelerateInterpolator);
mDescriptionFadeOutAnimator = loadAnimator(
getActivity(), R.animator.lb_playback_description_fade_out);
mDescriptionFadeOutAnimator.addUpdateListener(listener);
}