The ListContentManager
class manages the content of a List
component in Roku. It has a reference to a List
object, a ListItemViewManager
object, a ListItemScroller
object, and a focus indicator manager node. It is responsible for synchronizing the content of the List
with the ListItemViewManager
and ListItemScroller
, and for maintaining the state of the rows and cells in the List
.
Creates a new instance of the ListContentManager
class.
An interface representing information about a row in the List
.
row
(mc.types.node
): The row node.version
(integer
): The version of the row.isHidden
(boolean
): A flag indicating whether the row is hidden.isFocusEnabled
(boolean
): A flag indicating whether the row is focusable.
Gets or sets the content of the List
.
This is the constructor for the ListContentManager class.
Argument Name | Type | Default Value | Description |
---|---|---|---|
list |
mc.types.node |
N/A | The list object. |
viewManager |
mc.types.node |
N/A | ListItemViewManager object. |
itemScroller |
object |
N/A | ListItemScroller object |
focusIndicatorManager |
mc.types.node |
A node that manages the focus indicators for the List . |
Sets the content of the List
. If the content has changed, the List
is reset and the content is synchronized with the ListItemViewManager
and ListItemScroller
.
Argument Name | Type | Default Value | Description |
---|---|---|---|
content |
mc.types.node |
N/A | The content to set for the List . |
Enables or disables updates to the List
. If updates are disabled, the List
will not be reset or synchronized with the ListItemViewManager
and ListItemScroller
.
Argument Name | Type | Default Value | Description |
---|---|---|---|
enabled |
boolean |
N/A | A flag indicating whether updates should be enabled or disabled. |
Synchronizes the content of the List
with the ListItemViewManager
and ListItemScroller
. It updates the rows and cells in the List
based on the content, and handles any changes to the content.
Argument Name | Type | Default Value | Description |
---|---|---|---|
notifyRows |
boolean |
true |
A flag indicating whether the rows should be notified of the content changes. |
The synchronizeContent
method does the following:
- It gets the current focused row and cell from the
ListItemScroller
and stores them inpreviousFocusedRowInfo
andpreviousFocusedCellInfo
, respectively. - It iterates through the rows in the content and updates their content with the
updateContentOnRow
method. - It handles any changes to the content by calling the
onListContentItemsChange
method. - It updates the
List
if necessary with theupdateListContentIfRequired
method. - It updates the focus of the
List
with theupdateListFocus
method.
Sets the content of a row in the List
.
Argument Name | Type | Default Value | Description |
---|---|---|---|
row |
mc.types.node |
N/A | The row node to set the content for. |
content |
mc.types.node |
N/A | The content to set for the row. |
notifyRow |
boolean |
false |
A flag indicating whether the row should be notified of the content change. |
result |
ml.ListChangeResult |
invalid |
An object that contains information about the changes made to the List . |
This method does the following:
- It updates the
RowContentInfo
for the row with theupdateRowContentInfo()
method. - If
notifyRow
istrue
, it applies the content change to the row with theapplyRowContentChange
method.