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.
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.
The current virtual scroll position.
Returns the number of items in the row.
Assigns a row to this layout and configures its content and settings. Overrides the base implementation to handle custom view rows.
The row to assign.
Calculates and updates the visible cells based on the given virtual position WHEN SCROLLING UP AND DOWN
The virtual position to calculate the visible cells from.
This method determines the range of cells that should be visible within the viewport, configures and renders them, and removes any cells that are no longer visible.
The method performs the following steps:
Custom-view rows do not render collection row 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 given virtual position.
The virtual position.
The cell index.
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.
Returns the horizontal content extent in physical layout coordinates.
Gets the virtual position for a given cell index and position.
The cell index.
The virtual position.
Returns the initial horizontal offset that exposes logical item zero.
Returns the largest valid horizontal scroll offset for this row.
Gets the next item index when moving vertically within row. 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 vertically. That is, for rows containing one line of items (for instance, HorizontalRow), the method returns -1 (because the next or previous line of items does not exist)
1 for up, 1 for down
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.
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.
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.
1 for left, 1 for right
Whether the key press is a long press.
The index of the target item.
Returns the [x, y] virtual position within this row necessary to bring the target item index
into view according to the requested position strategy. Base implementation returns a default
x using xOffset and a y based on the row's rendered list position and screen position.
Specialized layouts should override this to provide accurate item positions.
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 number of sub-rows to move when moving vertically to the target index.
The target index.
The number of sub-rows to move.
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. Handles any necessary initialization or inflation of the custom view.
Called when the row exits the screen. Handles any necessary cleanup or state updates for the custom view.
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 custom view row at the specified position. Updates the translation of the custom view's renderer based on the render event.
The render event containing 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).
CustomViewRowLayoutis a specialized implementation ofBaseCollectionViewLayoutdesigned to handle the layout for rows with custom views. It manages the rendering and lifecycle of custom views within a collection view row.