-
public final class ScreenManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classScreenManager.Companion
-
Method Summary
Modifier and Type Method Description final UnitsetDelegate(AppDNAScreenDelegate delegate)SPEC-070-A B.6 — register the host's screen delegate. final ScreenConfigpreviewScreen(String json)SPEC-070-A I.11 — preview a screen from a raw JSON payload (host-side, not from remote config). final UnitshowScreen(String screenId, Function1<ScreenResult, Unit> callback)final UnitshowFlow(String flowId, Function1<FlowResult, Unit> callback)final UnitdismissScreen()SPEC-070-A finalization B6 P1 — best-effort dismissal of the currently presented SDUI screen. final BooleanhandleScreenAction(String screenId, Map<String, Object> action)SPEC-070-A B.6 + G. final UnittrackScreenResponseSubmitted(String screenId, Integer fieldCount)SPEC-070-A G. final Pair<String, ScreenConfig>screenForSlot(String slotName)final UnitevaluateTriggers(String event, Map<String, Object> properties)final UnitenableNavigationInterception(List<String> forScreens)final UnitdisableNavigationInterception()final UnitevaluateInterceptions(String screenName, String timing)final Unitreset()-
-
Method Detail
-
setDelegate
final Unit setDelegate(AppDNAScreenDelegate delegate)
SPEC-070-A B.6 — register the host's screen delegate.
-
previewScreen
final ScreenConfig previewScreen(String json)
SPEC-070-A I.11 — preview a screen from a raw JSON payload (host-side, not from remote config). Mirrors iOS
ScreenManager.previewScreen(json:). Parses → cache under the parsedid→ present via showScreen. Used by the console preview flow + integration tests.Returns the parsed ScreenConfig on success, null on parse failure.
-
showScreen
final Unit showScreen(String screenId, Function1<ScreenResult, Unit> callback)
-
showFlow
final Unit showFlow(String flowId, Function1<FlowResult, Unit> callback)
-
dismissScreen
final Unit dismissScreen()
SPEC-070-A finalization B6 P1 — best-effort dismissal of the currently presented SDUI screen. Mirrors iOS
ScreenManager.dismissScreenwhich dismisses the top UIViewController.Today screens render via AppDNAScreenSlot in the host's own Composable tree (NOT via a dedicated SDUI ScreenActivity yet — that's tracked separately as the larger B6 P0-2 follow-up). For activity-hosted presentations (PaywallActivity / OnboardingActivity / SurveyActivity) the host already calls module-specific dismissers; this method additionally signals PresentationCoordinator that the modal closed so the next queued presentation can fire, and best-effort finishes any tracked SDUI ScreenActivity once that lands.
-
handleScreenAction
final Boolean handleScreenAction(String screenId, Map<String, Object> action)
SPEC-070-A B.6 + G.8 — public hook for SectionRegistry / Activity-based action dispatch to fire the screen delegate's
onScreenActionveto hook AND emit thescreen_actionanalytics event. Returnsfalsewhen the host vetoed the action — the caller MUST NOT execute the default action handling in that case.action mirrors iOS
SectionActionpayload shape (typeplus type-specific fields).
-
trackScreenResponseSubmitted
final Unit trackScreenResponseSubmitted(String screenId, Integer fieldCount)
SPEC-070-A G.8 — emit
screen_response_submittedfor form/submit actions. Hosts call this when a screen submits a form payload to the SDK. Mirrors iOS ScreenManager.swift:311.
-
screenForSlot
final Pair<String, ScreenConfig> screenForSlot(String slotName)
-
enableNavigationInterception
final Unit enableNavigationInterception(List<String> forScreens)
-
disableNavigationInterception
final Unit disableNavigationInterception()
-
evaluateInterceptions
final Unit evaluateInterceptions(String screenName, String timing)
-
-
-
-