VerticalGridFragment
open class VerticalGridFragment : BaseFragment
A fragment for creating leanback vertical grids.
Renders a vertical grid of objects given a VerticalGridPresenter
and an ObjectAdapter
.
Summary
Public constructors |
A fragment for creating leanback vertical grids.
|
Protected methods |
open Any! |
|
open Unit |
|
Inherited functions |
From class BrandedFragment
Drawable! |
getBadgeDrawable()
Returns the badge drawable used in the fragment title.
|
Int |
getSearchAffordanceColor()
Returns the color used to draw the search affordance.
|
SearchOrbView.Colors! |
getSearchAffordanceColors()
Returns the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.
|
CharSequence! |
getTitle()
Returns the title text for the fragment.
|
View! |
getTitleView()
Returns the view that implements TitleViewAdapter.Provider .
|
TitleViewAdapter! |
getTitleViewAdapter()
Returns the TitleViewAdapter implemented by title view.
|
Unit |
installTitleView(inflater: LayoutInflater!, parent: ViewGroup!, savedInstanceState: Bundle!)
Inflate title view and add to parent. This method should be called in Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle) .
|
Boolean |
isShowingTitle()
Returns true/false to indicate the visibility of TitleView.
|
View! |
onInflateTitleView(inflater: LayoutInflater!, parent: ViewGroup!, savedInstanceState: Bundle!)
Called by installTitleView(LayoutInflater, ViewGroup, Bundle) to inflate title view. Default implementation uses layout file lb_browse_title. Subclass may override and use its own layout, the layout must have a descendant with id browse_title_group that implements TitleViewAdapter.Provider . Subclass may return null if no title is needed.
|
Unit |
onPause()
|
Unit |
onResume()
|
Unit |
onSaveInstanceState(outState: Bundle!)
|
Unit |
onStart()
|
Unit |
setBadgeDrawable(drawable: Drawable!)
Sets the drawable displayed in the fragment title.
|
Unit |
setOnSearchClickedListener(listener: OnClickListener!)
Sets a click listener for the search affordance.
The presence of a listener will change the visibility of the search affordance in the fragment title. When set to non-null, the title will contain an element that a user may click to begin a search.
The listener's onClick method will be invoked when the user clicks on the search element.
|
Unit |
setSearchAffordanceColor(color: Int)
Sets the color used to draw the search affordance. A default brighter color will be set by the framework.
|
Unit |
setSearchAffordanceColors(colors: SearchOrbView.Colors!)
Sets the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.
|
Unit |
setTitle(title: CharSequence!)
Sets title text for the fragment.
|
Unit |
setTitleView(titleView: View!)
Sets the view that implemented TitleViewAdapter .
|
Unit |
showTitle(show: Boolean)
Shows or hides the title view.
|
Unit |
showTitle(flags: Int)
Changes title view's components visibility and shows title.
|
|
From class BaseFragment
ProgressBarManager! |
getProgressBarManager()
Returns the ProgressBarManager .
|
Unit |
onCreate(savedInstanceState: Bundle?)
|
Unit |
onEntranceTransitionEnd()
Callback when entrance transition is ended.
|
Unit |
onEntranceTransitionPrepare()
Callback when entrance transition is prepared. This is when fragment should stop user input and animations.
|
Unit |
onEntranceTransitionStart()
Callback when entrance transition is started. This is when fragment should stop processing layout.
|
Unit |
onViewCreated(@NonNull view: View, @Nullable savedInstanceState: Bundle?)
|
Unit |
prepareEntranceTransition()
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:
Workaround the problem that activity transition is not available between launcher and app. Browse activity must programmatically start the slide-in transition.
Separates DetailsOverviewRow transition from other rows transition. So that the DetailsOverviewRow transition can be executed earlier without waiting for all rows to be loaded.
Transition object is returned by createEntranceTransition(). Typically the app does not need override the default transition that browse and details provides.
|
Unit |
startEntranceTransition()
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:
prepareEntranceTransition() was called.
has not executed entrance transition yet.
If startEntranceTransition() is called before onViewCreated(), it will be pending and executed when view is created.
|
|
Public constructors
Public methods
getAdapter
open fun getAdapter