ShuffleButtonState

@UnstableApi
class ShuffleButtonState


State that holds all interactions to correctly deal with a UI component representing a Shuffle On/Off button.

Summary

Public constructors

Public functions

suspend Unit

Subscribes to updates from Player.Events and listens to

Unit

Handles the interaction with the ShuffleButton according to the current state of the Player.

Public properties

Boolean

true if player is not null and Player.COMMAND_SET_SHUFFLE_MODE is available.

Boolean

true if player is not null and player's shuffle mode is enabled.

Public constructors

ShuffleButtonState

ShuffleButtonState(player: Player?)

Public functions

observe

suspend fun observe(): Unit

Subscribes to updates from Player.Events and listens to

onClick

fun onClick(): Unit

Handles the interaction with the ShuffleButton according to the current state of the Player.

This method does nothing if Player.COMMAND_SET_SHUFFLE_MODE is not available

Public properties

isEnabled

val isEnabledBoolean

true if player is not null and Player.COMMAND_SET_SHUFFLE_MODE is available.

shuffleOn

val shuffleOnBoolean

true if player is not null and player's shuffle mode is enabled.