本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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));
}
}
}
示例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);
}
示例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);
}
}
示例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();
}
});
}
});
}
示例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();
}