本文整理汇总了Java中android.support.v17.leanback.widget.PlaybackControlsRow.MultiAction方法的典型用法代码示例。如果您正苦于以下问题:Java PlaybackControlsRow.MultiAction方法的具体用法?Java PlaybackControlsRow.MultiAction怎么用?Java PlaybackControlsRow.MultiAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v17.leanback.widget.PlaybackControlsRow
的用法示例。
在下文中一共展示了PlaybackControlsRow.MultiAction方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchAction
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
@TargetApi(VERSION_CODES.N)
public void dispatchAction(Action action) {
if (action instanceof PlaybackControlsRow.MultiAction) {
PlaybackControlsRow.MultiAction multiAction = (PlaybackControlsRow.MultiAction) action;
multiAction.nextIndex();
notifyActionChanged(multiAction);
}
if (action == mFastForwardAction) {
mTransportControls.fastForward();
} else if (action == mRewindAction) {
mTransportControls.rewind();
} else if (action.getId() == mPipAction.getId()) {
((Activity) getContext()).enterPictureInPictureMode();
} else {
super.onActionClicked(action);
}
}
示例2: onActionClicked
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
@Override
public void onActionClicked(@NonNull Action action) {
if (action.getId() == mPlayPauseAction.getId()) {
invokeTogglePlaybackAction(mPlayPauseAction.getIndex() == PlayPauseAction.PLAY);
}
else if (action.getId() == mScaleVideoAction.getId()) {
invokeScaleVideoAction();
}
else if (action.getId() == mClosedCaptioningAction.getId()) {
invokeOpenSubtitleSettingsAction();
}
if (mSkipPreviousAction != null && action.getId() == mSkipPreviousAction.getId()) {
playSelectedEpisode(mPreviousEpisode);
}
if (mSkipNextAction != null && action.getId() == mSkipNextAction.getId()) {
playSelectedEpisode(mNextEpisode);
}
if (action instanceof PlaybackControlsRow.MultiAction) {
notifyPlaybackControlActionChanged(action);
}
}
示例3: notifyActionChanged
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void notifyActionChanged(PlaybackControlsRow.MultiAction action) {
int index = -1;
if (getPrimaryActionsAdapter() != null) {
index = getPrimaryActionsAdapter().indexOf(action);
}
if (index >= 0) {
getPrimaryActionsAdapter().notifyArrayItemRangeChanged(index, 1);
} else {
if (getSecondaryActionsAdapter() != null) {
index = getSecondaryActionsAdapter().indexOf(action);
if (index >= 0) {
getSecondaryActionsAdapter().notifyArrayItemRangeChanged(index, 1);
}
}
}
}
示例4: dispatchAction
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void dispatchAction(Action action) {
// Primary actions are handled manually.
if (action == mRewindAction) {
rewind();
} else if (action == mFastForwardAction) {
fastForward();
} else if (action instanceof PlaybackControlsRow.MultiAction) {
PlaybackControlsRow.MultiAction multiAction = (PlaybackControlsRow.MultiAction) action;
multiAction.nextIndex();
// Notify adapter of action changes to handle secondary actions, such as, thumbs up/down
// and repeat.
notifyActionChanged(
multiAction,
(ArrayObjectAdapter) getControlsRow().getSecondaryActionsAdapter());
}
}
示例5: dispatchAction
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.N)
public void dispatchAction(Action action) {
if (action instanceof PlaybackControlsRow.MultiAction) {
PlaybackControlsRow.MultiAction multiAction = (PlaybackControlsRow.MultiAction) action;
multiAction.nextIndex();
notifyActionChanged(multiAction);
}
if (action == mFastForwardAction) {
mTransportControls.fastForward();
} else if (action == mRewindAction) {
mTransportControls.rewind();
} else {
super.onActionClicked(action);
}
}
示例6: notifyActionChanged
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void notifyActionChanged(PlaybackControlsRow.MultiAction multiAction) {
int index;
index = getPrimaryActionsAdapter().indexOf(multiAction);
if (index >= 0) {
getPrimaryActionsAdapter().notifyArrayItemRangeChanged(index, 1);
} else {
index = getSecondaryActionsAdapter().indexOf(multiAction);
if (index >= 0) {
getSecondaryActionsAdapter().notifyArrayItemRangeChanged(index, 1);
}
}
}
示例7: notifyActionChanged
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void notifyActionChanged(PlaybackControlsRow.MultiAction action) {
int index;
index = getPrimaryActionsAdapter().indexOf(action);
if (index >= 0) {
getPrimaryActionsAdapter().notifyArrayItemRangeChanged(index, 1);
} else {
index = getSecondaryActionsAdapter().indexOf(action);
if (index >= 0) {
getSecondaryActionsAdapter().notifyArrayItemRangeChanged(index, 1);
}
}
}
示例8: dispatchAction
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void dispatchAction(Action action) {
if (action == mPipAction) {
((Activity) getContext()).enterPictureInPictureMode();
} else {
Toast.makeText(getContext(), action.toString(), Toast.LENGTH_SHORT).show();
PlaybackControlsRow.MultiAction multiAction = (PlaybackControlsRow.MultiAction) action;
multiAction.nextIndex();
notifyActionChanged(multiAction);
}
}
示例9: onActionClicked
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
public void onActionClicked(Action action) {
if (action.getId() == mPlayPauseAction.getId()) {
if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
startProgressAutomation();
setFadingEnabled(true);
mCallback.onFragmentPlayPause(mVideo,
mPlaybackControlsRow.getCurrentTime(), true);
} else {
stopProgressAutomation();
setFadingEnabled(false);
mCallback.onFragmentPlayPause(mVideo,
mPlaybackControlsRow.getCurrentTime(), false);
}
} else if (action.getId() == mSkipNextAction.getId()) {
next();
} else if (action.getId() == mSkipPreviousAction.getId()) {
prev();
} else if (action.getId() == mFastForwardAction.getId()) {
fastForward();
} else if (action.getId() == mRewindAction.getId()) {
fastRewind();
}
if (action instanceof PlaybackControlsRow.MultiAction) {
((PlaybackControlsRow.MultiAction) action).nextIndex();
notifyChanged(action);
}
}
示例10: notifyActionChanged
import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void notifyActionChanged(
PlaybackControlsRow.MultiAction action, ArrayObjectAdapter adapter) {
if (adapter != null) {
int index = adapter.indexOf(action);
if (index >= 0) {
adapter.notifyArrayItemRangeChanged(index, 1);
}
}
}