HorizontalGridView
open class HorizontalGridView : BaseGridView
A android.view.ViewGroup
that shows items in a horizontal scrolling list. The items come from the RecyclerView.Adapter
associated with this view.
RecyclerView.Adapter
can optionally implement FacetProviderAdapter
which provides FacetProvider
for a given view type; RecyclerView.ViewHolder
can also implement FacetProvider
. Facet from ViewHolder has a higher priority than the one from FacetProviderAdapter associated with viewType. Supported optional facets are:
-
ItemAlignmentFacet
When this facet is provided by ViewHolder or FacetProviderAdapter, it will override the item alignment settings set on HorizontalGridView. This facet also allows multiple alignment positions within one ViewHolder.
Summary
Inherited constants |
|
From class BaseGridView
Float |
ITEM_ALIGN_OFFSET_PERCENT_DISABLED
Value indicates that percent is not used.
|
Int |
SAVE_ALL_CHILD
Save on screen views plus save off screen child views without any limitation. This might cause out of memory, only use it when you are dealing with limited data.
|
Int |
SAVE_LIMITED_CHILD
Save on screen views plus save off screen child views states up to getSaveChildrenLimitNumber() .
|
Int |
SAVE_NO_CHILD
Dont save states of any child views.
|
Int |
SAVE_ON_SCREEN_CHILD
Only save on screen child views, the states are lost when they become off screen.
|
Int |
WINDOW_ALIGN_BOTH_EDGE
The first item and last item are aligned with the two edges of the viewport. When navigating in the middle of list, the focus maintains a key line location.
The key line location is calculated by "windowAlignOffset" and "windowAlignOffsetPercent"; if neither of these two is defined, the default value is 1/2 of the size.
|
Int |
WINDOW_ALIGN_HIGH_EDGE
The last item is aligned with the high edge of the viewport when navigating to the end of list. When navigating away from the end, the focus item is aligned to a key line location.
For HorizontalGridView, high edge refers to getWidth() - getPaddingRight() when RTL is false or getPaddingLeft() when RTL is true. For VerticalGridView, high edge refers to getHeight() - getPaddingBottom().
The key line location is calculated by "windowAlignOffset" and "windowAlignOffsetPercent"; if neither of these two is defined, the default value is 1/2 of the size.
Note if there are very few items between high edge and key line, use setWindowAlignmentPreferKeyLineOverHighEdge(boolean) to control whether you prefer to align the items to key line or high edge. Default is preferring key line.
|
Int |
WINDOW_ALIGN_LOW_EDGE
The first item is aligned with the low edge of the viewport. When navigating away from the first item, the focus item is aligned to a key line location.
For HorizontalGridView, low edge refers to getPaddingLeft() when RTL is false or getWidth() - getPaddingRight() when RTL is true. For VerticalGridView, low edge refers to getPaddingTop().
The key line location is calculated by "windowAlignOffset" and "windowAlignOffsetPercent"; if neither of these two is defined, the default value is 1/2 of the size.
Note if there are very few items between low edge and key line, use setWindowAlignmentPreferKeyLineOverLowEdge(boolean) to control whether you prefer to align the items to key line or low edge. Default is preferring low edge.
|
Int |
WINDOW_ALIGN_NO_EDGE
The focused item always stays in a key line location.
| |