BaseFragment
open classBaseFragment: BrandedFragment
kotlin.Any | |||
↳ | android.app.Fragment | ||
↳ | androidx.leanback.app.BrandedFragment | ||
↳ | androidx.leanback.app.BaseFragment |
Base class for leanback Fragments. This class is not intended to be subclassed by apps.
Summary
Public methods | |
---|---|
ProgressBarManager! |
Returns the |
open Unit | |
open Unit | |
open Unit |
onViewCreated(@NonNull view: View, @Nullable savedInstanceState: Bundle?) |
open Unit |
Enables entrance transition. |
open Unit |
When fragment finishes loading data, it should call startEntranceTransition() to execute the entrance transition. |
Protected methods | |
---|---|
open Any! |
Create entrance transition. |
open Unit |
Callback when entrance transition is ended. |
open Unit |
Callback when entrance transition is prepared. |
open Unit |
Callback when entrance transition is started. |
open Unit |
runEntranceTransition(entranceTransition: Any!) Run entrance transition. |
Inherited functions | |
---|---|
Public methods
getProgressBarManager
fun getProgressBarManager(): ProgressBarManager!
Returns the ProgressBarManager
.
Return | |
---|---|
ProgressBarManager! |
The ProgressBarManager . |
onDestroyView
open fun onDestroyView(): Unit
onViewCreated
open fun onViewCreated(
@NonNull view: View,
@Nullable savedInstanceState: Bundle?
): Unit
prepareEntranceTransition
open fun prepareEntranceTransition(): Unit
Enables entrance transition.
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.
startEntranceTransition
open fun startEntranceTransition(): Unit
When fragment finishes loading data, it should call startEntranceTransition() to execute the entrance transition. startEntranceTransition() will start transition only if both two conditions are satisfied:
If startEntranceTransition() is called before onViewCreated(), it will be pending and executed when view is created.
Protected methods
createEntranceTransition
protected open fun createEntranceTransition(): Any!
Create entrance transition. Subclass can override to load transition from resource or construct manually. Typically app does not need to override the default transition that browse and details provides.
onEntranceTransitionEnd
protected open fun onEntranceTransitionEnd(): Unit
Callback when entrance transition is ended.
onEntranceTransitionPrepare
protected open fun onEntranceTransitionPrepare(): Unit
Callback when entrance transition is prepared. This is when fragment should stop user input and animations.
onEntranceTransitionStart
protected