belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
VerticalGridPresenter
public
class
VerticalGridPresenter
extends Presenter
java.lang.Object | ||
↳ | android.support.v17.leanback.widget.Presenter | |
↳ | android.support.v17.leanback.widget.VerticalGridPresenter |
A presenter that renders objects in a VerticalGridView
.
Summary
Nested classes | |
---|---|
class |
VerticalGridPresenter.ViewHolder
ViewHolder for the VerticalGridPresenter. |
Public constructors | |
---|---|
VerticalGridPresenter()
Constructs a VerticalGridPresenter with defaults. |
|
VerticalGridPresenter(int focusZoomFactor)
Constructs a VerticalGridPresenter with the given parameters. |
|
VerticalGridPresenter(int focusZoomFactor, boolean useFocusDimmer)
Constructs a VerticalGridPresenter with the given parameters. |
Public methods | |
---|---|
final
boolean
|
areChildRoundedCornersEnabled()
Returns true if rounded corners are enabled for children of this row. |
final
void
|
enableChildRoundedCorners(boolean enable)
Enables or disabled rounded corners on children of this row. |
final
int
|
getFocusZoomFactor()
Returns the zoom factor used for focus highlighting. |
final
boolean
|
getKeepChildForeground()
Returns true if keeps foreground of child of this grid, the foreground will not be used for overlay color. |
int
|
getNumberOfColumns()
Returns the number of columns in the vertical grid. |
final
OnItemViewClickedListener
|
getOnItemViewClickedListener()
Returns the item clicked listener. |
final
OnItemViewSelectedListener
|
getOnItemViewSelectedListener()
Returns the item selected listener. |
final
boolean
|
getShadowEnabled()
Returns true if child shadow is enabled. |
final
boolean
|
isFocusDimmerUsed()
Returns true if the focus dimmer is used for focus highlighting; false otherwise. |
boolean
|
isUsingDefaultShadow()
Default implementation returns true if SDK version >= 21, shadow (either static or z-order
based) will be applied to each individual child of |
boolean
|
isUsingZOrder(Context context)
Returns true if SDK >= L, where Z shadow is enabled so that Z order is enabled on each child of vertical grid. |
void
|
onBindViewHolder(Presenter.ViewHolder viewHolder, Object item)
Binds a |
final
VerticalGridPresenter.ViewHolder
|
onCreateViewHolder(ViewGroup parent)
Creates a new |
void
|
onUnbindViewHolder(Presenter.ViewHolder viewHolder)
Unbinds a |
void
|
setEntranceTransitionState(VerticalGridPresenter.ViewHolder holder, boolean afterEntrance)
Changes the visibility of views. |
final
void
|
setKeepChildForeground(boolean keep)
Set if keeps foreground of child of this grid, the foreground will not be used for overlay color. |
void
|
setNumberOfColumns(int numColumns)
Sets the number of columns in the vertical grid. |
final
void
|
setOnItemViewClickedListener(OnItemViewClickedListener listener)
Sets the item clicked listener. |
final
void
|
setOnItemViewSelectedListener(OnItemViewSelectedListener listener)
Sets the item selected listener. |
final
void
|
setShadowEnabled(boolean enabled)
Enable or disable child shadow. |
Protected methods | |
---|---|
VerticalGridPresenter.ViewHolder
|
createGridViewHolder(ViewGroup parent)
Subclass may override this to inflate a different layout. |
ShadowOverlayHelper.Options
|
createShadowOverlayOptions()
Create ShadowOverlayHelper Options. |
void
|
initializeGridViewHolder(VerticalGridPresenter.ViewHolder vh)
Called after a |
Inherited methods | |
---|---|
From
class
android.support.v17.leanback.widget.Presenter
| |
From
class
java.lang.Object
| |
From
interface
android.support.v17.leanback.widget.FacetProvider
|
Public constructors
VerticalGridPresenter
VerticalGridPresenter ()
Constructs a VerticalGridPresenter with defaults.
Uses ZOOM_FACTOR_MEDIUM
for focus zooming and
enabled dimming on focus.
VerticalGridPresenter
VerticalGridPresenter (int focusZoomFactor)
Constructs a VerticalGridPresenter with the given parameters.
Parameters | |
---|---|
focusZoomFactor |
int : Controls the zoom factor used when an item view is focused. One of
ZOOM_FACTOR_NONE ,
ZOOM_FACTOR_SMALL ,
ZOOM_FACTOR_XSMALL ,
ZOOM_FACTOR_MEDIUM ,
ZOOM_FACTOR_LARGE
enabled dimming on focus.
|
VerticalGridPresenter
VerticalGridPresenter (int focusZoomFactor, boolean useFocusDimmer)
Constructs a VerticalGridPresenter with the given parameters.
Parameters | |
---|---|
focusZoomFactor |
int : Controls the zoom factor used when an item view is focused. One of
ZOOM_FACTOR_NONE ,
ZOOM_FACTOR_SMALL ,
ZOOM_FACTOR_XSMALL ,
ZOOM_FACTOR_MEDIUM ,
ZOOM_FACTOR_LARGE |
useFocusDimmer |
boolean : determines if the FocusHighlighter will use the dimmer
|
Public methods
areChildRoundedCornersEnabled
boolean areChildRoundedCornersEnabled ()
Returns true if rounded corners are enabled for children of this row.
Returns | |
---|---|
boolean |
enableChildRoundedCorners
void enableChildRoundedCorners (boolean enable)
Enables or disabled rounded corners on children of this row. Supported on Android SDK >= L.
Parameters | |
---|---|
enable |
boolean |
getFocusZoomFactor
int getFocusZoomFactor ()
Returns the zoom factor used for focus highlighting.
Returns | |
---|---|
int |
getKeepChildForeground
boolean getKeepChildForeground ()
Returns true if keeps foreground of child of this grid, the foreground will not be used for overlay color. Default value is true.
Returns | |
---|---|
boolean |
True if keeps foreground of child of this grid. |
getNumberOfColumns
int getNumberOfColumns ()
Returns the number of columns in the vertical grid.
Returns | |
---|---|
int |
getOnItemViewClickedListener
OnItemViewClickedListener getOnItemViewClickedListener ()
Returns the item clicked listener.
Returns | |
---|---|
OnItemViewClickedListener |
getOnItemViewSelectedListener
OnItemViewSelectedListener getOnItemViewSelectedListener ()
Returns the item selected listener.
Returns | |
---|---|
OnItemViewSelectedListener |
getShadowEnabled
boolean getShadowEnabled ()
Returns true if child shadow is enabled. This is not only for enable/disable default shadow implementation but also subclass must respect this flag.
Returns | |
---|---|
boolean |
isFocusDimmerUsed
boolean isFocusDimmerUsed ()
Returns true if the focus dimmer is used for focus highlighting; false otherwise.
Returns | |
---|---|
boolean |
isUsingDefaultShadow
boolean isUsingDefaultShadow ()
Default implementation returns true if SDK version >= 21, shadow (either static or z-order
based) will be applied to each individual child of VerticalGridView
.
Subclass may return false to disable default implementation of shadow and provide its own.
Returns | |
---|---|
boolean |
isUsingZOrder
boolean isUsingZOrder (Context context)
Returns true if SDK >= L, where Z shadow is enabled so that Z order is enabled on each child of vertical grid. If subclass returns false in isUsingDefaultShadow() and does not use Z-shadow on SDK >= L, it should override isUsingZOrder() return false.
Parameters | |
---|---|
context |
Context |
Returns | |
---|---|
boolean |
onBindViewHolder
void onBindViewHolder (Presenter.ViewHolder viewHolder, Object item)
Binds a View
to an item.
Parameters | |
---|---|
viewHolder |
Presenter.ViewHolder |
item |
Object |
onCreateViewHolder
VerticalGridPresenter.ViewHolder onCreateViewHolder (ViewGroup parent)
Creates a new View
.
Parameters | |
---|---|
parent |
ViewGroup |
Returns | |
---|---|
VerticalGridPresenter.ViewHolder |
onUnbindViewHolder
void onUnbindViewHolder (Presenter.ViewHolder viewHolder)
Unbinds a View
from an item. Any expensive references may be
released here, and any fields that are not bound for every item should be
cleared here.
Parameters | |
---|---|
viewHolder |
Presenter.ViewHolder |
setEntranceTransitionState
void setEntranceTransitionState (VerticalGridPresenter.ViewHolder holder, boolean afterEntrance)
Changes the visibility of views. The entrance transition will be run against the views that change visibilities. This method is called by the fragment, it should not be called directly by the application.
Parameters | |
---|---|
holder |
VerticalGridPresenter.ViewHolder : The ViewHolder for the vertical grid. |
afterEntrance |
boolean : true if children of vertical grid participating in entrance transition
should be set to visible, false otherwise.
|
setKeepChildForeground
void setKeepChildForeground (boolean keep)
Set if keeps foreground of child of this grid, the foreground will not be used for overlay color. Default value is true.
Parameters | |
---|---|
keep |
boolean : True if keep foreground of child of this grid.
|
setNumberOfColumns
void setNumberOfColumns (int numColumns)
Sets the number of columns in the vertical grid.
Parameters | |
---|---|
numColumns |
int |
setOnItemViewClickedListener
void setOnItemViewClickedListener (OnItemViewClickedListener listener)
Sets the item clicked listener.
OnItemViewClickedListener will override View.OnClickListener
that
item presenter sets during onCreateViewHolder(ViewGroup)
.
So in general, developer should choose one of the listeners but not both.
Parameters | |
---|---|
listener |
OnItemViewClickedListener |
setOnItemViewSelectedListener
void setOnItemViewSelectedListener (OnItemViewSelectedListener listener)
Sets the item selected listener. Since this is a grid the row parameter is always null.
Parameters | |
---|---|
listener |
OnItemViewSelectedListener |
setShadowEnabled
void setShadowEnabled (boolean enabled)
Enable or disable child shadow. This is not only for enable/disable default shadow implementation but also subclass must respect this flag.
Parameters | |
---|---|
enabled |
boolean |
Protected methods
createGridViewHolder
VerticalGridPresenter.ViewHolder createGridViewHolder (ViewGroup parent)
Subclass may override this to inflate a different layout.
Parameters | |
---|---|
parent |
ViewGroup |
Returns | |
---|---|
VerticalGridPresenter.ViewHolder |
createShadowOverlayOptions
ShadowOverlayHelper.Options createShadowOverlayOptions ()
Create ShadowOverlayHelper Options. Subclass may override.
e.g.
return new ShadowOverlayHelper.Options().roundedCornerRadius(10);
Returns | |
---|---|
ShadowOverlayHelper.Options |
The options to be used for shadow, overlay and rounded corner. |
initializeGridViewHolder
void initializeGridViewHolder (VerticalGridPresenter.ViewHolder vh)
Called after a VerticalGridPresenter.ViewHolder
is created.
Subclasses may override this method and start by calling
super.initializeGridViewHolder(ViewHolder).
Parameters | |
---|---|
vh |
VerticalGridPresenter.ViewHolder : The ViewHolder to initialize for the vertical grid.
|
Interfaces
- BaseGridView.OnKeyInterceptListener
- BaseGridView.OnMotionInterceptListener
- BaseGridView.OnTouchInterceptListener
- BaseGridView.OnUnhandledKeyListener
- BaseOnItemViewClickedListener
- BaseOnItemViewSelectedListener
- BrowseFrameLayout.OnChildFocusListener
- BrowseFrameLayout.OnFocusSearchListener
- FacetProvider
- FacetProviderAdapter
- FocusHighlight
- FragmentAnimationProvider
- ImeKeyMonitor
- ImeKeyMonitor.ImeKeyListener
- MultiActionsProvider
- OnActionClickedListener
- OnChildLaidOutListener
- OnChildSelectedListener
- OnItemViewClickedListener
- OnItemViewSelectedListener
- PlaybackSeekUi
- SearchBar.SearchBarListener
- SearchBar.SearchBarPermissionListener
- SearchEditText.OnKeyboardDismissListener
- SpeechRecognitionCallback
- TitleViewAdapter.Provider
- ViewHolderTask
Classes
- AbstractDetailsDescriptionPresenter
- AbstractDetailsDescriptionPresenter.ViewHolder
- AbstractMediaItemPresenter
- AbstractMediaItemPresenter.ViewHolder
- AbstractMediaListHeaderPresenter
- AbstractMediaListHeaderPresenter.ViewHolder
- Action
- ArrayObjectAdapter
- BaseCardView
- BaseCardView.LayoutParams
- BaseGridView
- BrowseFrameLayout
- ClassPresenterSelector
- ControlButtonPresenterSelector
- CursorObjectAdapter
- DetailsOverviewLogoPresenter
- DetailsOverviewLogoPresenter.ViewHolder
- DetailsOverviewRow
- DetailsOverviewRow.Listener
- DetailsOverviewRowPresenter
- DetailsOverviewRowPresenter.ViewHolder
- DetailsParallax
- DiffCallback
- DividerPresenter
- DividerRow
- FocusHighlightHelper
- FullWidthDetailsOverviewRowPresenter
- FullWidthDetailsOverviewRowPresenter.Listener
- FullWidthDetailsOverviewRowPresenter.ViewHolder
- FullWidthDetailsOverviewRowPresenter.ViewHolder.DetailsOverviewRowListener
- FullWidthDetailsOverviewSharedElementHelper
- GuidanceStylist
- GuidanceStylist.Guidance
- GuidedAction
- GuidedAction.Builder
- GuidedAction.BuilderBase
- GuidedActionDiffCallback
- GuidedActionEditText
- GuidedActionsStylist
- GuidedActionsStylist.ViewHolder
- GuidedDatePickerAction
- GuidedDatePickerAction.Builder
- GuidedDatePickerAction.BuilderBase
- HeaderItem
- HorizontalGridView
- HorizontalHoverCardSwitcher
- ImageCardView
- ItemAlignmentFacet
- ItemAlignmentFacet.ItemAlignmentDef
- ItemBridgeAdapter
- ItemBridgeAdapter.AdapterListener
- ItemBridgeAdapter.ViewHolder
- ItemBridgeAdapter.Wrapper
- ItemBridgeAdapterShadowOverlayWrapper
- ListRow
- ListRowHoverCardView
- ListRowPresenter
- ListRowPresenter.SelectItemViewHolderTask
- ListRowPresenter.ViewHolder
- ListRowView
- MultiActionsProvider.MultiAction
- ObjectAdapter
- ObjectAdapter.DataObserver
- OnChildViewHolderSelectedListener
- PageRow
- Parallax
- Parallax.FloatProperty
- Parallax.IntProperty
- Parallax.PropertyMarkerValue
- ParallaxEffect
- ParallaxTarget
- ParallaxTarget.DirectPropertyTarget
- ParallaxTarget.PropertyValuesHolderTarget
- PlaybackControlsRow
- PlaybackControlsRow.ClosedCaptioningAction
- PlaybackControlsRow.FastForwardAction
- PlaybackControlsRow.HighQualityAction
- PlaybackControlsRow.MoreActions
- PlaybackControlsRow.MultiAction
- PlaybackControlsRow.OnPlaybackProgressCallback
- PlaybackControlsRow.PictureInPictureAction
- PlaybackControlsRow.PlayPauseAction
- PlaybackControlsRow.RepeatAction
- PlaybackControlsRow.RewindAction
- PlaybackControlsRow.ShuffleAction
- PlaybackControlsRow.SkipNextAction
- PlaybackControlsRow.SkipPreviousAction
- PlaybackControlsRow.ThumbsAction
- PlaybackControlsRow.ThumbsDownAction
- PlaybackControlsRow.ThumbsUpAction
- PlaybackControlsRowPresenter
- PlaybackControlsRowPresenter.ViewHolder
- PlaybackRowPresenter
- PlaybackRowPresenter.ViewHolder
- PlaybackSeekDataProvider
- PlaybackSeekDataProvider.ResultCallback
- PlaybackSeekUi.Client
- PlaybackTransportRowPresenter
- PlaybackTransportRowPresenter.ViewHolder
- Presenter
- Presenter.ViewHolder
- Presenter.ViewHolderTask
- PresenterSelector
- PresenterSwitcher
- RecyclerViewParallax
- RecyclerViewParallax.ChildPositionProperty
- Row
- RowHeaderPresenter
- RowHeaderPresenter.ViewHolder
- RowHeaderView
- RowPresenter
- RowPresenter.ViewHolder
- SearchBar
- SearchEditText
- SearchOrbView
- SearchOrbView.Colors
- SectionRow
- ShadowOverlayContainer
- ShadowOverlayHelper
- ShadowOverlayHelper.Builder
- ShadowOverlayHelper.Options
- SinglePresenterSelector
- SparseArrayObjectAdapter
- SpeechOrbView
- TitleHelper
- TitleView
- TitleViewAdapter
- VerticalGridPresenter
- VerticalGridPresenter.ViewHolder
- VerticalGridView
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-11 UTC.