public class PlaybackOverlaySupportFragment extends DetailsSupportFragment
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.
Modifier and Type | Class and Description |
---|---|
static interface |
PlaybackOverlaySupportFragment.InputEventHandler
Interface allowing the application to handle input events.
|
static class |
PlaybackOverlaySupportFragment.OnFadeCompleteListener
Listener allowing the application to receive notification of fade in and/or fade out
completion events.
|
Fragment.InstantiationException, Fragment.SavedState
Modifier and Type | Field and Description |
---|---|
static int |
BG_DARK
A dark translucent background.
|
static int |
BG_LIGHT
A light translucent background.
|
static int |
BG_NONE
No background.
|
Constructor and Description |
---|
PlaybackOverlaySupportFragment() |
Modifier and Type | Method and Description |
---|---|
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.
|
PlaybackOverlaySupportFragment.InputEventHandler |
getInputEventHandler()
Returns the input event handler.
|
ProgressBarManager |
getProgressBarManager()
Returns the
ProgressBarManager . |
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
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) has
been detached from the fragment. |
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 |
onViewCreated(View view,
Bundle savedInstanceState)
Called immediately after
Fragment.onCreateView(LayoutInflater, ViewGroup, Bundle)
has returned, but before any saved state has been restored in to the view. |
void |
prepareEntranceTransition()
Enables entrance transition.
|
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.
|
void |
setInputEventHandler(PlaybackOverlaySupportFragment.InputEventHandler handler)
Sets the input event handler.
|
void |
startEntranceTransition()
When fragment finishes loading data, it should call startEntranceTransition()
to execute the entrance transition.
|
void |
tickle()
Tickles the playback controls.
|
createEntranceTransition, getAdapter, getOnItemViewClickedListener, getRowsSupportFragment, inflateTitle, onEntranceTransitionEnd, onEntranceTransitionPrepare, onEntranceTransitionStart, onInflateTitleView, onSetDetailsOverviewRowStatus, onSetRowStatus, runEntranceTransition, setOnItemViewClickedListener, setOnItemViewSelectedListener, setSelectedPosition, setSelectedPosition, setupDetailsOverviewRowPresenter, setupPresenter
getBadgeDrawable, getSearchAffordanceColor, getSearchAffordanceColors, getTitle, getTitleView, getTitleViewAdapter, installTitleView, isShowingTitle, onPause, onSaveInstanceState, setBadgeDrawable, setOnSearchClickedListener, setSearchAffordanceColor, setSearchAffordanceColors, setTitle, setTitleView, showTitle, showTitle
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isVisible, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDetach, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onStop, onViewStateRestored, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, toString, unregisterForContextMenu
public static final int BG_NONE
public static final int BG_DARK
public static final int BG_LIGHT
public void setFadingEnabled(boolean enabled)
tickle()
is called.public boolean isFadingEnabled()
public void setFadeCompleteListener(PlaybackOverlaySupportFragment.OnFadeCompleteListener listener)
public PlaybackOverlaySupportFragment.OnFadeCompleteListener getFadeCompleteListener()
public final void setInputEventHandler(PlaybackOverlaySupportFragment.InputEventHandler handler)
public final PlaybackOverlaySupportFragment.InputEventHandler getInputEventHandler()
public void tickle()
public void fadeOut()
public void onResume()
Fragment
Activity.onResume
of the containing
Activity's lifecycle.onResume
in class BrandedSupportFragment
public void setAdapter(ObjectAdapter adapter)
setAdapter
in class DetailsSupportFragment
public void onCreate(Bundle savedInstanceState)
Fragment
Fragment.onAttach(Activity)
and before
Fragment.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 Fragment.onActivityCreated(Bundle)
.
Any restored child fragments will be created before the base
Fragment.onCreate
method returns.
onCreate
in class DetailsSupportFragment
savedInstanceState
- If the fragment is being re-created from
a previous saved state, this is the state.public void setBackgroundType(int type)
type
- One of BG_LIGHT, BG_DARK, or BG_NONE.public int getBackgroundType()
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Fragment
Fragment.onCreate(Bundle)
and Fragment.onActivityCreated(Bundle)
.
If you return a View from here, you will later be called in
Fragment.onDestroyView()
when the view is being released.
onCreateView
in class DetailsSupportFragment
inflater
- The LayoutInflater object that can be used to inflate
any views in the fragment,container
- 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
- If non-null, this fragment is being re-constructed
from a previous saved state as given here.public void onDestroyView()
Fragment
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.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 Fragment.onStop()
and before Fragment.onDestroy()
. It is called
regardless of whether Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.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.onDestroyView
in class BrandedSupportFragment
public void onStart()
Fragment
Activity.onStart
of the containing
Activity's lifecycle.onStart
in class DetailsSupportFragment
public void onViewCreated(View view, Bundle savedInstanceState)
Fragment
Fragment.onCreateView(LayoutInflater, ViewGroup, Bundle)
has returned, but before any saved state has been restored in to the view.
This gives subclasses a chance to initialize themselves once
they know their view hierarchy has been completely created. The fragment's
view hierarchy is not however attached to its parent at this point.onViewCreated
in class BrandedSupportFragment
view
- The View returned by Fragment.onCreateView(LayoutInflater, ViewGroup, Bundle)
.savedInstanceState
- If non-null, this fragment is being re-constructed
from a previous saved state as given here.public void prepareEntranceTransition()
Entrance transition is the standard slide-in transition that shows rows of data in browse screen and details screen.
The method is ignored before LOLLIPOP (API21).
This method must be called in or
before onCreate(). Typically entrance transition should be enabled when savedInstance is
null so that fragment restored from instanceState does not run an extra entrance transition.
When the entrance transition is enabled, the fragment will make headers and content
hidden initially.
When data of rows are ready, app must call startEntranceTransition()
to kick off
the transition, otherwise the rows will be invisible forever.
It is similar to android:windowsEnterTransition and can be considered a late-executed android:windowsEnterTransition controlled by app. There are two reasons that app needs it:
Transition object is returned by createEntranceTransition(). Typically the app does not need override the default transition that browse and details provides.
public void startEntranceTransition()
If startEntranceTransition() is called before onViewCreated(), it will be pending and executed when view is created.
public final ProgressBarManager getProgressBarManager()
ProgressBarManager
.