Constructs a new BaseApp instance.
The root scene object.
OptionallaunchArgs: ILaunchArgsOptional_Optional object ID for this app instance.
OptionalactiveIf present, an animation currently targeting this view (or its subviews).
IHosannaView
Convenience accessor to the app config.
PrivateappThe main app holder group node.
OptionalaudioThis hint can be used in conjunction with the audio guide item
OptionalaudioThe background rectangle node.
Indicates whether the element can receive focus.
List of child views.
Indicdates whether the view is a focus group which means it can have a focused child Otherwise it will be focused itself
OptionalcustomPrivateelapsedTime elapsed since the last FPS reset.
OptionalfocusedFocus manager for handling focus across views.
PrivatefpsFrames per second for the main loop.
PrivateframesNumber of frames rendered in the current second.
Application ID.
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 tick time for the main loop.
Private OptionalloopInterval ID for the main loop (web only).
Private OptionalmetricsNode pool for view management.
Private OptionalorientationOptionalparentPrivateremoteRemote debug client instance.
OptionalrootThe root view of the application.
List of subviews.
System service for platform/system-level operations.
Audio guide manager for handling audio guide events.
Timer service for scheduling and ticking.
The IHosannaView subclass that created us in getViews
Indicates whether the navigatable entity is visible.
Adds the dialog manager view to the app. Sets up dialog event handlers.
PrivateaddPrivateaddAdds scene-level views such as the app holder and dialog manager.
View Creation
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).
PrivateapplyOptionalnextState: ViewStatePrivateassignAssigns base IoC services to the app instance. Used as a workaround for static-only injection on Roku.
Begins the application launch sequence. Initializes scene, IoC, views, and starts the main loop.
PrivatebeginCalled automatically at the start of the app launch sequence.
PrivatebroadcastPrivatebroadcastBuilds the view and attaches it to the view owner.
OptionalmountTarget: IHosannaView<ViewState>The target to mount the view.
The built view or undefined.
PrivateconfigureConfigures the IoC container for the current platform.
PrivatecreateOptionaloptions: IScreenDismissOptionsOptionalargs: Record<string, unknown>OptionalcancellationToken: HsCancellationTokenOptionaltaskId: stringAsync Support
Optionalargs: Record<string, unknown>Optionalcallback: AsyncCommandEventCallbackOptionaltaskId: stringPrivatedispatchOptionalorientationEvent: HosannaOrientationChangeEventPrivatedispatchExecutes a hosanna debug command by id. Public so RemoteDebugClient can invoke when it receives printHSTree, printSGTree, etc. via WebSocket.
Optionaldata: Record<string, unknown>Resolves 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.
Call this method to finish the app launch sequence.
Default animation provider mapping for simple properties. By default, maps 'opacity' to the base renderer's 'opacity' field. Views can override to provide richer mappings.
Returns the dialog manager for the app, if any.
The dialog manager view, or undefined if not present.
Audio guide support
Measurement
PrivategetPrivategetOptionalstate: Partial<HosannaOrientationState>PrivategetPrivategetPrivategetPrivatehandlePrivatehandlePrivatehandleHandles system message events sent from task threads. Forwards the message to SystemMessageManager for display.
The system message event.
Hibernates the view and its subviews by releasing native renderers and setting the view phase to Hibernating.
Hides the main menu, making it invisible and unfocusable.
Whether to animate the menu disappearance.
Initializes asynchronous services and prepopulates the async command pool.
A promise that resolves when async services are initialized.
PrivateinitializeInitializes the class registry for the current platform. Skips initialization on Roku (uses different reflection mechanism).
A promise that resolves when the class registry is initialized.
PrivateinitializeThe view to be added as a subview.
index of the child in the parent view, -1 means add to end
PrivateinvalidatePrivateinvalidateFocus
Loads the application configuration, including style JSON.
A promise that resolves when the configuration is loaded.
Compiles theme.shapes into theme.compiledShapes.
Runs automatically during the launch sequence, and can be called again at
any time (e.g. after a theme/config reload — setConfig wipes
theme.compiledShapes, so shapes must be reloaded). Fragments created
before a reload must be recreated to pick up new shape styles.
On Roku this waits for the imageGenerator task to pre-render each shape to a nine-patch image; on other platforms it resolves immediately.
PrivatelogPrivateobserveCalled 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
PrivateonCalled 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.
DO NOT CALL THIS METHOD DIRECTLY DO NOT OVERRIDE IT
Event which was processed in main.brs On Web emulator, this is called directly from the Brs classes that dispatch the event. e.g. roAudioGuide, will call HosannaAppUtils.getApp().onSystemEvent(event);
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.
Pre-creates SceneGraph (SG) views and populates the node pool.
A promise that resolves when SG views are pre-created.
Prepares the background rectangle for the app. Creates and inserts a rectangle node if not already present.
PrivatepreparePrepares the main scene for the app. Sets up scene properties and renderer.
PrivateprepareMounts the scene in web environments.
Presents 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.
Handles on-device debugging commands.
The debug command to execute.
IReusable implementation
PrivaterefreshPrivateregisterRegisters input adapters for the current platform. Web gets keyboard + debug + mouse + touch adapters. Uses PlatformAppInitializer to avoid cross-platform import issues.
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: stringPrivateresolvePrivateresolveResolves system-level IoC dependencies and registers services. CRITICAL: Resolve services in dependency order - services that other services depend on must be resolved first. For example, TimerService depends on systemService, so systemService must be resolved before timerService.
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 frames per second for the main loop.
The desired frames per second.
Navigatable View
Shows a dialog by passing it to the dialog manager.
The dialog view to show.
Shows the main menu, making it visible and focusable.
Whether to animate the menu appearance.
PrivatestartPrivatestartStops the main application loop.
Wakes up the view and its subviews by reserving native renderers and setting the view phase to Mounted.
The main application base class. Handles app lifecycle, dependency injection, scene/view management, main loop, and dialog management. Extend this class to implement your application logic.