HorizontalGridView
class HorizontalGridView : BaseGridView
| kotlin.Any | |||||
| ↳ | android.view.View | ||||
| ↳ | android.view.ViewGroup | ||||
| ↳ | androidx.recyclerview.widget.RecyclerView | ||||
| ↳ | androidx.leanback.widget.BaseGridView | ||||
| ↳ | androidx.leanback.widget.HorizontalGridView |
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:
ItemAlignmentFacetWhen 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
Public constructors |
|---|
HorizontalGridView(context: Context) |
HorizontalGridView(context: Context, attrs: AttributeSet?) |
HorizontalGridView(context: Context, attrs: AttributeSet?, defStyle: Int) |
Public functions |
|
|---|---|
Unit |
|
Boolean |
Returns true if left edge fading is enabled. |
Int |
Returns the left edge fading length in pixels. |
Int |
Returns the distance in pixels between fading start position and left padding edge. |
Boolean |
Returns true if fading right edge is enabled. |
Int |
Returns the right edge fading length in pixels. |
Int |
Sets the distance in pixels between fading start position and right padding edge. |
Int |
Returns the number of rows that the GridView is using. |
Unit |
setFadingLeftEdge(fading: Boolean)Sets the fade out left edge to transparent. |
Unit |
setFadingLeftEdgeLength(fadeLength: Int)Sets the left edge fading length in pixels. |
Unit |
setFadingLeftEdgeOffset(fadeOffset: Int)Sets the distance in pixels between fading start position and left padding edge. |
Unit |
setFadingRightEdge(fading: Boolean)Sets the fade out right edge to transparent. |
Unit |
setFadingRightEdgeLength(fadeLength: Int)Sets the right edge fading length in pixels. |
Unit |
setFadingRightEdgeOffset(fadeOffset: Int)Returns the distance in pixels between fading start position and right padding edge. |
Unit |
setNumRows(numRows: Int)Sets the number of rows. |
Unit |
setRowHeight(height: Int)Sets the row height. |
Protected functions |
|
|---|---|
Unit |
initAttributes(context: Context, attrs: AttributeSet?) |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Inherited functions |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public constructors
HorizontalGridView
HorizontalGridView(context: Context, attrs: AttributeSet?, defStyle: Int)
Public functions
getFadingLeftEdge
fun getFadingLeftEdge(): Boolean
Returns true if left edge fading is enabled.
getFadingLeftEdgeLength
fun getFadingLeftEdgeLength(): Int
Returns the left edge fading length in pixels.
getFadingLeftEdgeOffset
fun getFadingLeftEdgeOffset(): Int
Returns the distance in pixels between fading start position and left padding edge. The fading start position is positive when start position is inside left padding area. Default value is 0, means that the fading starts from left padding edge.
getFadingRightEdge
fun getFadingRightEdge(): Boolean
Returns true if fading right edge is enabled.
getFadingRightEdgeLength
fun getFadingRightEdgeLength(): Int
Returns the right edge fading length in pixels.
getFadingRightEdgeOffset
fun getFadingRightEdgeOffset(): Int
Sets the distance in pixels between fading start position and right padding edge. The fading start position is positive when start position is inside right padding area. Default value is 0, means that the fading starts from right padding edge.
getNumRows
fun getNumRows(): Int
Returns the number of rows that the GridView is using. Note that when setNumRows(0) is called, the actual number of rows will be calculated from rowHeight and grid view height during layout; calling it early may return zero.
| Returns | |
|---|---|
Int |
the number of rows that recyclerview will use to layout. |
setFadingLeftEdge
fun setFadingLeftEdge(fading: Boolean): Unit
Sets the fade out left edge to transparent. Note turn on fading edge is very expensive that you should turn off when HorizontalGridView is scrolling.
setFadingLeftEdgeLength
fun setFadingLeftEdgeLength(fadeLength: Int): Unit
Sets the left edge fading length in pixels.
setFadingLeftEdgeOffset
fun setFadingLeftEdgeOffset(fadeOffset: Int): Unit
Sets the distance in pixels between fading start position and left padding edge. The fading start position is positive when start position is inside left padding area. Default value is 0, means that the fading starts from left padding edge.
setFadingRightEdge
fun setFadingRightEdge(fading: Boolean): Unit
Sets the fade out right edge to transparent. Note turn on fading edge is very expensive that you should turn off when HorizontalGridView is scrolling.
setFadingRightEdgeLength
fun setFadingRightEdgeLength(fadeLength: Int): Unit
Sets the right edge fading length in pixels.
setFadingRightEdgeOffset
fun setFadingRightEdgeOffset(fadeOffset: Int): Unit
Returns the distance in pixels between fading start position and right padding edge. The fading start position is positive when start position is inside right padding area. Default value is 0, means that the fading starts from right padding edge.
setNumRows
fun setNumRows(numRows: Int): Unit
Sets the number of rows. Defaults to one.
setRowHeight
fun setRowHeight(height: Int): Unit
Sets the row height.
| Parameters | |
|---|---|
height: Int |
May be |
Protected functions
initAttributes
protected fun initAttributes(context: Context, attrs: AttributeSet?): Unit