当前位置: 首页>>代码示例>>Java>>正文


Java PlaybackControlsRow.RewindAction方法代码示例

本文整理汇总了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;
}
 
开发者ID:NiciDieNase,项目名称:chaosflix-leanback,代码行数:21,代码来源:PlaybackHelper.java

示例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);
}
 
开发者ID:googlesamples,项目名称:androidtv-Leanback,代码行数:20,代码来源:VideoPlayerGlue.java

示例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;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:33,代码来源:PlaybackControlHelper.java

示例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;
}
 
开发者ID:ad-on-is,项目名称:chilly,代码行数:30,代码来源:PlaybackControlHelper.java

示例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);
}
 
开发者ID:googlesamples,项目名称:leanback-assistant,代码行数:11,代码来源:PrimaryPlaybackControlsGlue.java

示例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);
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:28,代码来源:MediaPlayerGlue.java


注:本文中的android.support.v17.leanback.widget.PlaybackControlsRow.RewindAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。