本文整理汇总了Java中android.support.v17.leanback.widget.PlaybackControlsRow.RewindAction方法的典型用法代码示例。如果您正苦于以下问题:Java PlaybackControlsRow.RewindAction方法的具体用法?Java PlaybackControlsRow.RewindAction怎么用?Java PlaybackControlsRow.RewindAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v17.leanback.widget.PlaybackControlsRow
的用法示例。
在下文中一共展示了PlaybackControlsRow.RewindAction方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的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;
}
示例2: VideoPlayerGlue
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
public VideoPlayerGlue(
Context context,
LeanbackPlayerAdapter playerAdapter,
OnActionClickedListener actionListener) {
super(context, playerAdapter);
mActionListener = actionListener;
mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(context);
mSkipNextAction = new PlaybackControlsRow.SkipNextAction(context);
mFastForwardAction = new PlaybackControlsRow.FastForwardAction(context);
mRewindAction = new PlaybackControlsRow.RewindAction(context);
mThumbsUpAction = new PlaybackControlsRow.ThumbsUpAction(context);
mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsUpAction.INDEX_OUTLINE);
mThumbsDownAction = new PlaybackControlsRow.ThumbsDownAction(context);
mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsDownAction.INDEX_OUTLINE);
mRepeatAction = new PlaybackControlsRow.RepeatAction(context);
}
示例3: createControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的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;
}
示例4: createControlsRowAndPresenter
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的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;
}
示例5: PrimaryPlaybackControlsGlue
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
public PrimaryPlaybackControlsGlue(
Context context, T adapter, MediaControllerCompat mediaController) {
super(context, adapter);
mMediaSessionTransportControls = mediaController.getTransportControls();
mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(context);
mSkipNextAction = new PlaybackControlsRow.SkipNextAction(context);
mFastForwardAction = new PlaybackControlsRow.FastForwardAction(context);
mRewindAction = new PlaybackControlsRow.RewindAction(context);
}
示例6: onKey
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// This method is overridden in order to make implement fast forwarding and rewinding when
// the user keeps the corresponding action pressed.
// We only consume DPAD_CENTER Action_DOWN events on the Fast-Forward and Rewind action and
// only if it has not been pressed in the last X milliseconds.
boolean consume = mSelectedAction instanceof PlaybackControlsRow.RewindAction;
consume = consume || mSelectedAction instanceof PlaybackControlsRow.FastForwardAction;
consume = consume && mInitialized;
consume = consume && event.getKeyCode() == KeyEvent.KEYCODE_DPAD_CENTER;
consume = consume && event.getAction() == KeyEvent.ACTION_DOWN;
consume = consume && System
.currentTimeMillis() - mLastKeyDownEvent > FAST_FORWARD_REWIND_REPEAT_DELAY;
if (consume) {
mLastKeyDownEvent = System.currentTimeMillis();
int newPosition = getCurrentPosition() + FAST_FORWARD_REWIND_STEP;
if (mSelectedAction instanceof PlaybackControlsRow.RewindAction) {
newPosition = getCurrentPosition() - FAST_FORWARD_REWIND_STEP;
}
// Make sure the new calculated duration is in the range 0 >= X >= MediaDuration
if (newPosition < 0) newPosition = 0;
if (newPosition > getMediaDuration()) newPosition = getMediaDuration();
seekTo(newPosition);
return true;
}
return super.onKey(v, keyCode, event);
}