SpanSizeLookup

abstract class SpanSizeLookup(source)

A helper class to provide the number of spans each item occupies.

Default implementation sets each item to occupy exactly 1 span.

See also

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun getSpanGroupIndex(adapterPosition: Int, spanCount: Int): Int
Returns the index of the group this position belongs.
Link copied to clipboard
open fun getSpanIndex(position: Int, spanCount: Int): Int
Returns the final span index of the provided position.
Link copied to clipboard
abstract fun getSpanSize(position: Int): Int
Returns the number of span occupied by the item at position.
Link copied to clipboard
Clears the span group index cache.
Link copied to clipboard
Clears the span index cache.
Link copied to clipboard
Returns whether results of getSpanGroupIndex method are cached or not.
Link copied to clipboard
Returns whether results of getSpanIndex method are cached or not.
Link copied to clipboard
open fun setSpanGroupIndexCacheEnabled(cacheSpanGroupIndices: Boolean)
Sets whether the results of getSpanGroupIndex method should be cached or not.
Link copied to clipboard
open fun setSpanIndexCacheEnabled(cacheSpanIndices: Boolean)
Sets whether the results of getSpanIndex method should be cached or not.