RepeatModeUtil


@UnstableApi
public final class RepeatModeUtil


Util class for repeat mode handling.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(flag = true, value = )
public annotation RepeatModeUtil.RepeatToggleModes

Set of repeat toggle modes.

Constants

static final int

"Repeat All" button enabled.

static final int

All repeat mode buttons disabled.

static final int

"Repeat One" button enabled.

Public methods

static int
@Player.RepeatMode
getNextRepeatMode(
    @Player.RepeatMode int currentMode,
    @RepeatModeUtil.RepeatToggleModes int enabledModes
)

Gets the next repeat mode out of enabledModes starting from currentMode.

static boolean
isRepeatModeEnabled(
    @Player.RepeatMode int repeatMode,
    @RepeatModeUtil.RepeatToggleModes int enabledModes
)

Verifies whether a given Player.RepeatMode is enabled in the bitmask of .

Constants

REPEAT_TOGGLE_MODE_ALL

public static final int REPEAT_TOGGLE_MODE_ALL = 2

"Repeat All" button enabled.

REPEAT_TOGGLE_MODE_NONE

public static final int REPEAT_TOGGLE_MODE_NONE = 0

All repeat mode buttons disabled.

REPEAT_TOGGLE_MODE_ONE

public static final int REPEAT_TOGGLE_MODE_ONE = 1

"Repeat One" button enabled.

Public methods

getNextRepeatMode

@Player.RepeatMode
public static int getNextRepeatMode(
    @Player.RepeatMode int currentMode,
    @RepeatModeUtil.RepeatToggleModes int enabledModes
)

Gets the next repeat mode out of enabledModes starting from currentMode.

Parameters
@Player.RepeatMode int currentMode

The current Player.RepeatMode.

@RepeatModeUtil.RepeatToggleModes int enabledModes

The bitmask of enabled RepeatToggleModes.

Returns
int

The next repeat mode.

isRepeatModeEnabled

public static boolean isRepeatModeEnabled(
    @Player.RepeatMode int repeatMode,
    @RepeatModeUtil.RepeatToggleModes int enabledModes
)

Verifies whether a given Player.RepeatMode is enabled in the bitmask of .

Parameters
@Player.RepeatMode int repeatMode

The Player.RepeatMode to check.

@RepeatModeUtil.RepeatToggleModes int enabledModes

The bitmask of enabled RepeatToggleModes.

Returns
boolean

true if enabled.