ListItemContentViewModel
The ViewModel for populating the content of a non-header item in a TtListRecyclerView.
An item consists of a Head section, a Main section and a Tail section. The schematic overview of the item looks as below:
_____________________________________________________________
| ______ | O Primary text | |
| | | | O Secondary text | ____ |
| | | | O Tertiary text | Tail text | | |
| |_____| | ***** Rating bar text | |___| |
|___________|____________________________|___________________|
Head Main Tail
section section sectionClients can inherit this ViewModel to provide more controls for the item, e.g. additional properties can be used to change the appearances of sections dynamically through the layout data-binding.
Parameters
A unique stable ID for the content item. See ListItemViewModel.itemId.
The image shown in the Head section. This can be a layered image with a radius.
The text area showing the Primary icon and the Primary text within the Main section.
The text area showing the Secondary icon and the Secondary text within the Main section.
The text area showing the Tertiary icon and the Tertiary text within the Main section.
The callback function for when the Head section or Main section is clicked.
The value represents the current rating.
The maximum number to ratingBarValue.
The additional text displayed together with the rating bar.
The text shown within the Tail section.
The image shown within the Tail section.
The callback function for when specifically the Tail section is clicked.
Constructors
A convenience constructor to populate the ViewModel where its headImage's ImageDescriptor.image is the headImage and the ImageType is ImageType.TINTABLE_ICON.
Types
ViewModel used to populate primaryTextArea, secondaryTextArea and tertiaryTextArea.
Properties
Functions
Returns the source image of headImage.
Returns the text value from one of primaryTextArea, secondaryTextArea and tertiaryTextArea. Among these 3, primaryTextArea has the highest priority and tertiaryTextArea has the lowest priority. This means if the text value of primaryTextArea, secondaryTextArea and tertiaryTextArea are all set, this method returns the value of primaryTextArea.