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

    GridGroupView is a composite view for displaying children in a grid layout.

    • Supports configurable columns, alignment, and spacing.
    • Handles focus navigation and layout measurement.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    addChild addChildren addRendererToParentViewRenderer addSubView animateViews applyIdsToViewStructs applyInitialState applyLayoutStateToNativeRenderer applyStateChanges bringChildInFrontOfChild bringChildToFront buildView canChangeOrientation canMeasureBounds clearErrorByErrorField clearErrors configureAudioGuideItem containsChild createDataEvent dismiss dispatch dispatchAction dispatchAsync dispatchSelection findNextFocusable findNextFocusableView findNextFocusableViewByDirection getAnimationPropsForStateProperty getAudioGuideItem getBounds getBoundsInApp getBoundsInParent getChangedField getChildView getColumnsForRow getCustomData getField getFlatIndexForRowAndColumn getFlattenedStructs getFlattenedStructsById getGridHeight getGridMeasuredDimensions getGridWidth getNavController getObservableField getPointInLocalCoordinates getRowAndColumnForIndex getSpacingConstants getSubView getSubViewRenderer getXOffset getXOffsetForRow getYOffset hibernateView inflateViewStructs insertChild insertChildAfterOtherChild insertChildBeforeOtherChild insertSubView invalidateLayout invalidateParentLayout isDescendantOf isInFocusChain layoutAt layoutChildren markStateDirtyForViewManager measure notifyOnFocusedChildChange onAppear onAppearAgain onBlur onDidAddToAggregateView onDidAppearInAggregateView onDidChangeOrientation onDidReappearInAggregateView onDidRemoveFromAggregateView onDisappear onDisappearFromAggregateView onFirstAppear onFocus onInputEvent onMount onUnmount onWillAddToAggregateView onWillApplyStateChanges onWillChangeOrientation onWillRemoveFromAggregateView onWillReuse performViewManagerLayoutChildren present reconcileChildren recycle registerControlWithErrorMessage registerControlWithKnownError release removeChild removeSubView render requestFocusedChild resolveFocusEntryTarget sendChildBehindOtherChild sendChildToBack setChildIndex setError setField setLayoutField setObservableField setShowOnScreen setState showDialog unobserveObservableObjects wakeView

    Constructors

    Properties

    __isMemoizedStateValid: boolean = false
    _cacheKey: string = ''
    _hid: string
    _isInFocusChain: boolean = false
    activeAnimation?: HosannaViewAnimator

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

    activeStyleViewStatus: ViewStatus = ViewStatus.Normal
    addItemSpacingAfterChild: boolean = false

    Whether to add item spacing after the last child in each row.

    aggregateView: undefined | IAggregateView.IAggregateView

    IHosannaView


    appConfig: IAppConfig
    audioGuideHint?: string = ''

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

    audioGuideItem?: string | IAudioGuideItem
    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[] = ...
    columns: number | number[] = 3

    Number of columns per row. Can be a single number or an array describing each row.

    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

    customData?: unknown
    defaultValues: Partial<T> = {}
    eventHandlers: Record<string, Function> = {}
    focusedChildId?: string
    focusEntryStrategy: GroupFocusEntryStrategy = GroupFocusEntryStrategy.Default

    How this group chooses a child when focus enters from outside the group.

    focusId: string = ''
    gridHeight: number = 0

    Total height of the grid.

    gridWidth: number = 0

    Total width of the grid.

    height: number = 0
    horizAlignment: SGHorizontalAlignment = SGHorizontalAlignment.Left

    Horizontal alignment of the grid content.

    id: string = ''
    includeInLayout: boolean = true
    initialFocusId: string = ''
    instancePool: IInstancePool
    isFocused: boolean = false

    Indicates whether the element is currently focused.

    isLayoutDirty: boolean = false
    isPresented: boolean = false

    If true, this view has been presented in an AggregateViewController

    isSkeleton: boolean = false
    isWaking: boolean = false
    itemSpacing: number | [number, number] = 0

    Spacing between items, as a number or [horizontal, vertical] tuple.

    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.

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

    List of child views to be laid out in the grid.

    nativeGlass: undefined | SGNativeGlassEffect = undefined
    nextViewId: number = 0
    nodePool: INodePool
    numRows: number = 0

    Cached number of rows in the current layout.

    opacity: number = 1.0
    parent?: IHosannaView<ViewState> = undefined
    partialRendererHibernatedState: Partial<T> = {}
    rotation: number = 0
    rowHeights: number[] = []

    Heights of each row in the grid.

    rowWidths: number[] = []

    Widths of each row in the grid.

    scale: number[] = ...
    scaleRotateCenter: number[] = ...
    scrollablePositionX: undefined | number = undefined
    scrollablePositionY: undefined | number = undefined
    spacingConstants: [number, number] = ...

    Cached spacing constants [horizontal, vertical].

    staticType: ViewStaticType = ViewStaticType.None
    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
    translation: number[] = ...
    vertAlignment: SGVerticalAlignment = SGVerticalAlignment.Top

    Vertical alignment of the grid content.

    viewOwner: IHosannaView<ViewState>

    The IHosannaView subclass that created us in getViews

    viewStatus: ViewStatus = ViewStatus.Normal
    visible: boolean = true

    Indicates whether the navigatable entity is visible.

    width: number = 0
    xOffset: number = 0

    Horizontal offset for grid alignment.

    yOffset: number = 0

    Vertical offset for grid alignment.

    Accessors

    • get _rendereredTranslation(): [number, number]

      Returns [number, number]

    • set _rendereredTranslation(value: [number, number]): void

      Parameters

      • value: [number, number]

      Returns void

    • get renderer(): undefined | R

      Returns undefined | R

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

      Parameters

      • value: undefined | R

      Returns void

    • get viewPhase(): ViewPhase

      Returns ViewPhase

    • set viewPhase(phase: ViewPhase): void

      Parameters

      Returns void

    Methods


    • Children


      Parameters

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

      Returns void

    • Parameters

      • children: IHosannaView<ViewState>[]

      Returns void

    • Parameters

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

      Returns void


    • View Creation


      Parameters

      • view: IHosannaView<ViewState>

      Returns void

    • Parameters

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

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>
      • otherChild: IHosannaView<ViewState>

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>

      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

      • _event: HosannaOrientationChangeEvent

      Returns boolean

    • Parameters

      • errorField: IDebugErrorFieldMap

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>

      Returns boolean

    • Parameters

      • Optionaloptions: IScreenDismissOptions

      Returns void


    • Measurement


      Returns I2DRectangle

    • Parameters

      • otherView: IHosannaView<ViewState>

      Returns I2DRectangle

    • Type Parameters

      • T extends IHosannaView<ViewState>

      Parameters

      • id: string

      Returns undefined | T

    • Returns the number of columns for the given row. If columns is a number, returns that value. If it is an array, returns the value at the given row index, falling back to the last entry for rows beyond the array length.

      Parameters

      • rowIndex: number

      Returns number

    • Compute flat index for a given row and column using the columns spec.

      Parameters

      • rowIndex: number
      • columnIndex: number

      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>>;
      }

    • Returns the grid height, using the configured height if set.

      Parameters

      • gridHeight: number

        The measured grid height.

      Returns number

      The height to use for the grid.

    • Calculates the widths and heights of each row, and the total grid dimensions.

      Returns {
          gridHeight: number;
          gridWidth: number;
          rowHeights: number[];
          rowWidths: number[];
      }

      An object containing rowWidths, rowHeights, gridHeight, and gridWidth.

    • Returns the grid width, using the configured width if set.

      Parameters

      • gridWidth: number

        The measured grid width.

      Returns number

      The width to use for the grid.

    • Returns undefined | INavController

    • Parameters

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

      Returns { x: number; y: number }

    • Computes row/column indices for a flat child index given the columns-by-row rules.

      Parameters

      • childFlatIndex: number

      Returns { columnIndex: number; rowIndex: number }

    • Returns the spacing constants as a [horizontal, vertical] tuple.

      Returns [number, number]

      The spacing constants.


    • Rendererers


      Type Parameters

      • T extends IHosannaView<ViewState>

      Parameters

      • id: string
      • isDeepSearch: boolean = false

      Returns undefined | T

    • Calculates the horizontal offset for grid alignment.

      Parameters

      • gridWidth: number

        The total width of the grid.

      Returns number

      The x offset.

    • Calculates the horizontal offset for a specific row based on its width.

      Parameters

      • rowIndex: number

        The index of the row.

      Returns number

      The x offset for that row.

    • Calculates the vertical offset for grid alignment.

      Parameters

      • gridHeight: number

        The total height of the grid.

      Returns number

      The y offset.

    • Hibernates the view and its subviews by releasing native renderers and setting the view phase to Hibernating.

      Returns void

    • Parameters

      • nextViewStructs: ViewStruct<ViewState>[]

      Returns void

    • Parameters

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

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>
      • otherChild: IHosannaView<ViewState>

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>
      • otherChild: IHosannaView<ViewState>

      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

    • Parameters

      • view: IHosannaView<ViewState>

      Returns boolean

    • Lays out the grid group view at the specified position.

      Parameters

      • x: number

        The x-coordinate.

      • y: number

        The y-coordinate.

      • parentWidth: number

        The width of the parent container.

      • parentHeight: number

        The height of the parent container.

      Returns void

    • Lays out the child views in the grid according to the current configuration.

      Returns void

    • Measures the grid group and its children, updating layout properties.

      Returns void

    • 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

    • Called when this view becomes the visible top again after having been covered by another screen on the same NavController (same transition finish as onAppear, immediately after it).

      Returns void

      Prefer overriding onDidReappearInAggregateView; default implementation chains from it.

    • DO NOT CALL THIS METHOD DIRECTLY DO NOT OVERRIDE IT

      Returns void

    • Parameters

      • _event: HosannaOrientationChangeEvent

      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 this view becomes the visible top of a NavController stack for the first time for that controller (same transition finish as onAppear, immediately after it).

      Returns void

      Prefer overriding onDidAppearInAggregateView; default implementation chains from it.

    • Handles focus events for the grid group view.

      Returns void


    • Lifecycle


      Parameters

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

      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

    • Parameters

      • _event: HosannaOrientationChangeEvent

      Returns void

    • Called by InstancePool.get() before a pooled instance is handed out. Restores the view to a construction-equivalent state so that stale lifecycle data (focus, viewStatus, old text, dirty flags, etc.) from the previous owner does not bleed into the new one.

      Class-default

      Returns void

      values (captured on first construction into the InstancePool per-class-name registry) are placed into pendingState with state left empty — matching a freshly-constructed view. This guarantees that every subsequent setField call (in applyInitialState) detects a difference against the empty state and pushes the value into pendingState, so applyLayoutStateToNativeRenderer applies ALL layout props (opacity, visible, translation, …) to the newly-acquired renderer even when the logical value equals the class default.

    • 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

    • Parameters

      • nextStructs: ViewStruct<ViewState>[]

      Returns void

    • Parameters

      • message: string
      • errorField: IDebugErrorFieldMap

      Returns void

    • Parameters

      • message: string
      • errorField: IDebugErrorFieldMap

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>

      Returns void

    • Parameters

      • view: IHosannaView<ViewState>

      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

    • Parameters

      • child: IHosannaView<ViewState>
      • otherChild: IHosannaView<ViewState>

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>

      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

    • Parameters

      • key: string
      • newVal: unknown

      Returns void


    • Navigatable View


      Parameters

      • shown: boolean

      Returns void

    • Parameters

      • state: Partial<T>

      Returns void

    • Parameters

      • dialog: ViewStruct<ViewState>

      Returns void

    • Wakes up the view and its subviews by reserving native renderers and setting the view phase to Mounted.

      Returns void