NextButtonState
@UnstableApi
class NextButtonState
State that holds all interactions to correctly deal with a UI component representing a seek-to-next button.
This button has no internal state to maintain, it can only be enabled or disabled.
Summary
Public constructors |
|---|
NextButtonState(player: Player) |
Public functions |
|
|---|---|
suspend Nothing |
observe()Subscribes to updates from |
Unit |
onClick()Handles the interaction with the NextButton by seeking to the next MediaItem, if available, or to later position in the current MediaItem, if live. |
Public constructors
Public functions
observe
suspend fun observe(): Nothing
Subscribes to updates from Player.Events and listens to Player.EVENT_AVAILABLE_COMMANDS_CHANGED in order to determine whether the button should be enabled, i.e. respond to user input.
onClick
fun onClick(): Unit
Handles the interaction with the NextButton by seeking to the next MediaItem, if available, or to later position in the current MediaItem, if live.
This method must only be programmatically called if the state is enabled. However, it can be freely provided into containers that take care of skipping the onClick if a particular UI node is not enabled (see Compose Clickable Modifier).
| See also | |
|---|---|
seekToNext |
|
COMMAND_SEEK_TO_NEXT |