ListItemHeaderViewModel

class ListItemHeaderViewModel(itemId: Any, icon: DrawableResolver?, text: StringResolver?) : ListItemViewModel

The ViewModel for populating a header item in a TtListRecyclerView.

A header consists of an Image section and a Text section. A schematic overview of the header looks as below:

________________________________
| __ | |
| |__| | Text |
|_______|_______________________|
Image Text
section section

Parameters

itemId

A unique stable ID for the header item. See ListItemViewModel.itemId.

icon

The icon for the header item displayed in Image section.

text

The text for the header item displayed in Text section.

Constructors

Link copied to clipboard
fun ListItemHeaderViewModel(itemId: Any, icon: DrawableResolver? = null, text: StringResolver? = null)

Properties

Link copied to clipboard
val icon: DrawableResolver? = null
Link copied to clipboard
open override val itemId: Any
Link copied to clipboard
val text: StringResolver? = null

Functions

Link copied to clipboard
open override fun getDrawableResolver(): DrawableResolver?

Retrieves the DrawableResolver. If it returns null, no image information will be presented in the indicator. If both getStringResolver and getDrawableResolver return a non-null value, the return value of getStringResolver will be adopted by TtScrollBar first.

Link copied to clipboard
open override fun getStringResolver(): StringResolver?

Retrieves the StringResolver. If it returns null, no text information will be presented in the indicator. If both getStringResolver and getDrawableResolver return a non-null value, the return value of getStringResolver will be adopted by TtScrollBar first.