PlaybackBaseControlGlue
abstract class PlaybackBaseControlGlue<T : PlayerAdapter!> : PlaybackGlue, OnActionClickedListener, OnKeyListener
kotlin.Any | ||
↳ | androidx.leanback.media.PlaybackGlue | |
↳ | androidx.leanback.media.PlaybackBaseControlGlue |
A base abstract class for managing a PlaybackControlsRow
being displayed in PlaybackGlueHost
. It supports standard playback control actions play/pause and skip next/previous. This helper class is a glue layer that manages interaction between the leanback UI components PlaybackControlsRow
PlaybackRowPresenter
and a functional PlayerAdapter
which represents the underlying media player.
The app must pass a PlayerAdapter
in constructor for a specific implementation e.g. a MediaPlayerAdapter
.
The glue has two action bars: primary action bars and secondary action bars. Apps can provide additional actions by overriding onCreatePrimaryActions
and / or onCreateSecondaryActions
and respond to actions by overriding onActionClicked(Action)
.
The subclass is responsible for implementing the "repeat mode" in onPlayCompleted()
.
Summary
Constants | |
---|---|
static Int |
The adapter key for the first custom control on the left side of the predefined primary controls. |
static Int |
The adapter key for the first custom control on the right side of the predefined primary controls. |
static Int |
The adapter key for the fast forward control. |
static Int |
The adapter key for the play/pause control. |
static Int |
The adapter key for the repeat control. |
static Int |
The adapter key for the rewind control. |
static Int |
The adapter key for the shuffle control. |
static Int |
The adapter key for the skip to next control. |
static Int |
The adapter key for the skip to previous control. |
Public constructors | |
---|---|
Constructor for the glue. |
Public methods | |
---|---|
open Drawable! |
getArt() |
Long | |
open PlaybackControlsRow! |
Returns the playback controls row managed by the glue layer. |
open Long | |
Long | |
open PlaybackRowPresenter! |
Returns the playback controls row Presenter managed by the glue layer. |
T | |
open CharSequence! |
Return The media subtitle. |
open Long |
Returns a bitmask of actions supported by the media player. |
open CharSequence! |
getTitle() Returns the title of the media item. |
open Boolean |
Returns true if the controls auto hides after a timeout when media is playing. |
Boolean | |
Boolean | |
open Unit |
next() |
abstract Unit |
onActionClicked(action: Action!) Handles action clicks. |
abstract Boolean |
Handles key events and returns true if handled. |
open Unit |
pause() |
open Unit |
play() |
open Unit |
previous() |
Unit |
Seek media to a new position. |
open Unit |
Sets the drawable representing cover image. |
open Unit |
setControlsOverlayAutoHideEnabled(enable: Boolean) Sets the controls to auto hide after a timeout when media is playing. |
open Unit |
setControlsRow(controlsRow: |