Java Code Examples for androidx.leanback.widget.PlaybackControlsRow#RepeatAction
The following examples show how to use
androidx.leanback.widget.PlaybackControlsRow#RepeatAction .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VideoPlayerGlue.java From tv-samples with Apache License 2.0 | 6 votes |
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); }
Example 2
Source File: VideoPlayerGlue.java From androidtv-Leanback with Apache License 2.0 | 6 votes |
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); }
Example 3
Source File: VideoMediaPlayerGlue.java From tv-samples with Apache License 2.0 | 5 votes |
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); }
Example 4
Source File: MusicMediaPlayerGlue.java From tv-samples with Apache License 2.0 | 5 votes |
@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)); } } }
Example 5
Source File: MediaPlayerGlue.java From tv-samples with Apache License 2.0 | 5 votes |
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); }
Example 6
Source File: MediaPlayerGlue.java From tv-samples with Apache License 2.0 | 5 votes |
@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); } }