public
class
PlaybackOverlaySupportFragment
extends DetailsSupportFragment
java.lang.Object | ||||
↳ | android.support.v4.app.Fragment | |||
↳ | android.support.v17.leanback.app.BrandedSupportFragment | |||
↳ | android.support.v17.leanback.app.DetailsSupportFragment | |||
↳ | android.support.v17.leanback.app.PlaybackOverlaySupportFragment |
A fragment for displaying playback controls and related content.
A PlaybackOverlaySupportFragment 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.
Nested classes | |
---|---|
interface |
PlaybackOverlaySupportFragment.InputEventHandler
Interface allowing the application to handle input events. |
class |
PlaybackOverlaySupportFragment.OnFadeCompleteListener
Listener allowing the application to receive notification of fade in and/or fade out completion events. |
Constants | |
---|---|
int |
BG_DARK
A dark translucent background. |
int |
BG_LIGHT
A light translucent background. |
int |
BG_NONE
No background. |
Public constructors | |
---|---|
PlaybackOverlaySupportFragment()
|
Public methods | |
---|---|
void
|
fadeOut()
Fades out the playback overlay immediately. |
int
|
getBackgroundType()
Returns the background type. |
PlaybackOverlaySupportFragment.OnFadeCompleteListener
|
getFadeCompleteListener()
Returns the listener to be called when fade in or out has completed. |
final
PlaybackOverlaySupportFragment.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 |
void
|
onResume()
Called when the fragment is visible to the user and actively running. |
void
|
setAdapter(ObjectAdapter adapter)
Sets the list of rows for the fragment. |
void
|
setBackgroundType(int type)
Sets the background type. |
void
|
setFadeCompleteListener(PlaybackOverlaySupportFragment.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(PlaybackOverlaySupportFragment.InputEventHandler handler)
Sets the input event handler. |
void
|
tickle()
Tickles the playback controls. |
Inherited methods | |
---|---|
From
class
android.support.v17.leanback.app.DetailsSupportFragment
| |
From
class
android.support.v17.leanback.app.BrandedSupportFragment
| |
From
class
android.support.v4.app.Fragment
| |
From
class
java.lang.Object
| |
From
interface
android.content.ComponentCallbacks
| |
From
interface
android.view.View.OnCreateContextMenuListener
|
int BG_DARK
A dark translucent background.
Constant Value: 1 (0x00000001)
int BG_LIGHT
A light translucent background.
Constant Value: 2 (0x00000002)
int BG_NONE
No background.
Constant Value: 0 (0x00000000)
PlaybackOverlaySupportFragment ()
void fadeOut ()
Fades out the playback overlay immediately.
int getBackgroundType ()
Returns the background type.
Returns | |
---|---|
int |
PlaybackOverlaySupportFragment.OnFadeCompleteListener getFadeCompleteListener ()
Returns the listener to be called when fade in or out has completed.
Returns | |
---|---|
PlaybackOverlaySupportFragment.OnFadeCompleteListener |
PlaybackOverlaySupportFragment.InputEventHandler getInputEventHandler ()
Returns the input event handler.
Returns | |
---|---|
PlaybackOverlaySupportFragment.InputEventHandler |
boolean isFadingEnabled ()
Returns true if view fading is enabled.
Returns | |
---|---|
boolean |
void onCreate (Bundle savedInstanceState)
Called to do initial creation of a fragment. This is called after
onAttach(Activity)
and before
onCreateView(LayoutInflater, ViewGroup, Bundle)
.
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)
.
Any restored child fragments will be created before the base
Fragment.onCreate
method returns.
Parameters | |
---|---|
savedInstanceState |
Bundle :
If the fragment is being re-created from
a previous saved state, this is the state.
|
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. |
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.
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.
void setAdapter (ObjectAdapter adapter)
Sets the list of rows for the fragment.
Parameters | |
---|---|
adapter |
ObjectAdapter
|
void setBackgroundType (int type)
Sets the background type.
Parameters | |
---|---|
type |
int :
One of BG_LIGHT, BG_DARK, or BG_NONE.
|
void setFadeCompleteListener (PlaybackOverlaySupportFragment.OnFadeCompleteListener listener)
Sets the listener to be called when fade in or out has completed.
Parameters | |
---|---|
listener |
PlaybackOverlaySupportFragment.OnFadeCompleteListener
|
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
|
void setInputEventHandler (PlaybackOverlaySupportFragment.InputEventHandler handler)
Sets the input event handler.
Parameters | |
---|---|
handler |
PlaybackOverlaySupportFragment.InputEventHandler
|
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.