Example usage for android.support.v4.media.session PlaybackStateCompat REPEAT_MODE_NONE

List of usage examples for android.support.v4.media.session PlaybackStateCompat REPEAT_MODE_NONE

Introduction

In this page you can find the example usage for android.support.v4.media.session PlaybackStateCompat REPEAT_MODE_NONE.

Prototype

int REPEAT_MODE_NONE

To view the source code for android.support.v4.media.session PlaybackStateCompat REPEAT_MODE_NONE.

Click Source Link

Document

Use this value with MediaControllerCompat.TransportControls#setRepeatMode to indicate that the playback will be stopped at the end of the playing media list.

Usage

From source file:android.support.v17.leanback.media.MediaControllerAdapter.java

/**
 * This function will translate the index of RepeatAction in PlaybackControlsRow to
 * the repeat mode which is defined by PlaybackStateCompat.
 *
 * @param repeatActionIndex Index of RepeatAction in PlaybackControlsRow.
 * @return Repeat Mode in playback state.
 *///from   ww w  .j a v a  2s  .com
private int mapRepeatActionToRepeatMode(int repeatActionIndex) {
    switch (repeatActionIndex) {
    case PlaybackControlsRow.RepeatAction.INDEX_NONE:
        return PlaybackStateCompat.REPEAT_MODE_NONE;
    case PlaybackControlsRow.RepeatAction.INDEX_ALL:
        return PlaybackStateCompat.REPEAT_MODE_ALL;
    case PlaybackControlsRow.RepeatAction.INDEX_ONE:
        return PlaybackStateCompat.REPEAT_MODE_ONE;
    }
    return -1;
}