SectionedItemTemplate


@RequiresCarApi(value = 8)
@CarProtocol
@ExperimentalCarApi
class SectionedItemTemplate : Template


A template that contains sections of items like rows, grid items, etc.

Summary

Nested types

A builder that constructs SectionedItemTemplate instances.

Constants

const Int

Indicate that the scroll position should be preserved by scrolling back down to the same index that the user had scrolled to.

const Int

Indicate that the scroll position should reset back to the top when this template is refreshed.

Public functions

Boolean
equals(other: Any?)
(Mutable)List<Action!>

Returns the list of actions that should appear alongside the content of this template.

Header?

Returns the optional header for this template.

Int

Returns the strategy to use when this template is used as a refresh.

(Mutable)List<Section<Any!>!>

Returns the list of sections within this template.

Int
Boolean

Returns whether this list can be indexed alphabetically, by item title.

Boolean

Returns whether or not this template is in a loading state.

String

Constants

SCROLL_STATE_PRESERVE_INDEX

Added in 1.8.0-alpha02
const val SCROLL_STATE_PRESERVE_INDEX = 1: Int

Indicate that the scroll position should be preserved by scrolling back down to the same index that the user had scrolled to.

If the index no longer exists, the scroll position will be set to the bottom of the new list.

SCROLL_STATE_RESET_TO_TOP

Added in 1.8.0-alpha02
const val SCROLL_STATE_RESET_TO_TOP = 0: Int

Indicate that the scroll position should reset back to the top when this template is refreshed.

This is the default behavior if not explicitly set.

Public functions

equals

fun equals(other: Any?): Boolean

getActions

Added in 1.7.0
fun getActions(): (Mutable)List<Action!>

Returns the list of actions that should appear alongside the content of this template.

getHeader

Added in 1.7.0
fun getHeader(): Header?

Returns the optional header for this template.

getScrollStatePersistenceStrategy

Added in 1.8.0-alpha02
fun getScrollStatePersistenceStrategy(): Int

Returns the strategy to use when this template is used as a refresh. See setScrollStatePersistenceStrategy

getSections

Added in 1.7.0
fun getSections(): (Mutable)List<Section<Any!>!>

Returns the list of sections within this template.

hashCode

fun hashCode(): Int

isAlphabeticalIndexingAllowed

Added in 1.7.0
fun isAlphabeticalIndexingAllowed(): Boolean

Returns whether this list can be indexed alphabetically, by item title.

"Indexing" refers to the process of examining list contents (e.g. item titles) to sort, partition, or filter a list. Indexing is generally used for features called "Accelerators", which allow a user to quickly find a particular Item in a long list.

To exclude a single item from indexing, see the relevant item's API.

To enable/disable accelerators for the entire list, see setAlphabeticalIndexingAllowed

isLoading

Added in 1.7.0
fun isLoading(): Boolean

Returns whether or not this template is in a loading state.

toString

fun toString(): String