Skip to content

Most visited

Recently visited

navigation

PlaybackOverlayFragment

public class PlaybackOverlayFragment
extends DetailsFragment

java.lang.Object
   ↳ android.app.Fragment
     ↳ android.support.v17.leanback.app.BrandedFragment
       ↳ android.support.v17.leanback.app.BaseFragment
         ↳ android.support.v17.leanback.app.DetailsFragment
           ↳ android.support.v17.leanback.app.PlaybackOverlayFragment


This class was deprecated in API level 25.1.0.
Use PlaybackFragment.

A fragment for displaying playback controls and related content.

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

An instance of PlaybackControlsRow is expected to be at position 0 in the adapter.

This class is now deprecated, please us

Summary

Nested classes

interface PlaybackOverlayFragment.InputEventHandler

 

class PlaybackOverlayFragment.OnFadeCompleteListener

Listener allowing the application to receive notification of fade in and/or fade out completion events. 

Inherited XML attributes

From class android.app.Fragment

Constants

int BG_DARK

A dark translucent background.

int BG_LIGHT

A light translucent background.

int BG_NONE

No background.

Inherited constants

From interface android.content.ComponentCallbacks2

Public constructors

PlaybackOverlayFragment()

Public methods

void fadeOut()

Fades out the playback overlay immediately.

int getBackgroundType()

Returns the background type.

final PlaybackControlGlue.InputEventHandler getEventHandler()

Returns the input event handler.

PlaybackOverlayFragment.OnFadeCompleteListener getFadeCompleteListener()

Returns the listener to be called when fade in or out has completed.

final PlaybackOverlayFragment.InputEventHandler getInputEventHandler()

Returns the input event handler.

boolean isFadingEnabled()

Returns true if view fading is enabled.

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 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 setAdapter(ObjectAdapter adapter)

Sets the list of rows for the fragment.

void setBackgroundType(int type)

Sets the background type.

final void setEventHandler(PlaybackControlGlue.InputEventHandler handler)

Sets the input event handler.

void setFadeCompleteListener(PlaybackOverlayFragment.OnFadeCompleteListener listener)

Sets the listener to be called when fade in or out has completed.

void setFadingEnabled(boolean enabled)

Enables or disables view fading.

final void setInputEventHandler(PlaybackOverlayFragment.InputEventHandler handler)

Sets the input event handler.

void tickle()

Tickles the playback controls.

Protected methods

void setupPresenter(Presenter rowPresenter)

Called to setup each Presenter of Adapter passed in setAdapter(ObjectAdapter).Note that setup should only change the Presenter behavior that is meaningful in DetailsFragment.

Inherited methods

From class android.support.v17.leanback.app.DetailsFragment
From class android.support.v17.leanback.app.BaseFragment
From class android.support.v17.leanback.app.BrandedFragment
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener
From interface android.content.ComponentCallbacks

Constants

BG_DARK

added in version 22.0.0
int BG_DARK

A dark translucent background.

Constant Value: 1 (0x00000001)

BG_LIGHT

added in version 22.0.0
int BG_LIGHT

A light translucent background.

Constant Value: 2 (0x00000002)

BG_NONE

added in version 22.0.0
int BG_NONE

No background.

Constant Value: 0 (0x00000000)

Public constructors

PlaybackOverlayFragment

added in version 22.0.0
PlaybackOverlayFragment ()

Public methods

fadeOut

added in version 24.0.0
void fadeOut ()

Fades out the playback overlay immediately.

getBackgroundType

added in version 22.0.0
int getBackgroundType ()

Returns the background type.

Returns
int

getEventHandler

added in version 25.1.0
PlaybackControlGlue.InputEventHandler getEventHandler ()

Returns the input event handler.

Returns
PlaybackControlGlue.InputEventHandler

getFadeCompleteListener

added in version 22.0.0
PlaybackOverlayFragment.OnFadeCompleteListener getFadeCompleteListener ()

Returns the listener to be called when fade in or out has completed.

Returns
PlaybackOverlayFragment.OnFadeCompleteListener

getInputEventHandler

added in version 22.0.0
PlaybackOverlayFragment.InputEventHandler getInputEventHandler ()

Returns the input event handler.

Returns
PlaybackOverlayFragment.InputEventHandler

isFadingEnabled

added in version 22.0.0
boolean isFadingEnabled ()

Returns true if view fading is enabled.

Returns
boolean

onCreate

void onCreate (Bundle savedInstanceState)

Called to do initial creation of a fragment. This is called after onAttach(Activity) and before onCreateView(LayoutInflater, ViewGroup, Bundle), but is not called if the fragment instance is retained across Activity re-creation (see setRetainInstance(boolean)).

Note that this can be called while the fragment's activity is still in the process of being created. As such, you can not rely on things like the activity's content view hierarchy being initialized at this point. If you want to do work once the activity itself is created, see onActivityCreated(Bundle).

If your app's targetSdkVersion is M or lower, child fragments being restored from the savedInstanceState are restored after onCreate returns. When targeting N or above and running on an N or newer platform version they are restored by Fragment.onCreate.

Parameters
savedInstanceState Bundle: If the fragment is being re-created from a previous saved state, this is the state.

onCreateView

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

Called to have the fragment instantiate its user interface view. This is optional, and non-graphical fragments can return null (which is the default implementation). This will be called between onCreate(Bundle) and onActivityCreated(Bundle).

If you return a View from here, you will later be called in onDestroyView() when the view is being released.

Parameters
inflater LayoutInflater: The LayoutInflater object that can be used to inflate any views in the fragment,

container ViewGroup: If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.

savedInstanceState Bundle: If non-null, this fragment is being re-constructed from a previous saved state as given here.

Returns
View Return the View for the fragment's UI, or null.

onDestroyView

added in version 23.1.0
void onDestroyView ()

Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from the fragment. The next time the fragment needs to be displayed, a new view will be created. This is called after onStop() and before onDestroy(). It is called regardless of whether onCreateView(LayoutInflater, ViewGroup, Bundle) returned a non-null view. Internally it is called after the view's state has been saved but before it has been removed from its parent.

onPause

void onPause ()

Called when the Fragment is no longer resumed. This is generally tied to Activity.onPause of the containing Activity's lifecycle.

onResume

added in version 23.1.0
void onResume ()

Called when the fragment is visible to the user and actively running. This is generally tied to Activity.onResume of the containing Activity's lifecycle.

onStart

added in version 23.1.0
void onStart ()

Called when the Fragment is visible to the user. This is generally tied to Activity.onStart of the containing Activity's lifecycle.

onStop

void onStop ()

Called when the Fragment is no longer started. This is generally tied to Activity.onStop of the containing Activity's lifecycle.

setAdapter

added in version 22.0.0
void setAdapter (ObjectAdapter adapter)

Sets the list of rows for the fragment.

Parameters
adapter ObjectAdapter

setBackgroundType

added in version 22.0.0
void setBackgroundType (int type)

Sets the background type.

Parameters
type int: One of BG_LIGHT, BG_DARK, or BG_NONE.

setEventHandler

added in version 25.1.0
void setEventHandler (PlaybackControlGlue.InputEventHandler handler)

Sets the input event handler.

Parameters
handler PlaybackControlGlue.InputEventHandler

setFadeCompleteListener

added in version 22.0.0
void setFadeCompleteListener (PlaybackOverlayFragment.OnFadeCompleteListener listener)

Sets the listener to be called when fade in or out has completed.

Parameters
listener PlaybackOverlayFragment.OnFadeCompleteListener

setFadingEnabled

added in version 22.0.0
void setFadingEnabled (boolean enabled)

Enables or disables view fading. If enabled, the view will be faded in when the fragment starts, and will fade out after a time period. The timeout period is reset each time tickle() is called.

Parameters
enabled boolean

setInputEventHandler

added in version 22.0.0
void setInputEventHandler (PlaybackOverlayFragment.InputEventHandler handler)

Sets the input event handler.

Parameters
handler PlaybackOverlayFragment.InputEventHandler

tickle

added in version 22.0.0
void tickle ()

Tickles the playback controls. Fades in the view if it was faded out, otherwise resets the fade out timer. Tickling on input events is handled by the fragment.

Protected methods

setupPresenter

added in version 22.2.1
void setupPresenter (Presenter rowPresenter)

Called to setup each Presenter of Adapter passed in setAdapter(ObjectAdapter).Note that setup should only change the Presenter behavior that is meaningful in DetailsFragment. For example how a row is aligned in details Fragment. The default implementation invokes setupDetailsOverviewRowPresenter(FullWidthDetailsOverviewRowPresenter)

Parameters
rowPresenter Presenter

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)