PlaybackFragment

public class PlaybackFragment
extends Fragment

java.lang.Object
   ↳ android.app.Fragment
     ↳ androidx.leanback.app.PlaybackFragment


This class is deprecated.
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).

Hiding and showing controls: the controls are initially visible and automatically show/hide when play/pause or user interacts with fragment.

Summary

Constants

int BG_DARK

A dark translucent background.

int BG_LIGHT

A light translucent background.

int BG_NONE

No background.

Inherited constants

Public constructors

PlaybackFragment()

Public methods

void fadeOut()

This method is deprecated. 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()

Returns true if controls overlay is visible, false otherwise.

boolean isFadingEnabled()

This method is deprecated. Uses isControlsOverlayAutoHideEnabled()

boolean isShowOrHideControlsOverlayOnUserInteraction()

Returns true if showing and auto-hiding controls when user interacts; false otherwise.

void notifyPlaybackRowChanged()

Updates the ui when the row data changes.

void onCreate(Bundle savedInstanceState)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onDestroy()
void onDestroyView()
void onPause()
void onResume()
void onStart()
void onStop()
void onViewCreated(View view, Bundle savedInstanceState)
void setAdapter(ObjectAdapter adapter)

Sets the list of rows for the fragment.

void setBackgroundType(int type)

Sets the background type.

void setControlsOverlayAutoHideEnabled(boolean enabled)

Enables or disables auto hiding controls overlay after a short delay fragment is resumed.

void setFadingEnabled(boolean enabled)

This method is deprecated. Uses setControlsOverlayAutoHideEnabled(boolean)