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


Java PlaybackControlsRow.RepeatAction方法代码示例

本文整理汇总了Java中android.support.v17.leanback.widget.PlaybackControlsRow.RepeatAction方法的典型用法代码示例。如果您正苦于以下问题:Java PlaybackControlsRow.RepeatAction方法的具体用法?Java PlaybackControlsRow.RepeatAction怎么用?Java PlaybackControlsRow.RepeatAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v17.leanback.widget.PlaybackControlsRow的用法示例。


在下文中一共展示了PlaybackControlsRow.RepeatAction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: PlaybackControlHelper

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
public PlaybackControlHelper(Context context, PlaybackOverlayFragment fragment, Video video) {
    super(context, fragment, SEEK_SPEEDS);
    mFragment = fragment;
    mVideo = video;
    mMediaController = mFragment.getActivity().getMediaController();
    mTransportControls = mMediaController.getTransportControls();

    mThumbsUpAction = new PlaybackControlsRow.ThumbsUpAction(context);
    mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsUpAction.OUTLINE);
    mThumbsDownAction = new PlaybackControlsRow.ThumbsDownAction(context);
    mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsDownAction.OUTLINE);
    mRepeatAction = new PlaybackControlsRow.RepeatAction(context);
    mPipAction = new PlaybackControlsRow.PictureInPictureAction(context);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:15,代码来源:PlaybackControlHelper.java

示例3: VideoMediaPlayerGlue

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
public VideoMediaPlayerGlue(Activity context, T impl) {
    super(context, impl);
    mClosedCaptioningAction = new PlaybackControlsRow.ClosedCaptioningAction(context);
    mThumbsUpAction = new PlaybackControlsRow.ThumbsUpAction(context);
    mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsUpAction.OUTLINE);
    mThumbsDownAction = new PlaybackControlsRow.ThumbsDownAction(context);
    mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsDownAction.OUTLINE);
    mRepeatAction = new PlaybackControlsRow.RepeatAction(context);
    mPipAction = new PlaybackControlsRow.PictureInPictureAction(context);
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:11,代码来源:VideoMediaPlayerGlue.java

示例4: onActionClicked

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
@Override public void onActionClicked(Action action) {
    // If either 'Shuffle' or 'Repeat' has been clicked we need to make sure the acitons index
    // is incremented and the UI updated such that we can display the new state.
    super.onActionClicked(action);
    if (action instanceof PlaybackControlsRow.RepeatAction) {
        int index = ((PlaybackControlsRow.RepeatAction) action).getIndex();
        if (mPlaybackService != null) {
            mPlaybackService.setRepeatState(mapActionIndexToServiceRepeatState(index));
        }
    }
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:12,代码来源:MusicMediaPlayerGlue.java

示例5: MediaPlayerGlue

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
public MediaPlayerGlue(Context context) {
    super(context, new int[]{1});
    mShuffleAction = new PlaybackControlsRow.ShuffleAction(getContext());
    mRepeatAction = new PlaybackControlsRow.RepeatAction(getContext());
    mThumbsDownAction = new PlaybackControlsRow.ThumbsDownAction(getContext());
    mThumbsUpAction = new PlaybackControlsRow.ThumbsUpAction(getContext());
    mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
    mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:10,代码来源:MediaPlayerGlue.java

示例6: onActionClicked

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
@Override public void onActionClicked(Action action) {
    if (action instanceof PlaybackControlsRow.ShuffleAction
            || action instanceof PlaybackControlsRow.RepeatAction) {
        ((PlaybackControlsRow.MultiAction) action).nextIndex();
        notifySecondaryActionChanged(action);
    } else if (action == mThumbsUpAction) {
        if (mThumbsUpAction.getIndex() == PlaybackControlsRow.ThumbsAction.SOLID) {
            mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
            notifySecondaryActionChanged(mThumbsUpAction);
        } else {
            mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.SOLID);
            mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
            notifySecondaryActionChanged(mThumbsUpAction);
            notifySecondaryActionChanged(mThumbsDownAction);
        }
    } else if (action == mThumbsDownAction) {
        if (mThumbsDownAction.getIndex() == PlaybackControlsRow.ThumbsAction.SOLID) {
            mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
            notifySecondaryActionChanged(mThumbsDownAction);
        } else {
            mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.SOLID);
            mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
            notifySecondaryActionChanged(mThumbsUpAction);
            notifySecondaryActionChanged(mThumbsDownAction);
        }
    } else {
        super.onActionClicked(action);
    }
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:30,代码来源:MediaPlayerGlue.java

示例7: MediaPlayerGlue

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
public MediaPlayerGlue(Context context, PlaybackOverlayFragment fragment, IYoutubeApi youtubePlayer) {
    super(context, fragment, new int[]{1});
    mPlayer = youtubePlayer;
    // Instantiate secondary actions
    mShuffleAction = new PlaybackControlsRow.ShuffleAction(context);
    mRepeatAction = new PlaybackControlsRow.RepeatAction(context);
    /*
    mThumbsDownAction = new PlaybackControlsRow.ThumbsDownAction(mContext);
    mThumbsUpAction = new PlaybackControlsRow.ThumbsUpAction(mContext);
    mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
    mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
    */
    // Register selected listener such that we know what action the user currently has focused.
    fragment.setOnItemViewSelectedListener(this);

    mPlayer.setOnProgressUpdateListener(new IProgressUpdateListener() {
        @Override
        public void onProgressUpdate(final float currentTime) {
            mCurrentTime = (int) (currentTime * 1000);
            mHandler.post(new Runnable() {
                @Override
                public void run() {
                    updateProgress();
                }
            });
        }
    });
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:29,代码来源:MediaPlayerGlue.java

示例8: onActionClicked

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
@Override
public void onActionClicked(Action action) {
    // If either 'Shuffle' or 'Repeat' has been clicked we need to make sure the acitons index
    // is incremented and the UI updated such that we can display the new state.
    super.onActionClicked(action);
    if (action instanceof PlaybackControlsRow.ShuffleAction) {
        Log.i(TAG, "ShuffleAction");
        mShuffleAction.nextIndex();
    } else if (action instanceof PlaybackControlsRow.RepeatAction) {
        Log.i(TAG, "RepeatAction");
        mRepeatAction.nextIndex();
    }
    /*
    else if (action instanceof PlaybackControlsRow.ThumbsUpAction) {
        if (mThumbsUpAction.getIndex() == PlaybackControlsRow.ThumbsAction.SOLID) {
            mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
        } else {
            mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.SOLID);
            mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
        }
    } else if (action instanceof PlaybackControlsRow.ThumbsDownAction) {
        if (mThumbsDownAction.getIndex() == PlaybackControlsRow.ThumbsAction.SOLID) {
            mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
        } else {
            mThumbsDownAction.setIndex(PlaybackControlsRow.ThumbsAction.SOLID);
            mThumbsUpAction.setIndex(PlaybackControlsRow.ThumbsAction.OUTLINE);
        }
    }
    */
    onMetadataChanged();
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:32,代码来源:MediaPlayerGlue.java


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