added in version 25.1.0
belongs to Maven artifact
Deprecated since version 27.1.0


public class PlaybackFragment
extends Fragment

Known Direct Subclasses

This class was deprecated in API level 27.1.0.
use PlaybackSupportFragment

A fragment for displaying playback controls and related content.

A PlaybackFragment renders the elements of its ObjectAdapter as a set of rows in a vertical list. The Adapter's PresenterSelector must maintain subclasses of RowPresenter.

A playback row is a row rendered by PlaybackRowPresenter. App can call setPlaybackRow(Row) to set playback row for the first element of adapter. App can call setPlaybackRowPresenter(PlaybackRowPresenter) to set presenter for it. setPlaybackRow(Row) and setPlaybackRowPresenter(PlaybackRowPresenter) are optional, app can pass playback row and PlaybackRowPresenter in the adapter using setAdapter(ObjectAdapter).

Auto hide controls upon playing: best practice is calling setControlsOverlayAutoHideEnabled(boolean) upon play/pause. The auto hiding timer will be cancelled upon tickle() triggered by input event.




A dark translucent background.


A light translucent background.


No background.

Inherited constants

From interface android.content.ComponentCallbacks2

Public constructors


Public methods

void fadeOut()

This method was deprecated in API level 26.1.0. Call hideControlsOverlay(boolean)

ObjectAdapter getAdapter()
int getBackgroundType()

Returns the background type.

ProgressBarManager getProgressBarManager()

Returns the ProgressBarManager that will show or hide progress bar in onBufferingStateChanged(boolean).

void hideControlsOverlay(boolean runAnimation)

Hide controls overlay.

boolean isControlsOverlayAutoHideEnabled()

Returns true if controls will be auto hidden after a delay when fragment is resumed.

boolean isControlsOverlayVisible()