package

androidx.leanback.widget

Overview

Support classes providing low level Leanback user interface building blocks: widgets and helpers.

The core interface to the developer’s model is the ObjectAdapter. It is similar to Adapter and the RecyclerView Adapter, but separates iterating items from presenting them as Views. Concrete implementations include ArrayObjectAdapter and CursorObjectAdapter, but a developer is free to use a subclass of an ObjectAdapter to iterate over any existing Object hierarchy.

A Presenter creates Views and binds data from an Object to those Views. This is the complementary piece to ObjectAdapter that corresponds to existing Android adapter classes. The benefit to separating out a Presenter is that we can use it to generate Views outside of the context of an adapter. For example, a UI may represent data from a single Object in several places at once. Each View that needs to be generated can be produced by a different Presenter, while the Object is retrieved from the ObjectAdapter once.

A PresenterSelector determines which Presenter to use for a given Object from an ObjectAdapter. Two common cases are when an ObjectAdapter uses the same View type for every element (SinglePresenterSelector), and when the Presenter is determined by the Java class of the element (ClassPresenterSelector). A developer is able to implement any selection logic as a PresenterSelector. For example, if all the elements of an ObjectAdapter have the same type, but certain elements are to be rendered using a 'promotional content' view in the developer’s application, the PresenterSelector may inspect the fields of each element before choosing the appropriate Presenter.

The basic navigation model for Leanback is that of a vertical list of rows, each of which may be a horizontal list of items. Therefore, Leanback uses ObjectAdapters both for defining the horizontal data items as well as the list of rows themselves.

Leanback defines a few basic data model classes for rows: the Row, which defines the abstract concept of a row with a header; and ListRow, a concrete Row implementation that uses an ObjectAdapter to present a horizontal list of items. The corresponding presenter for the ListRow is the ListRowPresenter.

Other types of Rows and corresponding RowPresenters are provided; however the application may define a custom subclass of Row and RowPresenter.

Interfaces

BaseGridView.OnKeyInterceptListenerListener for intercepting key dispatch events.
BaseGridView.OnLayoutCompletedListenerInterface for receiving notification when BaseGridView has completed a full layout calculation.
BaseGridView.OnMotionInterceptListenerListener for intercepting generic motion dispatch events.
BaseGridView.OnTouchInterceptListenerListener for intercepting touch dispatch events.
BaseGridView.OnUnhandledKeyListenerListener for intercepting unhandled key events.
BaseGridView.SmoothScrollByBehaviorDefines behavior of duration and interpolator for smoothScrollBy().
BaseOnItemViewClickedListener<T>Interface for receiving notification when an item view holder is clicked.
BaseOnItemViewSelectedListener<T>Interface for receiving notification when a row or item becomes selected.
BrowseFrameLayout.OnChildFocusListenerInterface for managing child focus in a BrowseFrameLayout.
BrowseFrameLayout.OnFocusSearchListenerInterface for selecting a focused view in a BrowseFrameLayout when the system focus finder couldn't find a view to focus.
FacetProviderThis is the query interface to supply optional features(aka facets) on an object without the need of letting the object to subclass or implement java interfaces.
FacetProviderAdapterOptional interface that implemented by RecyclerView.Adapter to query FacetProvider for a given item view type within Adapter.
FocusHighlightInterface for highlighting the item that has focus.
FragmentAnimationProviderFragmentAnimationProvider supplies animations for use during a fragment's onCreateAnimator callback.
GuidedActionAdapter.ClickListenerObject listening for click events within a GuidedActionAdapter.
GuidedActionAdapter.EditListenerObject listening for edit events within a GuidedActionAdapter.
GuidedActionAdapter.FocusListenerObject listening for focus events within a GuidedActionAdapter.
GuidedActionAutofillSupportInterface for a custom EditText subclass to support autofill in GuidedStepSupportFragment.
GuidedActionAutofillSupport.OnAutofillListenerListener for autofill event.
ImeKeyMonitorInterface for an EditText subclass that can delegate calls to onKeyPreIme up to a registered listener.
ImeKeyMonitor.ImeKeyListenerListener interface for key events intercepted pre-IME by edit text objects.
MultiActionsProviderAn interface implemented by the user if they wish to provide actions for a media item row to be displayed by an AbstractMediaItemPresenter.
OnActionClickedListenerInterface for receiving notification when an Action is clicked.
OnChildLaidOutListenerInterface for receiving notification when a child of this ViewGroup has been laid out.
OnChildSelectedListenerInterface for receiving notification when a child of this ViewGroup has been selected.
OnItemViewClickedListenerInterface for receiving notification when a item view holder is clicked.
OnItemViewSelectedListenerInterface for receiving notification when a row or item becomes selected.
PlaybackSeekUiInterface to be implemented by UI component to support seeking.
PlaybackTransportRowView.OnUnhandledKeyListener
SearchBar.SearchBarListenerInterface for receiving notification of search query changes.
SearchBar.SearchBarPermissionListenerInterface that handles runtime permissions requests.
SearchEditText.OnKeyboardDismissListenerInterface for receiving notification when the keyboard is dismissed.
SpeechRecognitionCallbackInterface for receiving notification that speech recognition should be initiated.
TitleViewAdapter.ProviderInterface to be implemented by a customized widget class to implement TitleViewAdapter.
ViewHolderTaskInterface for schedule task on a ViewHolder.

Classes

AbstractDetailsDescriptionPresenterAn abstract Presenter for rendering a detailed description of an item.
AbstractDetailsDescriptionPresenter.ViewHolderThe ViewHolder for the AbstractDetailsDescriptionPresenter.
AbstractMediaItemPresenterAbstract Presenter class for rendering media items in a playlist format.
AbstractMediaItemPresenter.ViewHolderThe ViewHolder for the AbstractMediaItemPresenter.
AbstractMediaListHeaderPresenterAbstract presenter class for rendering the header for a list of media items in a playlist.
AbstractMediaListHeaderPresenter.ViewHolderThe ViewHolder for the AbstractMediaListHeaderPresenter.
ActionAn action contains one or two lines of text, an optional image and an optional id.
ArrayObjectAdapterAn ObjectAdapter implemented with an java.util.ArrayList.
BackgroundHelperHelper for view backgrounds.
BaseCardViewA card style layout that responds to certain state changes.
BaseCardView.LayoutParamsPer-child layout information associated with BaseCardView.
BaseGridViewAn abstract base class for vertically and horizontally scrolling lists.
BrowseFrameLayoutA ViewGroup for managing focus behavior between overlapping views.
BrowseRowsFrameLayoutCustomized FrameLayout excludes margin of child from calculating the child size.
ClassPresenterSelectorA ClassPresenterSelector selects a Presenter based on the item's Java class.
ControlButtonPresenterSelectorDisplays primary and secondary controls for a PlaybackControlsRow.
CursorObjectAdapterAn ObjectAdapter implemented with a .
DetailsOverviewLogoPresenterPresenter that responsible to create a ImageView and bind to DetailsOverviewRow.
DetailsOverviewLogoPresenter.ViewHolderViewHolder for Logo view of DetailsOverviewRow.
DetailsOverviewRowAn overview Row for a details fragment.
DetailsOverviewRow.ListenerListener for changes of DetailsOverviewRow.
DetailsOverviewRowPresenterRenders a DetailsOverviewRow to display an overview of an item.
DetailsOverviewRowPresenter.ViewHolderA ViewHolder for the DetailsOverviewRow.
DetailsParallaxSubclass of Parallax object that tracks overview row's top and bottom edge in DetailsFragment or DetailsSupportFragment.
DetailsParallaxDrawableHelper class responsible for wiring in parallax effect in DetailsFragment.
DiffCallback<Value>Callback that informs ArrayObjectAdapter how to compute list updates when using DiffUtil in ArrayObjectAdapter.setItems(List, DiffCallback) method.
DividerPresenterDividerPresenter provides a default presentation for DividerRow in HeadersFragment.
DividerRowUsed to represent divider in HeadersFragment.
FocusHighlightHelperSets up the highlighting behavior when an item gains focus.
FullWidthDetailsOverviewRowPresenterRenders a DetailsOverviewRow to display an overview of an item.
FullWidthDetailsOverviewRowPresenter.ListenerListeners for events on ViewHolder.
FullWidthDetailsOverviewRowPresenter.ViewHolderA ViewHolder for the DetailsOverviewRow.
FullWidthDetailsOverviewRowPresenter.ViewHolder.DetailsOverviewRowListener
FullWidthDetailsOverviewSharedElementHelperHelper class to assist delayed shared element activity transition for view created by FullWidthDetailsOverviewRowPresenter.
GridLayoutManagerA implementation that lays out items in a grid for leanback VerticalGridView and HorizontalGridView.
GuidanceStylistGuidanceStylist is used within a GuidedStepFragment to display contextual information for the decision(s) required at that step.
GuidanceStylist.GuidanceA data class representing contextual information for a GuidedStepFragment.
GuidedActionA data class which represents an action within a GuidedStepFragment.
GuidedAction.BuilderBuilds a GuidedAction object.
GuidedAction.BuilderBase<B>Base builder class to build a GuidedAction object.
GuidedActionAdapterGuidedActionAdapter instantiates views for guided actions, and manages their interactions.
GuidedActionAdapterGroupInternal implementation manages a group of GuidedActionAdapters, control the next action after editing finished, maintain the Ime open/close status.
GuidedActionAppCompatEditTextA custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment.
GuidedActionDiffCallbackDiffCallback used for GuidedActions, see GuidedStepSupportFragment.setActionsDiffCallback(DiffCallback).
GuidedActionEditTextA custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment.
GuidedActionsStylistGuidedActionsStylist is used within a GuidedStepFragment to supply the right-side panel where users can take actions.
GuidedActionsStylist.ViewHolderViewHolder caches information about the action item layouts' subviews.
GuidedDatePickerActionSubclass of GuidedAction that can choose a date.
GuidedDatePickerAction.BuilderBuilder class to build a GuidedDatePickerAction.
GuidedDatePickerAction.BuilderBase<B>Base Builder class to build GuidedDatePickerAction.
HeaderItemA header item describes the metadata of a Row, such as a category of media items.
HorizontalGridViewA android.view.ViewGroup that shows items in a horizontal scrolling list.
HorizontalHoverCardSwitcherA helper class for showing a hover card view below a HorizontalGridView.
ImageCardViewA subclass of BaseCardView with an ImageView as its main region.
InvisibleRowPresenter
ItemAlignmentFacetOptional facet provided by RecyclerView.Adapter or RecyclerView.ViewHolder for use in HorizontalGridView and VerticalGridView.
ItemAlignmentFacet.ItemAlignmentDefDefinition of an alignment position under a view.
ItemBridgeAdapterBridge from Presenter to .
ItemBridgeAdapter.AdapterListenerInterface for listening to ViewHolder operations.
ItemBridgeAdapter.ViewHolderViewHolder for the ItemBridgeAdapter.
ItemBridgeAdapter.WrapperInterface for wrapping a view created by a Presenter into another view.
ItemBridgeAdapterShadowOverlayWrapperA wrapper class working with ItemBridgeAdapter to wrap item view in a ShadowOverlayContainer.
LeanbackAppCompatViewInflaterInflater that converts leanback non-AppCpmpat views in layout to AppCompat versions.
ListRowA Row composed of a optional HeaderItem, and an ObjectAdapter describing the items in the list.
ListRowHoverCardViewListRowHoverCardView contains a title and description.
ListRowPresenterListRowPresenter renders ListRow using a HorizontalGridView hosted in a ListRowView.
ListRowPresenter.SelectItemViewHolderTaskA task on the ListRowPresenter.ViewHolder that can select an item by position in the HorizontalGridView and perform an optional item task on it.
ListRowPresenter.ViewHolderViewHolder for the ListRowPresenter.
ListRowViewListRowView is a android.view.ViewGroup which always contains a HorizontalGridView, and may optionally include a hover card.
MediaNowPlayingViewThe view displaying 3 animated peak meters next to each other when a media item is playing.
MultiActionsProvider.MultiActionMultiAction represents an action that can have multiple states.
NonOverlappingLinearLayout
ObjectAdapterBase class adapter to be used in leanback activities.
ObjectAdapter.DataObserverA DataObserver can be notified when an ObjectAdapter's underlying data changes.
OnChildViewHolderSelectedListenerInterface for receiving notification when a child of this ViewGroup has been selected.
PageRowUsed to represent content spanning full page.
PagingIndicatorA page indicator with dots.
PagingIndicator.Dot
Parallax<PropertyT>Parallax tracks a list of dynamic s typically representing foreground UI element positions on screen.
Parallax.FloatPropertyFloatProperty provide access to an index based integer type property inside Parallax.
Parallax.IntPropertyIntProperty provide access to an index based integer type property inside Parallax.
Parallax.PropertyMarkerValue<PropertyT>Class holding a fixed value for a Property in Parallax.
ParallaxEffectParallaxEffect class drives changes in ParallaxTarget in response to changes in variables defined in Parallax.
ParallaxTargetParallaxTarget is responsible for updating the target through the ParallaxTarget.update(float) method or the ParallaxTarget.directUpdate(Number) method when ParallaxTarget.isDirectMapping() is true.
ParallaxTarget.DirectPropertyTarget<T, V>DirectPropertyTarget is to support direct mapping into either Integer Property or Float Property.
ParallaxTarget.PropertyValuesHolderTargetPropertyValuesHolderTarget is an implementation of ParallaxTarget that uses to update the target object.
PlaybackControlsRowA Row of playback controls to be displayed by a PlaybackControlsRowPresenter.
PlaybackControlsRow.ClosedCaptioningActionAn action for displaying a CC (Closed Captioning) icon.
PlaybackControlsRow.FastForwardActionAn action displaying an icon for fast forward.
PlaybackControlsRow.HighQualityActionAn action for displaying a HQ (High Quality) icon.
PlaybackControlsRow.MoreActionsAn action displaying an icon for "more actions".
PlaybackControlsRow.MultiActionBase class for an action comprised of a series of icons.
PlaybackControlsRow.OnPlaybackProgressCallbackListener for progress or duration change.
PlaybackControlsRow.PictureInPictureActionAn action displaying an icon for picture-in-picture.
PlaybackControlsRow.PlayPauseActionAn action displaying icons for play and pause.
PlaybackControlsRow.RepeatActionAn action for displaying three repeat states: none, one, or all.
PlaybackControlsRow.RewindActionAn action displaying an icon for rewind.
PlaybackControlsRow.ShuffleActionAn action for displaying a shuffle icon.
PlaybackControlsRow.SkipNextActionAn action displaying an icon for skip next.
PlaybackControlsRow.SkipPreviousActionAn action displaying an icon for skip previous.
PlaybackControlsRow.ThumbsActionA base class for displaying a thumbs action.
PlaybackControlsRow.ThumbsDownActionAn action displaying an icon for thumbs down.
PlaybackControlsRow.ThumbsUpActionAn action displaying an icon for thumbs up.
PlaybackControlsRowPresenterA PlaybackControlsRowPresenter renders a PlaybackControlsRow to display a series of playback control buttons.
PlaybackControlsRowPresenter.ViewHolderA ViewHolder for the PlaybackControlsRow.
PlaybackRowPresenterSubclass of RowPresenter that can define the desired behavior when the view reappears.
PlaybackRowPresenter.ViewHolderThis container is used for trapping click events and passing them to the playback controls.
PlaybackSeekDataProviderClass to be implemented by app to provide seeking data and thumbnails to UI.
PlaybackSeekDataProvider.ResultCallbackClient to receive result for PlaybackSeekDataProvider.getThumbnail(int, PlaybackSeekDataProvider.ResultCallback).
PlaybackSeekUi.ClientClient (e.g.
PlaybackTransportRowPresenterA PlaybackTransportRowPresenter renders a PlaybackControlsRow to display a series of playback control buttons.
PlaybackTransportRowPresenter.ViewHolderA ViewHolder for the PlaybackControlsRow supporting seek UI.
PlaybackTransportRowViewView for PlaybackTransportRowPresenter that has a custom focusSearch.
PresenterA Presenter is used to generate Views and bind Objects to them on demand.
Presenter.ViewHolderViewHolder can be subclassed and used to cache any view accessors needed to improve binding performance (for example, results of findViewById) without needing to subclass a View.
Presenter.ViewHolderTaskBase class to perform a task on Presenter.ViewHolder.
PresenterSelectorA PresenterSelector is used to obtain a Presenter for a given Object.
PresenterSwitcherAn abstract helper class that switches a view in its parent view using a PresenterSelector.
RecyclerViewParallaxImplementation of Parallax class for RecyclerView.
RecyclerViewParallax.ChildPositionPropertySubclass of Parallax.IntProperty.
RowThe base class for all rows.
RowHeaderPresenterRowHeaderPresenter provides a default presentation for HeaderItem using a RowHeaderView and optionally a TextView for description.
RowHeaderPresenter.ViewHolderA ViewHolder for the RowHeaderPresenter.
RowHeaderViewRowHeaderView is a header text view.
RowPresenterAn abstract Presenter that renders an Object in RowsFragment, the object can be subclass Row or a generic one.
RowPresenter.ViewHolderA ViewHolder for a Row.
ScaleFrameLayoutSubclass of FrameLayout that support scale layout area size for children.
SearchBarA search widget containing a search orb and a text entry view.
SearchEditTextEditText widget that monitors keyboard changes.
SearchOrbView

A widget that draws a search affordance, represented by a round background and an icon.

SearchOrbView.ColorsA set of colors used to display the search orb.
SectionRowUsed to represent section item in HeadersFragment.
SeekBarReplacement of SeekBar, has two bar heights and two thumb size when focused/not_focused.
SeekBar.AccessibilitySeekListener
ShadowOverlayContainerProvides an SDK version-independent wrapper to support shadows, color overlays, and rounded corners.
ShadowOverlayHelperShadowOverlayHelper is a helper class for shadow, overlay color and rounded corner.
ShadowOverlayHelper.BuilderBuilder for creating ShadowOverlayHelper.
ShadowOverlayHelper.OptionsOption values for ShadowOverlayContainer.
SinglePresenterSelectorA PresenterSelector that always returns the same Presenter.
SparseArrayObjectAdapterAn ObjectAdapter implemented with a .
SpeechOrbViewA subclass of SearchOrbView that visualizes the state of an ongoing speech recognition.
ThumbsBar
TitleHelperHelper for managing TitleView, including transitions and focus movement.
TitleViewTitle view for a leanback fragment.
TitleViewAdapterThis class allows a customized widget class to implement TitleViewAdapter.Provider and expose TitleViewAdapter methods to containing fragment (e.g.
Util
VerticalGridPresenterA presenter that renders objects in a VerticalGridView.
VerticalGridPresenter.ViewHolderViewHolder for the VerticalGridPresenter.
VerticalGridViewA android.view.ViewGroup that shows items in a vertically scrolling list.
VideoSurfaceViewActivity transition will change transitionVisibility multiple times even the view is not running transition, which causes visual flickering during activity return transition.

Annotation Types

Visibility