PlaybackSupportFragment

public class PlaybackSupportFragment
extends Fragment

java.lang.Object
   ↳ androidx.fragment.app.Fragment
     ↳ androidx.leanback.app.PlaybackSupportFragment


A fragment for displaying playback controls and related content.

A PlaybackSupportFragment 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.

Public constructors

PlaybackSupportFragment()

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)

Called to do initial creation of a fragment.

View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Called to have the fragment instantiate its user interface view.

void onDestroy()

Called when the fragment is no longer in use.

void onDestroyView()

Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from the fragment.

void onPause()

Called when the Fragment is no longer resumed.

void onResume()

Called when the fragment is visible to the user and actively running.

void onStart()

Called when the Fragment is visible to the user.

void onStop()

Called when the Fragment is no longer started.

void onViewCreated(View view, Bundle savedInstanceState)

Called immediately after onCreateView(LayoutInflater, ViewGroup, Bundle) has returned, but before any saved state has been restored in to the view.

void setAdapter(ObjectAdapter adapter)

Sets the list of rows for the fragment.

void setBackgroundType(i