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, int enabledModes)

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

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

Verifies whether a given repeatMode is enabled in the bitmask enabledModes.

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, int enabledModes)

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

Parameters
@Player.RepeatMode int currentMode

The current repeat mode.

int enabledModes

Bitmask of enabled modes.

Returns
int

The next repeat mode.

isRepeatModeEnabled

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

Verifies whether a given repeatMode is enabled in the bitmask enabledModes.

Parameters
@Player.RepeatMode int repeatMode

The mode to check.

int enabledModes

The bitmask representing the enabled modes.

Returns
boolean

true if enabled.