Constructs a new BaseCollectionViewLayout.
Padding between cells.
Map of cell indices to cell instances.
Size of each cell as [width, height].
Indicates whether this layout is enabled.
Injected font manager for font lookups.
Height of the header.
Header label node, if present.
Injected instance pool for cell reuse.
Injected node pool for managing reusable nodes.
Number of columns in the row.
Array of currently rendered cells.
The row this layout manages.
The content data for the row.
The settings for the row.
The current screen position (y offset).
Private
viewportThe height of the viewport for visible rows.
The current virtual scroll position.
Horizontal offset for content.
The vertical offset for rendering rows.
Returns the number of items in the row.
Assigns a row to this layout and configures cell and header settings.
The row to assign.
Calculates the visible cells based on the virtual position. Determines which cells should be rendered and removes those that are no longer visible.
The virtual position of the row.
Configures the header label for the row based on settings.
Configures row settings based on content.
The row content.
Converts placeholder cells to real cells (to be implemented by subclasses).
Retrieves a cell at the specified index. If the cell does not exist, it reserves a new cell from the instancePool, sets it to visible, assigns the index, and stores it in the cellsByIndex array.
The index of the cell to retrieve.
The cell at the specified index, or a newly reserved cell if it did not exist.
Gets the cell index at a specific virtual position.
The virtual position.
The index of the cell at the specified position.
Gets the focus information for a specific item index.
The item index.
The desired position for the next item.
The focus information for the item.
Gets the item index for a key press event. Determines the next item index based on the key pressed and whether it is a long press.
The key pressed.
Whether the key press is a long press.
The index of the next item.
Gets the rendered cell at the specified index.
The cell index.
The rendered cell, if any.
Gets the rendered cell at a given virtual position.
The virtual position.
The rendered cell.
Gets the screen position for a specific item index.
The item index.
The desired position for the next item.
The offset for the position.
The screen position for the item.
Gets the virtual position for a specific item index.
The item index.
The desired position (start, middle, or end).
The virtual position for the item.
Determines whether the layout is handling a key press event.
The key pressed.
Whether the key press is a long press.
True if the layout is handling the key press, false otherwise.
Determines if a cell index is visible on screen at the given virtual position.
The cell index.
The virtual position.
True if the cell is on screen, false otherwise.
Called when the row enters the screen. Handles any necessary initialization or state updates for the row.
Called when the row exits the screen. Handles any necessary cleanup or state updates for the row.
Called before the layout is released back to the pool. Resets virtual position and clears rendered cells.
Called before the layout is reused from the pool. Resets virtual position, clears rendered cells, and hides the header.
Renders the list row at the specified virtual position. Calculates the position of each cell and updates their translations.
The render event containing virtual position and other details.
Renders the row as a hidden row (to be implemented by subclasses).
Shows placeholder cells (not implemented).
ListRowLayout
is a specialized implementation ofBaseCollectionViewLayout
designed to handle list-based layouts for rows in a collection view. It manages the rendering, focus handling, and layout calculations for vertically arranged rows.