Constructs a new BaseCollectionViewLayout.
The background rectangle for the layout.
Map of cell indices to cell instances.
Current header style key for component-based headers.
The debug label for the layout.
Indicates whether this layout is enabled.
Injected font manager for font lookups.
Whether this layout has a header.
Header fragment for component-based headers.
Header label node, if present.
Injected instance pool for cell reuse.
The last updated visible cells virtual position.
The y position of layout when visible cells were calculated last time.
Injected node pool for managing reusable nodes.
The callback to invoke when the row is released.
The callback to invoke at the end of row layout rendering.
The callback to invoke at the start of row layout rendering.
Array of currently rendered cells.
The row this layout manages.
The current screen position (y offset).
Injected view fragment provider for component-based headers.
PrivateviewportThe height of the viewport for visible rows.
The width of the viewport for visible rows.
The current virtual scroll position.
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.
Configures the header for the row based on settings. Supports both legacy single-label headers and new component-based headers.
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 pool key is normally the row's cellSettingsKey (or loadingCellStyleKey for loading placeholders). When the
row has useMixedCellStyleKeys, each item may supply its own cellSettingsKey so different cells in the same row
can use different styles.
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 width for a specific cell index.
The cell index.
The cell width.
Gets the item index whose center is closest to the stored focused cell X position. Used for FocusOnClosestItem strategy.
The item index closest to the stored X position.
Gets the item index whose center is closest to the stored focused cell X position. Used for FocusOnClosestItem strategy.
The item index closest to the stored X position.
PrivategetGets the center X position of a column in the grid layout.
The column index.
The center X position of the column.
Returns the horizontal content extent in physical layout coordinates.
Gets the virtual position for a specific item index.
The virtual position for the item.
Returns the initial horizontal offset that exposes logical item zero.
Gets the center X position of an item at the given index in grid layout.
The item index.
The center X position of the item.
Returns the largest valid horizontal scroll offset for this row.
Gets the next item index when moving vertically within the row.
1 for up, 1 for down
The index of the next item, or -1 if there is no valid next item.
Gets the next page item index when moving horizontally within row. Override this function if your row has more than one item per sub-row, and you want to move to the next page item when moving horizontally.
1 for left, 1 for right
The index of the next page item.
PrivategetGets 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.
Calculates the on-screen position for a cell index, accounting for the current horizontal scroll (virtualPosition). Used by pointer/touch focus so the focus indicator follows the item to its scrolled location rather than its release point. The returned X is clamped to the visible viewport so the indicator never renders past the row edges. Assumes a horizontal layout; subclasses may override.
The cell index.
The base offset to apply ([x, y]); offset[0] is the minimum X, offset[1] is the Y.
The clamped [x, y] screen position, or undefined if the index is out of bounds.
Gets the target item index in the horizontal direction. Override this function if your row has more than one item per sub-row, and you want to move to the next item when moving horizontally.
1 for left, 1 for right
Returns the relative Y within this row for the given item index based on the current virtual position. Used by CollectionView to compute a global target Y when animating to a specific row+item combination.
Returns the vertical position of the item index.
The item index.
The vertical position of the item index. The same as getVerticalCorrectedPositionForItemIndex, but without the screen position offset.
Gets the virtual vertical position for a specific row index related to the row header.
The item index.
The virtual vertical position for the row.
Gets the virtual row index for the target index.
The target index.
The virtual row index.
Gets the number of virtual rows in the layout.
The number of virtual rows in the layout.
Determines if a cell index is in the modified floating focus area at the given virtual position. The modified floating focus area is the floating focus area without the xOffset. This is used for horizontal scrolling with floating focus.
The cell index.
The virtual position.
True if the cell is in the modified floating focus area, false otherwise.
Called when the row enters the screen. Prepares visible cells and header.
Called when the row exits the screen. Releases all rendered cells and hides the header.
Called before the layout is released back to the pool. Releases all cells, 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.
Refreshes only compatibility-installed direction members after a locale change.
Renders the grid 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).
Determines if the visible cells should be recalculated.
The virtual screen y position.
True if the visible cells should be recalculated, false otherwise.
Shows placeholder cells (not implemented).
GridRowLayoutis a specialized implementation ofBaseCollectionViewLayoutdesigned to handle grid-based layouts for rows in a collection view. It manages the rendering, focus handling, and layout calculations for grid rows.