hosanna-ui-docs - v0.9.0
    Preparing search index...

    CustomViewRowLayout is a specialized implementation of BaseCollectionViewLayout designed to handle the layout for rows with custom views. It manages the rendering and lifecycle of custom views within a collection view row.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cellPadding: number = 0

    Padding between cells.

    cellsByIndex: Record<string, BaseCell.BaseCell> = {}

    Map of cell indices to cell instances.

    cellSize: [number, number] = ...

    Size of each cell as [width, height].

    enabled: boolean = true

    Indicates whether this layout is enabled.

    Injected font manager for font lookups.

    hasHeader: boolean = true
    headerHeight: number = 50

    Height of the header.

    headerLabel: undefined | ISGNLabel

    Header label node, if present.

    instancePool: IInstancePool

    Injected instance pool for cell reuse.

    nodePool: INodePool

    Injected node pool for managing reusable nodes.

    numCols: number = 0

    Number of columns in the row.

    renderedCells: BaseCell.BaseCell[]

    Array of currently rendered cells.

    The row this layout manages.

    The content data for the row.

    rowSettings: undefined | ICollectionViewRowSettings

    The settings for the row.

    screenPosition: number = 0

    The current screen position (y offset).

    virtualPosition: number

    The current virtual scroll position.

    xOffset: number = 0

    Horizontal offset for content.

    Accessors

    Methods

    • Calculates and updates the visible cells based on the given virtual position WHEN SCROLLING UP AND DOWN

      Parameters

      • virtualPosition: number

        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:

        1. Calculates the first and last visible cell indices based on the virtual position and viewport width.
        2. Configures and renders the cells within the visible range.
        3. Removes cells that are no longer visible and releases them back to the cell pool.

      Returns void

    • Determines the index of an item based on a key press event.

      Parameters

      • key: string

        The key that was pressed. Expected values are Key.Left or Key.Right.

      • isLongPress: boolean

        A boolean indicating if the key press is a long press.

      Returns number

      The index of the item to focus on. Returns 0 if the left key is long pressed, the last item index if the right key is long pressed, or the clamped index based on the current focused index and the key pressed. Returns -1 for unsupported keys.