Java 类android.support.v17.leanback.widget.PlaybackControlsRow.PlayPauseAction 实例源码

项目:HelloTV    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:tubik    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:cleaninsights-android-sdk    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:eanalytics-android    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:popcorn-android    文件:PTVPlaybackOverlayFragment.java   
@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);
    }
}
项目:popcorn-android    文件:PTVPlaybackOverlayFragment.java   
private void setupPlaybackControlItemsToInitialisingState() {
    mRowsAdapter.clear();
    mPlaybackControlsRow = new PlaybackControlsRow(mStreamInfo);
    mPlaybackControlsRow.setCurrentTime(0);
    mPlaybackControlsRow.setBufferedProgress(0);

    ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
    mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
    mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

    Activity activity = getActivity();
    mPlayPauseAction = new PlayPauseAction(activity);
    mPrimaryActionsAdapter.add(mPlayPauseAction);

    setupSecondaryRowPlaybackControl(presenterSelector);

    mRowsAdapter.add(mPlaybackControlsRow);
    mRowsAdapter.notifyArrayItemRangeChanged(0, mRowsAdapter.size());
}
项目:popcorn-android    文件:PTVPlaybackOverlayFragment.java   
private void setupPrimaryRowPlaybackControl(@NonNull ControlButtonPresenterSelector presenterSelector) {
    mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
    mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

    Activity activity = getActivity();
    mPlayPauseAction = new PlayPauseAction(activity);
    mFastForwardAction = new FastForwardAction(activity);
    mRewindAction = new RewindAction(activity);

    if (mPreviousEpisode != null) {
        mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(activity);
        mPrimaryActionsAdapter.add(mSkipPreviousAction);
    }

    // Add main controls to primary adapter.
    mPrimaryActionsAdapter.add(mRewindAction);
    mPrimaryActionsAdapter.add(mPlayPauseAction);
    mPrimaryActionsAdapter.add(mFastForwardAction);

    if (mNextEpisode != null) {
        mSkipNextAction = new PlaybackControlsRow.SkipNextAction(activity);
        mPrimaryActionsAdapter.add(mSkipNextAction);
    }
}
项目:Mediathek    文件:PlaybackOverlayFragment.java   
public void togglePlayback(boolean playPause) {
    if (playPause) {
        startProgressAutomation();
        setFadingEnabled(true);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), true);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
    } else {
        stopProgressAutomation();
        setFadingEnabled(false);
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem),
                mPlaybackControlsRow.getCurrentTime(), false);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
    }
    notifyChanged(mPlayPauseAction);
}
项目:MrinalMusicPlayer    文件:TvPlaybackFragment.java   
private void addPlaybackControlsRow(MediaMetadata metadata) {

        mPlaybackControlsRow = new PlaybackControlsRow(new MutableMediaMetadataHolder(metadata));
        mRowsAdapter.add(mPlaybackControlsRow);

        resetPlaybackRow();

        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

        mPlayPauseAction = new PlayPauseAction(getActivity());
        mSkipNextAction = new PlaybackControlsRow.SkipNextAction(getActivity());
        mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(getActivity());

        mPrimaryActionsAdapter.add(mSkipPreviousAction);
        mPrimaryActionsAdapter.add(mPlayPauseAction);
        mPrimaryActionsAdapter.add(mSkipNextAction);
    }
项目:MrinalMusicPlayer    文件:TvPlaybackFragment.java   
protected void updatePlaybackState(PlaybackState state) {
    if (mPlaybackControlsRow == null) {
        // We only update playback state after we get a valid metadata.
        return;
    }
    mLastPosition = state.getPosition();
    mLastPositionUpdateTime = state.getLastPositionUpdateTime();
    switch (state.getState()) {
        case PlaybackState.STATE_PLAYING:
            startProgressAutomation();
            mPlayPauseAction.setIndex(PlayPauseAction.PAUSE);
            break;
        case PlaybackState.STATE_PAUSED:
            stopProgressAutomation();
            mPlayPauseAction.setIndex(PlayPauseAction.PLAY);
            break;
    }

    updatePlayListRow(getActivity().getMediaController().getQueue());
    mRowsAdapter.notifyArrayItemRangeChanged(
            mRowsAdapter.indexOf(mPlaybackControlsRow), 1);
}
项目:android-UniversalMusicPlayer    文件:TvPlaybackFragment.java   
private void addPlaybackControlsRow(MediaMetadataCompat metadata) {

        mPlaybackControlsRow = new PlaybackControlsRow(new MutableMediaMetadataHolder(metadata));
        mRowsAdapter.add(mPlaybackControlsRow);

        resetPlaybackRow();

        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

        mPlayPauseAction = new PlayPauseAction(getActivity());
        mSkipNextAction = new PlaybackControlsRow.SkipNextAction(getActivity());
        mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(getActivity());

        mPrimaryActionsAdapter.add(mSkipPreviousAction);
        mPrimaryActionsAdapter.add(mPlayPauseAction);
        mPrimaryActionsAdapter.add(mSkipNextAction);
    }
项目:android-UniversalMusicPlayer    文件:TvPlaybackFragment.java   
protected void updatePlaybackState(PlaybackStateCompat state) {
    if (mPlaybackControlsRow == null) {
        // We only update playback state after we get a valid metadata.
        return;
    }
    mLastPosition = state.getPosition();
    mLastPositionUpdateTime = state.getLastPositionUpdateTime();
    switch (state.getState()) {
        case PlaybackStateCompat.STATE_PLAYING:
            startProgressAutomation();
            mPlayPauseAction.setIndex(PlayPauseAction.PAUSE);
            break;
        case PlaybackStateCompat.STATE_PAUSED:
            stopProgressAutomation();
            mPlayPauseAction.setIndex(PlayPauseAction.PLAY);
            break;
    }

    MediaControllerCompat controller = MediaControllerCompat.getMediaController(getActivity());
    updatePlayListRow(controller.getQueue());
    mRowsAdapter.notifyArrayItemRangeChanged(
            mRowsAdapter.indexOf(mPlaybackControlsRow), 1);
}
项目:UniversalAndroidMusicPlayer    文件:TvPlaybackFragment.java   
private void addPlaybackControlsRow(MediaMetadata metadata) {

        mPlaybackControlsRow = new PlaybackControlsRow(new MutableMediaMetadataHolder(metadata));
        mRowsAdapter.add(mPlaybackControlsRow);

        resetPlaybackRow();

        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

        mPlayPauseAction = new PlayPauseAction(getActivity());
        mSkipNextAction = new PlaybackControlsRow.SkipNextAction(getActivity());
        mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(getActivity());

        mPrimaryActionsAdapter.add(mSkipPreviousAction);
        mPrimaryActionsAdapter.add(mPlayPauseAction);
        mPrimaryActionsAdapter.add(mSkipNextAction);
    }
项目:UniversalAndroidMusicPlayer    文件:TvPlaybackFragment.java   
protected void updatePlaybackState(PlaybackState state) {
    if (mPlaybackControlsRow == null) {
        // We only update playback state after we get a valid metadata.
        return;
    }
    mLastPosition = state.getPosition();
    mLastPositionUpdateTime = state.getLastPositionUpdateTime();
    switch (state.getState()) {
        case PlaybackState.STATE_PLAYING:
            startProgressAutomation();
            mPlayPauseAction.setIndex(PlayPauseAction.PAUSE);
            break;
        case PlaybackState.STATE_PAUSED:
            stopProgressAutomation();
            mPlayPauseAction.setIndex(PlayPauseAction.PLAY);
            break;
    }

    updatePlayListRow(getActivity().getMediaController().getQueue());
    mRowsAdapter.notifyArrayItemRangeChanged(
            mRowsAdapter.indexOf(mPlaybackControlsRow), 1);
}
项目:BuildingForAndroidTV    文件:PlaybackOverlayFragment.java   
@Override
public void onPlaybackStateChanged(PlaybackState state) {
    Log.d(TAG, "playback state changed: " + state.getState());
    if (state.getState() == PlaybackState.STATE_PLAYING && mCurrentPlaybackState != PlaybackState.STATE_PLAYING) {
        mCurrentPlaybackState = PlaybackState.STATE_PLAYING;
        startProgressAutomation();
        setFadingEnabled(true);
        mPlayPauseAction.setIndex(PlayPauseAction.PAUSE);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
        notifyChanged(mPlayPauseAction);
    } else if (state.getState() == PlaybackState.STATE_PAUSED && mCurrentPlaybackState != PlaybackState.STATE_PAUSED) {
        mCurrentPlaybackState = PlaybackState.STATE_PAUSED;
        stopProgressAutomation();
        setFadingEnabled(false);
        mPlayPauseAction.setIndex(PlayPauseAction.PLAY);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
        notifyChanged(mPlayPauseAction);
    }

    int currentTime = (int)state.getPosition();
    mPlaybackControlsRow.setCurrentTime(currentTime);
    mPlaybackControlsRow.setBufferedProgress(currentTime + SIMULATED_BUFFERED_TIME);
}
项目:HelloTV    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:HelloTV    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:tubik    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:tubik    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:cleaninsights-android-sdk    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:cleaninsights-android-sdk    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:eanalytics-android    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:eanalytics-android    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Android-High-Performance-Programming    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:popcorn-android    文件:PTVPlaybackOverlayFragment.java   
@Override
public void onPause() {
    super.onPause();
    if (!mKeepEventBusRegistration) {
        // Event is unregistered before playback paused event is sent
        mPlayPauseAction.setIndex(PlayPauseAction.PLAY);
        setFadingEnabled(false);
        notifyPlaybackControlActionChanged(mPlayPauseAction);
        EventBus.getDefault().unregister(this);
    }
}
项目:PictureInPicturePlayground    文件:PlaybackOverlayFragment.java   
@Override
public void onPlaybackStateChanged(@NonNull PlaybackState state) {
    if (state.getState() == PlaybackState.STATE_PLAYING
            && mCurrentPlaybackState == PlaybackState.STATE_PLAYING) {
        startProgressAutomation();
        setFadingEnabled(true);
    } else if (state.getState() == PlaybackState.STATE_PLAYING) {
        mCurrentPlaybackState = PlaybackState.STATE_PLAYING;
        startProgressAutomation();
        setFadingEnabled(true);
        mPlayPauseAction.setIndex(PlayPauseAction.PAUSE);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PAUSE));
        notifyChanged(mPlayPauseAction);
    } else if (state.getState() == PlaybackState.STATE_PAUSED
            && mCurrentPlaybackState != PlaybackState.STATE_PAUSED) {
        mCurrentPlaybackState = PlaybackState.STATE_PAUSED;
        stopProgressAutomation();
        setFadingEnabled(false);
        mPlayPauseAction.setIndex(PlayPauseAction.PLAY);
        mPlayPauseAction.setIcon(mPlayPauseAction.getDrawable(PlayPauseAction.PLAY));
        notifyChanged(mPlayPauseAction);
    }

    int currentTime;

    if (state.getState() == PlaybackState.STATE_PAUSED
            || state.getState() == PlaybackState.STATE_PLAYING) {
        currentTime = mPlaybackControlsRow.getCurrentTime();
    } else {
        currentTime = (int) state.getPosition();
    }
    mPlaybackControlsRow.setCurrentTime(currentTime);
    mPlaybackControlsRow.setBufferedProgress(currentTime + SIMULATED_BUFFERED_TIME);
}
项目:Mediathek    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:Mediathek    文件:PlaybackOverlayFragment.java   
private void prev() {
    if (--mCurrentItem < 0) {
        mCurrentItem = mItems.size() - 1;
    }
    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}
项目:tldrlegal    文件:PlaybackOverlayFragment.java   
private void next() {
    if (++mCurrentItem >= mItems.size()) {
        mCurrentItem = 0;
    }

    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, false);
    } else {
        mCallback.onFragmentPlayPause(mItems.get(mCurrentItem), 0, true);
    }
    updatePlaybackRow(mCurrentItem);
}