Package-level declarations
Types
An immutable snapshot of a ScopeStack: the accumulated scope defaults plus the effective screen / section. Use enrich to apply it to an event's properties.
An opaque token identifying a pushed frame, for ScopeStack.update, ScopeStack.reparent, ScopeStack.remove, ScopeStack.setScreenMasked and ScopeStack.setActive.
The ambient scope + screen context of the currently visible UI, as a stack of pushed frames.
The most recently viewed screen, so the next screen view can be enriched with previous_screen. Autograph reads it for nothing else: an autocaptured event takes its screen from ScopeStack frames only, and reports none when no frame supplies one.
Properties
The ScopeStack frame of the surface that owns this view's subtree, or null if none has claimed it. Shared between Autograph's own Android pipelines and not a supported public API.
The event name an autocaptured tap is reported under when the caller doesn't choose one.
Functions
Registers listener on this view, to run whenever a surface above the view claims or releases its root (notifyAutographScopeOwnerChanged). The Compose provider uses it to re-link its root frame under the surface that now hosts it; without it, a composition that existed before the native capture was installed stays a root — and a root under no boundary applies to every event, so an off-screen pager page would lend its screen to a tap on the page beside it.
The origin for an event on this view: its own autographScopeOwner, or the nearest ancestor's, or null when no surface up the tree has claimed one (no native capture installed, or a window — a Popup, a Dialog — whose view tree is not under any surface's root).
Puts handle's frame in the visit screenViewId of screen (#242) without starting a new one and without a Screen Viewed — for a surface re-created into a view that is already in progress, such as an Android Activity or fragment after a configuration change, so the events after it stay in the visit before it. As for any visit, the stack reports it only while the frame names screen. A no-op when the frame is not on this stack. Main thread only.
Records name as the current screen and emits a Screen Viewed for it, carrying the screen it replaced as previous_screen. The one place that couples recording with emitting, so every native screen-capture caller — the iOS UIKit swizzle, the iOS explicit SwiftUI path, and the Android Activity/Fragment lifecycle capture — cannot drift on the order or on the self-previous guard.
Ends the visit handle's frame is in (#242), for a native screen capture whose surface stops being viewed while its frame stays: the next view of it starts a new visit, and until then a tap resolved from the frame must carry no visit id rather than the finished one's. A no-op when the frame holds none. Main thread only.
Runs every listener registered with addAutographScopeOwnerListener in this view's subtree, this view included. Called by the native screen capture after it claims or releases a surface's root view. The walk is the same one the capture already makes over a new surface's view tree; a listener that throws is swallowed so a lifecycle callback never crashes the host app.
Removes a listener added with addAutographScopeOwnerListener; a no-op if it is not registered.
The id of the visit handle's frame holds (#242), whether or not the stack reports it right now, or null when it holds none or is not on this stack — for a native screen capture that carries one view of a screen over to the frame of the surface re-creating it (see continueScreenVisit). Main thread only.
Starts a new visit of screen on handle's frame (#242) and returns its id, or null when the generator fails or the frame is not on this stack — for an emit site outside this module that builds its own Screen Viewed, as autograph-compose's screen trackers do. Put the returned id on that screen view directly rather than reading it back from the stack; emitScreenView is this plus the emit.