OptionalactiveIf present, an animation currently targeting this view (or its subviews).
IHosannaView
Duration of scroll animations in ms.
PrivateanimatorAnimator for smooth scrolling.
OptionalaudioThis hint can be used in conjunction with the audio guide item
OptionalaudioEnables or disables auto-scrolling to focused child.
Indicates whether the element can receive focus.
These are the children that are rendered on screen in the tree structure of the view
Indicdates whether the view is a focus group which means it can have a focused child Otherwise it will be focused itself
Initial position of scrollable internal group.
OptionalcustomOptionalcustomCallback for custom horizontal positioning.
Custom horizontal position for children.
Custom vertical position for children.
OptionalcustomCallback for custom vertical positioning.
OptionalfocusedHorizontal alignment of scrollable content.
Indicates whether the element is currently focused.
If true, this view has been presented in an AggregateViewController
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.
PrivatelastLast focused child view.
OptionalonOptional callback for custom animation to position.
PrivateoriginalOriginal container position for restoration.
OptionalparentPrivatependingPending focus event for deferred scrolling.
PrivatepivotView to restore scroll position to.
PrivatescrollableOptionalscrollChild to scroll to.
These are the children that were created in getViews, in a flat strcuture - it contains EVERYTHING that we declared.
Vertical alignment of scrollable content.
The IHosannaView subclass that created us in getViews
Height of the scrollable viewport.
Width of the scrollable viewport.
Indicates whether the navigatable entity is visible.
PrivatewasWhether the view was scrolled.
Adds the renderer to the parent view's renderer.
The parent view.
The index at which to add the child.
View Creation
Animates the scroll view to bring a child into view.
The child view to scroll to.
The animation duration in ms.
Will be deprecated, use scrollTo instead Animates the scroll view to the specified position over a given duration. In this method, the position is considered absolute, not relative to the current view translation.
The target position as a tuple [x, y] to scroll to.
The duration of the animation in milliseconds.
Convenience: animate logical properties across this view's subtree.
Animation specification mapping view IDs to their target property values
Animation duration in milliseconds
OptionalonCompleted: () => voidOptional callback invoked when animation completes
Optionaloptions: Partial<AnimationOptions>Extra animation options; duration and useCurrentState here are ignored (see HosannaViewAnimator.animateViews).
PrivateapplyPrivateapplyOptionalnextState: ScrollViewStatePrivatebottomBuilds the view and attaches it to the view owner.
OptionalmountTarget: IHosannaView<ViewState>The target to mount the view.
The built view or undefined.
PrivatecenterPrivatecenterPrivateclampPrivatecustomPrivatecustomPrivatedefinePrivatedefineOptionaloptions: IScreenDismissOptionsOptionalargs: Record<string, unknown>OptionalcancellationToken: HsCancellationTokenOptionaltaskId: stringAsync Support
Optionalargs: Record<string, unknown>Optionalcallback: AsyncCommandEventCallbackOptionaltaskId: stringResolves the next focusable element in the given direction.
The event containing details about the focus transition.
The next focusable element, or undefined if none exists.
PrivatefloatingPrivatefloatingDefault animation provider mapping for simple properties. By default, maps 'opacity' to the base renderer's 'opacity' field. Views can override to provide richer mappings.
Audio guide support
Measurement
PrivategetPrivategetPrivategetReturns the first focusable child view.
The first focusable child view or undefined if no focusable children are found.
PrivategetPrivategetPrivategetPrivatehandleHandles a focus change event and animates to the new child.
The focus child change event.
Hibernates the view and its subviews by releasing native renderers and setting the view phase to Hibernating.
The view to be added as a subview.
index of the child in the parent view, -1 means add to end
Focus
PrivateleftPrivateneedPrivatenonePrivatenoneHandles changes to the focused child and triggers scrolling if needed.
The focus child change event.
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).
Prefer overriding onDidReappearInAggregateView; default implementation chains from it.
DO NOT CALL THIS METHOD DIRECTLY DO NOT OVERRIDE IT
Called after the navigatable entity has been added to an aggregate view.
The aggregate view to which the entity has been added.
Called when this view becomes the visible top of its owning NavController stack for the first time (after onDidAddToAggregateView). Default implementation delegates to onAppear and onFirstAppear.
The aggregate view (e.g. NavController) whose transition finished.
Called when this view becomes the visible top again after having been covered by another screen on the same NavController. Default implementation delegates to onAppear and onAppearAgain.
The aggregate view (e.g. NavController) whose transition finished.
Called after the navigatable entity has been removed from an aggregate view.
The aggregate view from which the entity has been removed.
Called when this view is hidden during an aggregate transition or via BaseAggregateView.hideView.
Default implementation delegates to onDisappear.
The aggregate view from which this view is disappearing.
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).
Prefer overriding onDidAppearInAggregateView; default implementation chains from it.
Handles focus events for the scroll view.
Called before the navigatable entity is added to an aggregate view.
The aggregate view to which the entity will be added.
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.
Called before the navigatable entity is removed from an aggregate view.
The aggregate view from which the entity will be removed.
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
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.
Performs layout of child views and handles pending focus events.
PrivatepredefinedPrivatepredefinedPresents a new screen in the navigation stack or as a dialog.
The screen to be presented, represented by a ViewStruct<ViewState>.
Optionaloptions: IScreenPresentationOptionsOptional presentation options.
If true, the screen will be presented as a dialog.
If true, the screen transition will be animated.
IReusable implementation
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.OptionalchildId: stringResets the scroll view to the initial state.
PrivaterestorePrivaterightAnimates the scroll view to the specified position over a given duration. In this method, the position is considered relative to the current view translation.
The target position as a tuple [x, y] to scroll to.
The duration of the animation in milliseconds.
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.
Sets the scroll position directly for external scroll (touch drag, mouse wheel). Stops any running animation and applies the position instantly.
Navigatable View
PrivatestorePrivatetopWakes up the view and its subviews by reserving native renderers and setting the view phase to Mounted.
ScrollViewView is a composite view for displaying scrollable content.
Remarks
Example