Hosanna UI API v1.30.2-next
    Preparing search index...

    CollectionViewView is the main Hosanna collection view implementation. Handles row and item rendering, focus management, data source changes, and input events. It is highly optimized for performance and supports virtualized rendering. It is designed to handle large data sets efficiently and can handle different sets of cards, rows and is very flexible in terms of layout and rendering.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    __isMemoizedStateValid _boundOnDataSourceChanged? _cacheKey _dataSource _dataSourceChangePending _hid _isInFocusChain _isProcessingChanges _pendingChanges _visibleRowsHibernated activeAnimation? activeLongPressDirectionKey activeStyleViewStatus aggregateView appConfig appliedReadingDirection audioGuideHint? audioGuideItem? baseAnimationDuration blockInputEvents cachedFocusedRowVirtualY cachedNextRowVirtualY cachedRenderEvents calculatedHeight calculatedWidth calculatedX calculatedY canReceiveFocus children childrenChanged clippingRect collectionViewDSLManager collectionViewFocusManager compositeView container customData? dataSource? defaultValues direction dslManagerEnabled eventDispatcher eventHandlers fastestScrollSpeed fastScrollDuration fastScrollSpeed firstVisibleRow floatingFocusAreaHeight focusedCellXPosition focusedChildId? focusedIndices focusEventStateManager focusId focusIndicatorAppearance focusIndicatorTranslation? hasCalledOnInteractionComplete hasSyncedNativeOffset height id includeInLayout initialFocusId instancePool interactions isAnimating isContentSet isFocused isInternalRefocusing isLayoutDirty isLongPress isPresented isRendered isSkeleton isWaking keyboardAvoidance lastLayoutSettledReason lastPushedHostContentHeight lastPushedHostEnabled lastPushedHostHeight lastPushedHostHorizontalTargetsKey lastPushedHostWidth lastRowKeyPress lastSyncedNativeOffset lastVisibleRow layoutSettledDelayMs layoutSettledTimerId layoutSettledVisibilityThreshold nativeGlass nativeScrollHost? nativeScrollHostState nativeScrollOrigin nextItemIndices nextViewId nodePool numberOfItems onItemBlurring? onItemFocus? onItemFocusing? onItemLongPressSelected? onItemSelected? onLayoutSettled? onOptionsKeyPressed? onRowFocus? opacity overlaysContainer parent? partialRendererHibernatedState pendingHorizontalItemIndex pendingInteractionReplay pointerFocusIndicatorMode pointerIndicatorIndices pointerScrollSession pointerScrollSnapToFocus readingDirection renderChangeEvent rotation rowCallbacksProvider rowSpacing scale scaleRotateCenter scrollablePositionX scrollablePositionY scrollInsets scrollMode scrollSpeed scrollSpeedIndex selectedIndices startIndices staticType stickyRows stickyRowsContainer subViews subViewsChanged targetIndices targetVirtualY timeLeftFromPreviousAnimation timeToNextRow timeToTargetRow translation verticalFocusAnimationType viewOwner viewportHeight viewStatus virtualY visible width MAX_DRAIN_ITERATIONS

    Accessors

    Methods

    _tick addChild addChildren addFocusIndicatorRenderer addRendererToParentViewRenderer addSubView animateBetweenIndices animateToNextPageItemHorizontally animateViews applyHorizontalRowScrollOffset applyIdsToViewStructs applyInitialState applyLayoutStateToNativeRenderer applyPointerHorizontalDelta applyScrollExtentStrategy applyStateChanges beginPointerScrollSession bringChildInFrontOfChild bringChildToFront buildExpectedHeaderChain buildView calculateFirstVisibleRowForVirtualY calculateVisibleRows cancelAnimationForPointerFocus cancelPointerScrollSession canChangeOrientation canMeasureBounds cleanup clearAll clearAllStickyRows clearErrorByErrorField clearErrors clearExistingRows clearLayoutSettledTimer clearPointerIndicatorCellStatus commitHorizontalPointerScrollFocus commitNativeScrollFocus commitPointerScrollFocus configureAudioGuideItem containsChild correctFocusedIndices createDataEvent createNativeScrollHostIfSupported createRows detachFromDataSource determineClampedIndicesWhenGoTo determineNextItemIndices dismiss dispatch dispatchAction dispatchAsync dispatchItemFocusEvent dispatchItemFocusProgressEvent dispatchItemOptionsKeyPressedEvent dispatchItemSelectedEvent dispatchLayoutSettled dispatchRequestRowLoadEvent dispatchRowItemFocusEventForFocus dispatchRowLoadFailedEvent dispatchSelection easeOutCubic endPointerScrollSession exitPointerFocusModeForKeyboard findCellByIndex findFirstFocusableRowFrom findFirstVisibleRow findHeaderForSection findNextFocusable findNextFocusableView findNextFocusableViewByDirection findRootHeaderForSection focusItemAtPoint getAndroidNativeLaunchArgs getAnimationPropsForStateProperty getAudioGuideItem getBounds getBoundsInApp getBoundsInParent getCachedNextRowVirtualY getCellForIndex getChangedField getChildView getContentMetrics getCustomData getDataSource getDataSourceItemForIndex getDataSourceRowForIndex getDirectionFromKey getField getFirstFocusableRowIndex getFirstValidRow getFlattenedStructs getFlattenedStructsById getFocusAreaBottom getFocusAreaTop getFocusedCellXPosition getFocusedDataSourceItem getFocusedDataSourceRow getFocusedRow getFocusInfo getFocusManager getHorizontalRowMaxScrollOffset getHosannaViewForFocusedRow getLastVisibleRow getMinScrollOffset getNativeScrollHostHorizontalTargets getNativeScrollHostWidth getNavController getNearestItemIndexForRow getNearestPointerFocusRowIndexForOffset getNearestRowIndexForOffset getNextFocusableRowIndex getNextItemIndexWhenMovingVerticallyWithinRow getNextItemIndices getNextItemIndicesWhenMovingVertically getObservableField getPointerFocusInfo getPointerItemIndexForRow getPointerRowIndexAtLocalY getPointerScrollDeltaInLocalCoordinates getPointInLocalCoordinates getRenderedCellForIndex getRenderEvent getRowForDataSourceRow getRowForIndex getRows getScrollInsetBottom getScrollInsetTop getSettledVisibilityThreshold getSettledVisibleItem getSettledVisibleItemForCell getSettledVisibleItems getSettledVisibleRow getSettledVisibleRowRange getSettledVisibleRows getStickyRows getSubView getSubViewRenderer getTimeToNextRow getTimeToTargetRow getVerticalFocusAnimationStrategy getVirtualRowsCountToMove getVisibilityRatio getVisibleIntersection handleAnimationFocusEvents handleCellSelectionIfNeeded handleCollectionInputKey handleFocusIndicatorAppearanceChange handleHeaderRowsIfNeeded handleHorizontalKeyPress handleKeyPressByDSL handlePointerNavigationIntent handleReadingDirectionChange handleRowHeightChange handleRowSpacingChange handleVerticalFocusAnimationTypeChange hasHighFidelityItemFocusHandlers hibernateView hibernateVisibleRows inflateViewStructs initializeTabGroup initializeTabGroups initializeWithDataSource insertChild insertChildAfterOtherChild insertChildBeforeOtherChild insertSubView invalidateLayout invalidateParentLayout invalidateRowLayout isAndroidNativeCollectionViewAnimationDisabled isDescendantOf isHorizontalPointerScrollableRow isInFocusChain isQueuedInteractionReplayDisabled isRowFocusable isScrolledToBottom isSettledVisibleItem isSettledVisibleRow jumpToIndices jumpToRow layoutAt layoutChildren markStateDirtyForViewManager normalizeScrollInset notifyOnFocusedChildChange onAppear onAppearAgain onBlur onDataSourceChanged onDidAddToAggregateView onDidAppearInAggregateView onDidChangeOrientation onDidReappearInAggregateView onDidRemoveFromAggregateView onDisappear onDisappearFromAggregateView onFirstAppear onFocus onInputEvent onInteractionComplete onKeyPressDown onKeyPressFastForward onKeyPressLeft onKeyPressOK onKeyPressOptions onKeyPressRewind onKeyPressRight onKeyPressUp onMount onNativeScrollHostHorizontalOffset onNativeScrollHostOffset onNativeScrollHostState onUnmount onWillAddToAggregateView onWillApplyStateChanges onWillChangeOrientation onWillRemoveFromAggregateView onWillReuse performViewManagerLayoutChildren popStickyRow present processDataSourceChanges processPendingInteractionReplay pushStickyRow reconcileChildren reconcileStickyRows reconfigureVariableWidthRowWhenRemoveItemsIfNeeded reconfigureVariableWidthRowWhenUpdateItemIfNeeded reconfigureVariableWidthRowWithNewItemsIfNeeded recycle refreshPointerFocusIndicatorForPixelScrolledRow refreshVisibleRows registerControlWithErrorMessage registerControlWithKnownError release releaseRenderEvent releaseStickyWhenMovingVerticallyTowardListStart removeChild removeRowByIndex removeStickyRowAtIndex removeSubView render renderCurrentRow renderForIndices renderVisibleRows requestFocusedChild resetDataSource resolveFocusEntryTarget resolveNearestPointerRowTarget resolvePointerRowTarget resolvePointerRowTargetForPoint resolvePointerTarget resolvePointerTargetForPoint restorePointerFocusIndicatorAtPoint scheduleLayoutSettled schedulePendingInteractionReplay scrollToIndices scrollToRow sendChildBehindOtherChild sendChildToBack setChildIndex setContent setDataSource setError setExternalScrollOffset setField setFocusToRow setLayoutField setNextFocusTrackingFieldsWhenLeavingRow setObservableField setPointerFocusIndicatorMode setPointerFocusToIndices setShowOnScreen setState setStickyRow setTransientPointerFocusToIndices shouldUseNativeScrollHost showDialog startAnimatingRowToItemIndex suppressPointerFocusIndicator syncFocusIndicatorToFocusedItem syncNativeScrollHost unobserveObservableObjects updateDirectionForNavigationTarget updateFocusedCellXPosition updateFocusTracker updatePointerScrollSession updateRowFocusabilityWithinRange updateRowVisibility updateVerticalFocusAnimationStrategy usesNativeScrollHost usesNativeScrollHostForPointerAxis wakeView wakeVisibleRows

    Constructors

    Properties

    __isMemoizedStateValid: boolean = false
    _boundOnDataSourceChanged?: (changes: IDataSourceChange[]) => void

    The exact bound handler registered with the current data source, kept so it can be unregistered on detach.

    _cacheKey: string = ''

    The current data source instance.

    _dataSourceChangePending: boolean = false

    Whether a data source change was skipped because the renderer was released.

    _hid: string
    _isInFocusChain: boolean = false
    _isProcessingChanges: boolean = false

    Re-entrancy guard: true while processing data source changes. Changes that arrive during processing are queued.

    _pendingChanges: IDataSourceChange[] = []

    Queued changes to process after the current batch completes (avoids onContentReady -> appendRows re-entrancy).

    _visibleRowsHibernated: boolean = false
    activeAnimation?: HosannaViewAnimator

    If present, an animation currently targeting this view (or its subviews).

    activeLongPressDirectionKey: Key = Key.None

    Direction key for an in-flight long press handled by this collection view (Key.None if none).

    activeStyleViewStatus: ViewStatus = ViewStatus.Normal
    aggregateView: undefined | IAggregateView.IAggregateView

    IHosannaView


    appConfig: IAppConfig
    appliedReadingDirection: ReadingDirection = CollectionViewReadingDirection.LeftToRight

    Last direction propagated to mounted rows; avoids relayout for unrelated state updates.

    audioGuideHint?: string = ''

    This hint can be used in conjunction with the audio guide item

    audioGuideItem?: string | IAudioGuideItem
    baseAnimationDuration: number = 200

    Base animation duration for normal scrolling (in milliseconds).

    blockInputEvents: boolean = false
    cachedFocusedRowVirtualY: number = 0

    Cached virtual Y position for the focused row.

    cachedNextRowVirtualY: number = 0

    Cached virtual Y position for the next row.

    cachedRenderEvents: RenderEvent[] = ...

    Render events for the collection view. We maintain a pool of render events to avoid creating new ones for each render.

    calculatedHeight: number = 0
    calculatedWidth: number = 0
    calculatedX: number = 0
    calculatedY: number = 0
    canReceiveFocus: boolean = true

    Indicates whether the element can receive focus.

    children: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    These are the children that are rendered on screen in the tree structure of the view

    childrenChanged: boolean = false
    clippingRect: number[] = ...
    collectionViewDSLManager: ICollectionViewDSLManager

    Injected collection view DSL manager.

    collectionViewFocusManager: CollectionViewFocusManager.CollectionViewFocusManager = ...

    Focus manager for the collection view.

    compositeView: boolean = true

    Indicdates whether the view is a focus group which means it can have a focused child Otherwise it will be focused itself

    container: ISGNGroup

    The root container group for the collection view.

    customData?: unknown

    The data source for the collection view.

    defaultValues: Partial<T> = {}
    direction: number = 1

    Direction of navigation (1 for down/right, -1 for up/left).

    dslManagerEnabled: boolean = true

    Whether DSL is enabled for the collection view.

    eventDispatcher: CollectionViewEventDispatcher

    Event dispatcher for handling collection view events.

    eventHandlers: Record<string, Function> = {}
    fastestScrollSpeed: number = 6
    fastScrollDuration: number = 100

    Duration for fast scrolling animations (in milliseconds).

    fastScrollSpeed: number = 3
    firstVisibleRow: number = 0

    The index of the first visible row.

    floatingFocusAreaHeight: number = 1080

    The height of the floating focus area.

    focusedCellXPosition: number = 0

    The X position of the currently focused cell's center for FocusOnClosestItem strategy.

    focusedChildId?: string
    focusedIndices: [number, number] = ...

    The indices of the currently focused row and item.

    focusEventStateManager: CollectionViewFocusEventStateManager

    State manager for focus event tracking.

    focusId: string = ''
    focusIndicatorAppearance: ICollectionViewFocusIndicatorAppearance = ICollectionViewFocusIndicatorAppearance.OnTop

    The appearance of the focus indicator.

    focusIndicatorTranslation?: [number, number] = ...
    hasCalledOnInteractionComplete: boolean = false

    Guard flag to prevent duplicate calls to onInteractionComplete for the same animation completion.

    hasSyncedNativeOffset: boolean = false
    height: number = 0
    id: string = ''
    includeInLayout: boolean = true
    initialFocusId: string = ''

    Injected instance pool for row reuse.

    interactions: CollectionViewInteractions

    Interaction queue manager for handling queued key presses during animations.

    isAnimating: boolean = false

    Whether the collection view is currently animating.

    isContentSet: boolean = false

    Whether content has been set.

    isFocused: boolean = false

    Indicates whether the element is currently focused.

    isInternalRefocusing: boolean = false

    Whether the focus switch (refocusing) is internal. This is used to prevent the focus event from being dispatched when the collection view is "fake blurred" or "fake focused" coz CustomRow gets focus

    isLayoutDirty: boolean = false
    isLongPress: boolean = false
    isPresented: boolean = false

    If true, this view has been presented in an AggregateViewController

    isRendered: boolean = false

    Whether the collection view has been rendered.

    isSkeleton: boolean = false
    isWaking: boolean = false
    keyboardAvoidance: "none" | "auto" = 'auto'

    Automatic keyboard avoidance opt-out. When a software keyboard appears, the framework translates the visible screen to keep the editing input in view; set 'none' on the screen or the input to disable. Plain field (not reactive) — checked at keyboard-show time.

    lastLayoutSettledReason: string = ''
    lastPushedHostContentHeight: number = 0
    lastPushedHostEnabled: boolean = true
    lastPushedHostHeight: number = 0
    lastPushedHostHorizontalTargetsKey: string = ''
    lastPushedHostWidth: number = 0
    lastRowKeyPress: Key = Key.None

    Last key pressed on a row.

    lastSyncedNativeOffset: number = 0
    lastVisibleRow: number = 0

    The index of the last visible row.

    layoutSettledDelayMs: number = 200
    layoutSettledTimerId: undefined | Timeout
    layoutSettledVisibilityThreshold: number = 0.5
    nativeGlass: undefined | SGNativeGlassEffect = undefined
    nativeScrollHost?: ISGNScrollHost

    Native scroll gesture host (scrollMode native/auto on capable platforms).

    nativeScrollHostState: ScrollHostScrollState = ScrollHostScrollState.Idle
    nativeScrollOrigin: number = 0

    virtualY value mapping to native offset 0 (minScrollOffset at last sync).

    nextItemIndices: [number, number] = ...

    The index of the next row to be processed or rendered. This is used to keep track of the current position in the collection view.

    nextViewId: number = 0
    nodePool: INodePool
    numberOfItems: number = 0

    Number of items (rows) in the collection view.

    onItemBlurring?: ViewEventHandler<CollectionViewEvent>

    Opt-in, per-frame handler for an item losing focus during horizontal motion.

    onItemFocus?: ViewEventHandler<CollectionViewEvent>

    Handler for item focus events.

    onItemFocusing?: ViewEventHandler<CollectionViewEvent>

    Opt-in, per-frame handler for an item gaining focus during horizontal motion.

    onItemLongPressSelected?: ViewEventHandler<CollectionViewEvent>

    Handler for item long press selected events.

    onItemSelected?: ViewEventHandler<CollectionViewEvent>

    Handler for item selected events.

    onLayoutSettled?: ViewEventHandler<CollectionViewLayoutSettledEvent>

    Handler for settled layout events.

    onOptionsKeyPressed?: ViewEventHandler<CollectionViewEvent>

    Handler for item options key pressed events.

    onRowFocus?: ViewEventHandler<CollectionViewEvent>

    Handler for row focus events.

    opacity: number = 1.0
    overlaysContainer: ISGNGroup

    The container for overlays like left fade effect, etc.

    parent?: IHosannaView<ViewState> = undefined

    The parent focusable element, if any.

    partialRendererHibernatedState: Partial<T> = {}
    pendingHorizontalItemIndex: undefined | number = undefined

    The index of the item to animate to when going to a specific row.

    pendingInteractionReplay: undefined | ICollectionInteraction

    Queued interaction replay deferred until the next tick to avoid input re-entrancy during render completion.

    pointerFocusIndicatorMode: CollectionViewPointerFocusIndicatorMode = 'committedFocus'
    pointerIndicatorIndices: undefined | [number, number]
    pointerScrollSession:
        | undefined
        | {
            axis?: CollectionViewPointerAxis;
            canHandleHorizontalScroll: boolean;
            startItemIndex: number;
            startLocalPoint: CollectionViewPointerPoint;
            startOffsetY: number;
            startPoint: CollectionViewPointerPoint;
            startRowIndex: number;
            startRowVirtualX: number;
        }
    pointerScrollSnapToFocus: boolean = false

    Opt-in page-style landing for pointer and native scroll focus commits.

    readingDirection: ReadingDirection = CollectionViewReadingDirection.LeftToRight

    Default horizontal reading order inherited by rows.

    renderChangeEvent: ApplyChangesRenderEvent = ...

    An event object that describes the changes to be rendered in the collection view.

    rotation: number = 0
    rowCallbacksProvider: IRowCallbacksProvider

    Injected row callbacks provider.

    rowSpacing: number = 21

    Spacing between rows in the collection view.

    scale: number[] = ...
    scaleRotateCenter: number[] = ...
    scrollablePositionX: undefined | number = undefined
    scrollablePositionY: undefined | number = undefined
    scrollInsets: CollectionViewScrollInsets = ...

    Additional vertical scroll extent around collection content.

    scrollMode: CollectionViewScrollMode = 'auto'

    Vertical scroll engine. 'auto' uses the native scroll host on platforms with the scroll.nativeHost capability. Decide at construction time — the host is created with the renderer.

    scrollSpeed: number = 1.5

    Animation speed for row transitions.

    scrollSpeedIndex: number = 0
    selectedIndices: number[] = ...

    Currently selected row and item indices.

    startIndices: [number, number] = ...

    Start indices for animations: [rowIndex, itemIndex].

    staticType: ViewStaticType = ViewStaticType.None

    Stack of sticky rows for nested header support.

    stickyRowsContainer: ISGNGroup

    The container for sticky rows.

    subViews: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    These are the children that were created in getViews, in a flat strcuture - it contains EVERYTHING that we declared.

    subViewsChanged: boolean = false
    targetIndices: [number, number] = ...

    Target indices for animations: [rowIndex, itemIndex].

    targetVirtualY: number = 0

    The target virtual Y position for animations.

    timeLeftFromPreviousAnimation: number = 0

    Time left from previous animation when animation is interrupted.

    timeToNextRow: number = 0

    Time to reach the next intermediate row during animation (in milliseconds).

    timeToTargetRow: number = 0

    Time to reach the target row during animation (in milliseconds).

    translation: number[] = ...
    verticalFocusAnimationType: VerticalFocusAnimationType = VerticalFocusAnimationType.Fixed

    The type of vertical focus animation.

    viewOwner: IHosannaView<ViewState>

    The IHosannaView subclass that created us in getViews

    viewportHeight: number = 1080

    The height of the viewport.

    viewStatus: ViewStatus = ViewStatus.Normal
    virtualY: number = 0

    The current virtual Y position (scroll offset).

    visible: boolean = true

    Indicates whether the navigatable entity is visible.

    width: number = 0
    MAX_DRAIN_ITERATIONS: 100

    Maximum drain iterations to prevent infinite loops from misbehaving onContentReady handlers.

    Accessors

    • get renderer(): undefined | R

      Returns undefined | R

    • set renderer(value: undefined | R): void

      Parameters

      • value: undefined | R

      Returns void

    Methods

    • Handles the tick event, processes the input, and updates the view accordingly.

      Parameters

      • delta: number

        The time delta since the last tick.

      Returns void


    • Children


      Parameters

      • child: IHosannaView<ViewState>
      • OptionalmountTarget: IHosannaView<ViewState>

      Returns void

    • Parameters

      • children: IHosannaView<ViewState>[]

      Returns void

    • Returns void

    • Parameters

      • parent: undefined | IHosannaView<ViewState>
      • childIndex: number = -1

      Returns void

    • Animates the view between the start index and the target index.

      Parameters

      • delta: number

        The time delta since the last animation step.

      Returns void

    • Parameters

      • direction: number

      Returns boolean

    • Parameters

      • nextViewStructs: undefined | ViewStruct<ViewState>[]
      • parentId: string = ""
      • level: number = 0

      Returns void

    • Builds the view and attaches it to the view owner.

      Parameters

      • struct: ViewStruct<ViewState>
      • OptionalmountTarget: IHosannaView<ViewState>

        The target to mount the view.

      • childIndex: number = -1

      Returns undefined | IHosannaView<ViewState>

      The built view or undefined.

    • Parameters

      • virtualY: number

      Returns { firstVisible: number; lastVisible: number }

    • Calculates the range of visible rows within the viewport.

      Uses each row's IBaseCollectionViewRow.renderedListPosition (same stacking contract as invalidateRowLayout, including peek-ahead / peek-into reductions between rows) plus getHeight for the row's painted extent — mirroring findFirstVisibleRow. Accumulating raw heights without rendered positions was incorrect when rows peek/overlap.

      Returns { firstVisible: number; lastVisible: number }

      An object containing:

      • firstVisible: The index of the first visible row.
      • lastVisible: The index of the last visible row, clamped between 0 and the total number of items.
    • Returns void

    • Returns void

    • Comprehensive cleanup method that releases all rows, cells, and resets state. This ensures proper resource management when the CollectionView is removed or hidden.

      The cleanup process:

      1. Delegates to clearAll() for row release and state reset
      2. Unregisters tickable and clears datasource reference

      Returns void

    • Comprehensive reset that releases all rows to the pool and resets all tracking state. Used for DataSourceChangeType.Clear so the CollectionView is ready for fresh data (e.g. after login/logout). Does NOT unregister tickable or clear _dataSource.

      Returns void

    • Clears all sticky rows

      Returns void

    • Parameters

      • errorField: IDebugErrorFieldMap

      Returns void

    • Clears all existing rows from the collection view.

      Returns void

    • Returns void

    • Parameters

      • OptionalnextRowIndex: number
      • OptionalnextItemIndex: number
      • forceClearCommittedFocus: boolean = false

      Returns void

    • Parameters

      • rowIndex: number
      • itemIndex: number

      Returns boolean

    • Same focus landing as the JS vertical path (endPointerScrollSession).

      Returns void

    • Parameters

      • rowIndex: number
      • itemIndex: number

      Returns boolean

    • Determines if the given child is contained within this collection view.

      Parameters

      • child: IHosannaView<ViewState>

        The child view to check.

      Returns boolean

      True if the child is a descendant, false otherwise.

    • Returns void

    • Parameters

      Returns void

    • Creates row instances from the data source.

      Returns void

    • Unregisters this view's change callback from the current data source.

      The data source often outlives the CollectionView bound to it (screens keep one data source while their pooled CollectionView is reused). Failing to unregister accumulates duplicate callbacks, so a single change is delivered to this view multiple times and gets re-queued via the re-entrancy guard — producing duplicate rows.

      Returns void

    • Parameters

      • rowIndex: number
      • OptionalitemIndex: number

      Returns [number, number]

    • Returns void

    • Type Parameters

      • T

      Parameters

      • command: string
      • Optionalargs: Record<string, unknown>
      • OptionalcancellationToken: HsCancellationToken
      • OptionaltaskId: string

      Returns HsPromise<T>

    • Dispatches an options key pressed event.

      Parameters

      • rowIndex: number

        The row index.

      • OptionalitemIndex: number

        The item index.

      Returns void

    • Dispatches an item selected event.

      Parameters

      • rowIndex: number

        The row index.

      • OptionalitemIndex: number

        The item index.

      • OptionalisLongPress: boolean

        Whether the key press is a long press.

      Returns void

    • Parameters

      • reason: string

      Returns void

    • Parameters

      • isFocused: boolean

      Returns void

    • Easing function for smooth animation.

      Parameters

      • currentTime: number

        The current animation time.

      • startValue: number

        The starting value.

      • changeInValue: number

        The change in value.

      • duration: number

        The duration of the animation.

      Returns number

      The eased value.

    • Returns void

    • Finds the first focusable row: from startIndex to end, then from startIndex - 1 down to 0. Uses the same focusable criteria as getFirstFocusableRowIndex. Returns -1 if none found.

      Parameters

      • startIndex: number

      Returns number

    • Finds the index of the first visible row based on the given virtual Y position. This method uses a binary search algorithm to efficiently locate the row.

      Parameters

      • virtualY: number

        The virtual Y position to find the first visible row for.

      Returns number

      The index of the first visible row, clamped between 0 and the number of items minus one.

    • Safely reads the android-native launch args. globalThis is undefined on Roku (the transpiler does not emit it), so it MUST be guarded with typeof before indexing — otherwise globalThis[...] throws "Array operation attempted on variable not DIM'd" on device. Returns the args only when running android-native.

      Returns undefined | Record<string, unknown>

    • Gets the cell for a given row and item index.

      Parameters

      • rowIndex: number

        The row index.

      • itemIndex: number

        The item index.

      Returns undefined | ICollectionViewCell

      The cell, or undefined.

    • Type Parameters

      • T extends IHosannaView<ViewState>

      Parameters

      • id: string

      Returns undefined | T

    • Returns the current scroll metrics for the collection view. Used by scroll controllers to clamp deltas and compute momentum.

      Returns {
          currentOffset: number;
          maxScrollOffset: number;
          minScrollOffset: number;
          totalHeight: number;
          viewportHeight: number;
      }

    • Gets the data source item for a given row and item index.

      Parameters

      • rowIndex: number

        The row index.

      • itemIndex: number

        The item index.

      Returns undefined | IIdentifiable & JsonData

      The item, or undefined.

    • Gets the Direction enum value from a Key (using bridge-lib Direction for HsInputEvent).

      Parameters

      • key: Key

        The key to get direction for.

      Returns string

      The Direction value corresponding to the key.

    • Returns the index of the first visible row that can receive focus (a CustomViewRow or a row with content items). Returns -1 if none found or empty.

      Returns number

    • Parameters

      • nextStructs: ViewStruct<ViewState>[]

      Returns ViewStruct<ViewState>[]

    • Parameters

      • nextStructs: ViewStruct<ViewState>[]
      • map: Record<string, ViewStruct<ViewState>> = {}
      • idList: { childIndex: number; id: string }[] = []

      Returns {
          idList: { childIndex: number; id: string }[];
          mappedNextStructs: Record<string, ViewStruct<ViewState>>;
      }

    • Gets the X position of the currently focused cell's center for FocusOnClosestItem strategy.

      Returns number

    • Gets the currently focused data source item.

      Returns undefined | IIdentifiable

      The focused item, or undefined.

    • Retrieves the focus information for a specific row and item index.

      Parameters

      • rowIndex: number

        The row index.

      • itemIndex: number = -1

        The item index (default: -1).

      Returns undefined | IFocusInfo

      The focus info object, or undefined if not found.

    • Gets the Hosanna view for the currently focused row, if any.

      Returns undefined | IHosannaView<ViewState>

      The focused Hosanna view, or undefined.

    • Returns number

    • Returns number

    • Parameters

      • offsetY: number

      Returns number

    • Given a virtualY offset, returns the nearest row index using binary search. Pure lookup — no side effects.

      Parameters

      • offsetY: number

      Returns number

    • Parameters

      • startIndex: number
      • direction: number

      Returns number

    • Parameters

      • rowIndex: number
      • direction: number

      Returns number

    • Gets the next item indices.

      Returns [number, number]

      The next item indices.

    • Parameters

      • direction: number

      Returns [number, number]

    • Parameters

      • rowIndex: number
      • itemIndex: number = -1

      Returns undefined | IFocusInfo

    • Parameters

      • localY: number

      Returns number

    • Parameters

      • point: { x: number; y: number }

      Returns { x: number; y: number }

    • Parameters

      • OptionalvisibilityThreshold: number

      Returns number

    • Returns { firstVisibleRow: number; lastVisibleRow: number }


    • Rendererers


      Type Parameters

      • T extends IHosannaView<ViewState>

      Parameters

      • id: string
      • isDeepSearch: boolean = false

      Returns undefined | T

    • Gets the time required to move to the next row.

      Returns number

      The time in milliseconds.

    • Gets the total time required to move to the target row.

      Returns number

      The time in milliseconds.

    • Parameters

      • startIndices: number[]
      • endIndices: number[]

      Returns number

    • Handles focus event dispatching during animations.

      Parameters

      • percentToNextRow: number

      Returns void

    • Returns void

    • Parameters

      Returns boolean

    • Returns void

    • Handles a row key press event.

      Parameters

      • direction: number
      • isLongPress: boolean

        Whether the key press is a long press.

      • isLongPressEnd: boolean

      Returns boolean

      True if handled, false otherwise.

    • Parameters

      • triggerType: DSLTriggerType

      Returns boolean

    • Parameters

      • readingDirection: ReadingDirection

      Returns void

    • Returns void

    • Returns void

    • Rows cache this result when they are mounted. Keeping the test out of their render loop avoids constructing and dispatching progress events unless the collection explicitly opted into them.

      Returns boolean

    • Hibernates the CollectionView and its visible rows. Overrides BaseView.hibernateView() to also hibernate the rows (which are stored in this.rows[], not this.children[]).

      Returns void

    • Call when the hosting screen is covered by another (e.g. NavController push after transition). Runs BaseCollectionViewRow.onExitScreen on each row whose index lies within the CollectionView's current render/visibility buffer (from firstVisibleRow through lastVisibleRow, inclusive), as computed by calculateVisibleRows. This buffer may extend slightly beyond the strictly screen-visible rows. Indices with no row instance are skipped. Does not clear the data source or return rows to the pool (unlike cleanup). Idempotent while already hibernated.

      Returns void

    • Parameters

      • nextViewStructs: ViewStruct<ViewState>[]

      Returns void

    • Initializes a single tab group - hides all content rows except the default/current one

      Parameters

      • tabGroupName: string

      Returns void

    • Initializes tab groups during data source setup - ensures only default/current tabs are visible

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>
      • OptionalmountTarget: IHosannaView<ViewState>
      • index: number = -1

      Returns void

    • Parameters

      • view: IHosannaView<ViewState>

        The view to be added as a subview.

      • index: number = -1

        index of the child in the parent view, -1 means add to end

      Returns void

    • Invalidates the current layout starting from the specified row index. Recalculates renderedListPosition for each row and triggers rendering if needed.

      Parameters

      • firstRowIndex: number = 0

        The index of the first row to start invalidating from.

      • skipInitialRender: boolean = false

        When true, skip the initial render block (caller will jump/render).

      Returns void

    • Returns boolean

    • Parameters

      • view: IHosannaView<ViewState>

      Returns boolean

    • Returns boolean

    • Checks if a row is focusable.

      Parameters

      • rowIndex: number

        The row index.

      Returns boolean

      True if the row is focusable, false otherwise.

    • Returns boolean

    • Instantly jumps to the specified [row,item] without animation.

      Parameters

      • clampedRowIndex: number
      • clampedItemIndex: number
      • force: boolean = false

      Returns void

    • Instantly jumps to the specified row index without animation. Updates virtualY, focus, and row visibility immediately.

      Parameters

      • rowIndex: number

        The target row index.

      • OptionalrowItemIndex: number

        Optional target item index within the row.

      • force: boolean = false

      Returns void

    • Parameters

      • x: number
      • y: number
      • parentWidth: number
      • parentHeight: number

      Returns void

    • Parameters

      • value: undefined | number

      Returns number

    • Returns void

      Prefer BaseView.onDidAppearInAggregateView / BaseView.onDidReappearInAggregateView when shown via an aggregate transition. The framework still invokes this for other paths until migrated.

      IHosannaView.onAppear

    • Handles changes to the data source and updates rows/layout accordingly. Uses a re-entrancy guard so that changes triggered during processing (e.g. from onContentReady handlers that append rows) are queued and processed in a drain loop instead of recursing.

      Parameters

      Returns void

    • Returns void

      Prefer BaseView.onDisappearFromAggregateView when leaving an aggregate context during a transition. The framework still invokes this for other paths until migrated.

      IHosannaView.onDisappear

    • Called when an interaction (animation or jump) completes. Pops the next queued interaction and replays it as a keypress if it's a press/longPress interaction.

      Parameters

      • reason: string

      Returns void

    • Handles the Down key press.

      Parameters

      • isLongPress: boolean
      • isLongPressEnd: boolean

      Returns boolean

      True if handled, false otherwise.

    • Handles the FastForward key press (increases speed).

      Returns boolean

      True if handled, false otherwise.

    • Handles the Left key press.

      Parameters

      • isLongPress: boolean
      • isLongPressEnd: boolean

      Returns boolean

      True if handled, false otherwise.

    • Handles the OK key press (selects the current item).

      Parameters

      • isLongPress: boolean

      Returns boolean

      True if handled, false otherwise.

    • Handles the Options key press.

      Returns boolean

      True if handled, false otherwise.

    • Handles the Rewind key press (decreases speed).

      Returns boolean

      True if handled, false otherwise.

    • Handles the Right key press.

      Parameters

      • isLongPress: boolean
      • isLongPressEnd: boolean

      Returns boolean

      True if handled, false otherwise.

    • Handles the Up key press.

      Parameters

      • isLongPress: boolean
      • isLongPressEnd: boolean

      Returns boolean

      True if handled, false otherwise.

    • Called when the view is mounted.

      Parameters

      • parent: IHosannaView<ViewState> | BaseApp.BaseApp

        The parent view or app.

      • childIndex: number = -1

        The child index.

      Returns void

    • Parameters

      • rowIndex: number
      • offsetX: number

      Returns void

    • Parameters

      • offsetY: number

      Returns void

    • This method is called before applying state changes to the view. It is used to perform any necessary preparations before the state changes are applied.

      Returns void

    • Presents a new screen in the navigation stack or as a dialog.

      Parameters

      • screen: ViewStruct<ViewState>

        The screen to be presented, represented by a ViewStruct<ViewState>.

      • Optionaloptions: IScreenPresentationOptions

        Optional presentation options.

        • isDialog

          If true, the screen will be presented as a dialog.

        • animated

          If true, the screen transition will be animated.

      Returns void

    • Processes a batch of data source changes. Called by onDataSourceChanged.

      Parameters

      Returns void

    • Returns void

    • Parameters

      • nextStructs: ViewStruct<ViewState>[]

      Returns void

    • Parameters

      Returns void

    • Parameters

      Returns void

    • Parameters

      • rowIndex: number

      Returns void

    • Returns void

    • Parameters

      • message: string
      • errorField: IDebugErrorFieldMap

      Returns void

    • Parameters

      • message: string
      • errorField: IDebugErrorFieldMap

      Returns void

    • Unlike BaseView.release, does not call child.release() on subviews: list rows are torn down and released by dedicated CollectionView paths, so iterating children here would be redundant or unsafe.

      Returns void

    • When scrolling vertically toward the start of the list (direction -1), release sticky if the row we have just moved to (nextItemIndices before recompute === segment destination) is sticky.

      Parameters

      • currentRowIndex: number

      Returns void

    • Parameters

      • rowIndex: number

      Returns number

    • Parameters

      • changes: Partial<T>

      Returns void

    • Renders the currently focused row in the collection view.

      Parameters

      • delta: number

        The time delta since the last render.

      Returns void

    • Renders the collection view for the specified indices. Returns true if the rendering was successful, false otherwise.

      Parameters

      • clampedRowIndex: number

        The clamped row index.

      • clampedItemIndex: number

        The clamped item index.

      Returns boolean

      True if the rendering was successful, false otherwise.

    • Private

      Renders the rows that are currently visible within the viewport.

      This method calculates the first and last visible rows based on the current vertical scroll position (virtualY) and the height of the viewport (viewportHeight). It then iterates through the rows, rendering only those that are visible.

      The method performs the following steps:

      1. Determines the first visible row by finding the row at the current scroll position.
      2. Iterates through the rows to determine the last visible row based on the viewport height.
      3. Clears the visibleRows array.
      4. Renders each row that is within the visible range.

      Parameters

      Returns void

    • Sets which direct child this composite prefers on the next focus cascade, or moves focus to that child if this view is already in the focus chain.

      • First / Last: first or last direct child in children order with canReceiveFocus && visible.
      • Default: clears focusedChildId only (next cascade uses getInitialFocusId()); does not call setFocus.
      • Specific: same behavior as setFocusedSubview for a known child id.

      Parameters

      • target: ChildFocusTarget
      • OptionalchildId: string

      Returns void

    • Returns void

    • Parameters

      • reason: string

      Returns void

    • Parameters

      • nextInteraction: ICollectionInteraction

      Returns void

    • Instantly animates to the specified [row,item].

      Parameters

      • clampedRowIndex: number
      • clampedItemIndex: number
      • force: boolean = false

      Returns void

    • Instantly jumps to the specified row index without animation. Updates virtualY, focus, and row visibility immediately.

      Parameters

      • rowIndex: number

        The target row index.

      • OptionalitemIndex: number

        Optional target item index within the row.

      • force: boolean = false

      Returns void

    • Changes the visual z-order of a child by moving it to a new index. Higher indices render on top. Updates both the children array and the renderer. Requires removeChild before insertChild because the SG node's insertChild always adds (splices in) and does not move; calling it on an already-present child would duplicate.

      Parameters

      • child: IHosannaView<ViewState>
      • newIndex: number

      Returns void

    • Parameters

      • errorObj: IDebugErrorObject

      Returns void

    • Sets the scroll offset directly for external scroll (touch drag, mouse wheel). Only takes effect when no index animation is in progress. Clamps to valid bounds and refreshes visible rows.

      Parameters

      Returns boolean

      true if the offset was applied, false if an animation is in progress.

    • Private

      This method calculates and updates several properties related to the focus tracking of rows in the collection view. It ensures that the focus is within the valid range of rows and calculates the time to reach the next row for focus tracking.

      Returns void

      • If there are no rows, a warning is logged and the method returns early.
      • If the next row index is out of bounds, a warning is logged and the method returns early.
    • Parameters

      • key: string
      • newVal: unknown

      Returns void

    • Parameters

      • rowIndex: number
      • itemIndex: number

      Returns void

    • Parameters

      • rowIndex: number
      • itemIndex: number

      Returns void

    • Returns boolean

    • Parameters

      • dialog: ViewStruct<ViewState>

      Returns void

    • Animates the view to the specified item index within the specified row.

      Parameters

      • index: number

        The item index.

      • fast: boolean = false

        Whether to animate quickly.

      • OptionalrowIndex: number

        The row index, if not provided, the currently focused row will be used.

      Returns void

    • Returns void

    • Positions the focus indicator on the currently focused row/item. Uses the same vertical math as jumpToRow so grid rows scrolled within the collection stay aligned after blur/focus or aggregate reappear.

      Returns void

    • Per-tick reconciliation with the native scroller: frame + content metrics flow down on change, and while the native side is idle the offset follows any JS-driven virtualY change (index animations, scrollToRow) so the next gesture starts from the right position. While dragging/decelerating the native offset is authoritative and is never pushed.

      Returns void

    • Parameters

      • targetRowIndex: number
      • targetItemIndex: number

      Returns void

    • Updates the focus tracker based on the percentage of movement to the next row.

      This method renders the focus manager while moving between items and updates the focus tracking fields when the movement to the next row is complete.

      Parameters

      • percentToNextRow: number

        A number representing the percentage of movement to the next row. When this value is 1 or greater, the focus tracking fields are updated and the focus manager is set to the next focus information.

      Returns void

    • Parameters

      • firstVisible: number
      • lastVisible: number

      Returns void

    • Updates the visibility of rows in the collection view.

      This method calculates the currently visible rows and updates the currentIndex to the first visible row. It then iterates through all rows and triggers the onEnterScreen method for rows that have become visible and the onExitScreen method for rows that have gone off-screen.

      Returns void

    • Returns void

    • True when vertical scrolling is delegated to the platform scroller — the JS scroll controller must not drive the vertical axis itself.

      Returns boolean

    • Wakes up the CollectionView and restores its visible rows. Overrides BaseView.wakeView() to also wake the rows (which are stored in this.rows[], not this.children[]).

      Returns void