ListItemContentViewModel

fun ListItemContentViewModel(itemId: Any, headImage: DrawableResolver? = null, primaryIcon: DrawableResolver? = null, primaryText: StringResolver? = null, secondaryIcon: DrawableResolver? = null, secondaryText: StringResolver? = null, tertiaryIcon: DrawableResolver? = null, tertiaryText: StringResolver? = null, onClick: () -> Unit? = null, ratingBarValue: Float? = null, ratingBarMaximumValue: Int = RATING_BAR_MAXIMUM_VALUE, ratingBarText: StringResolver? = null, tailText: StringResolver? = null, tailIcon: DrawableResolver? = null, onTailSectionClick: () -> Unit? = null)

A convenience constructor to populate the ViewModel where its headImage's ImageDescriptor.image is the headImage and the ImageType is ImageType.TINTABLE_ICON.


fun ListItemContentViewModel(itemId: Any, headImage: ImageDescriptor? = null, primaryTextArea: ListItemContentViewModel.TextAreaViewModel = TextAreaViewModel(), secondaryTextArea: ListItemContentViewModel.TextAreaViewModel = TextAreaViewModel(), tertiaryTextArea: ListItemContentViewModel.TextAreaViewModel = TextAreaViewModel(), onClick: () -> Unit? = null, ratingBarValue: Float? = null, ratingBarMaximumValue: Int = RATING_BAR_MAXIMUM_VALUE, ratingBarText: StringResolver? = null, tailText: StringResolver? = null, tailIcon: DrawableResolver? = null, onTailSectionClick: () -> Unit? = null)

Parameters

itemId

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

headImage

The image shown in the Head section. This can be a layered image with a radius.

primaryTextArea

The text area showing the Primary icon and the Primary text within the Main section.

secondaryTextArea

The text area showing the Secondary icon and the Secondary text within the Main section.

tertiaryTextArea

The text area showing the Tertiary icon and the Tertiary text within the Main section.

onClick

The callback function for when the Head section or Main section is clicked.

ratingBarValue

The value represents the current rating.

ratingBarMaximumValue

The maximum number to ratingBarValue.

ratingBarText

The additional text displayed together with the rating bar.

tailText

The text shown within the Tail section.

tailIcon

The image shown within the Tail section.

onTailSectionClick

The callback function for when specifically the Tail section is clicked.