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


Java PlaybackControlsRow.MultiAction方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:19,代码来源:PlaybackControlHelper.java

示例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);
    }
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:23,代码来源:PTVPlaybackOverlayFragment.java

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

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

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

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

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

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

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

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


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