Skip to main content
Version: 1.1.x

Compose

Package
ai.coryn.replay.api.recordercompose
Artifact
ai.coryn.replay.api:recorder-compose

These are top-level Kotlin declarations. The Compose artifact includes the View recorder and core API. Initialise Coryn and request recording through Coryn. See minimum requirements for compatible Compose versions.

CorynScreenRoot​

Signature
@Composable
fun CorynScreenRoot(
name: String,
arguments: Bundle? = null,
content: @Composable () -> Unit
)

Register a screen while the root is in composition, and unregister it when it leaves. name identifies the screen; arguments optionally records String, Number, and Boolean values. These arguments are recorded data and are not redacted by visual masks.

The root does not add a parent layout or change the layout configuration of content.

CorynStateProviderRoot​

Signature
@Composable
fun <S : CorynState> CorynStateProviderRoot(
stateId: String,
content: @Composable CorynStateProviderRootContentScope<S>.() -> Unit
)

Register a provider while the root is in composition. There is one active provider per stateId; a new State Provider root with the same ID replaces the previous provider, including a combined screen/provider root. No parent layout is added.

Use the supplied State Provider callbacks to install the State and cleanup callbacks:

Kotlin usage
CorynStateProviderRoot<CheckoutState>(stateId = "Checkout") {
provideCorynState { checkoutSnapshot }
doOnProviderRemove { releaseProviderResources() }
CheckoutContent()
}

CheckoutState, checkoutSnapshot, and the content/cleanup functions are app-defined. Each returned snapshot must follow the stable snapshot contract.

CorynScreenStateProviderRoot​

Signature
@Composable
fun <S : CorynState> CorynScreenStateProviderRoot(
screenName: String,
stateId: String,
content: @Composable CorynStateProviderRootContentScope<S>.() -> Unit
)

@Composable
fun <S : CorynState> CorynScreenStateProviderRoot(
screenName: String,
stateId: String,
arguments: Bundle?,
content: @Composable CorynStateProviderRootContentScope<S>.() -> Unit
)

Combine screen and State Provider registration in a single root. The overload without arguments forwards null. The screen lifecycle, allowed arguments, provider replacement, and content scope behave as described above. No parent layout is added.

See Screens - Compose for combined and nested examples.

Modifier.corynHideFromUiCapture​

Signature
fun Modifier.corynHideFromUiCapture(): Modifier
fun Modifier.corynHideFromUiCapture(hide: Boolean): Modifier
fun Modifier.corynHideFromUiCapture(padding: CorynPadding?): Modifier
fun Modifier.corynHideFromUiCapture(hide: Boolean, padding: CorynPadding? = null): Modifier

Hide a Composable in visual UI captures and exclude eligible text from automatic Screen Text collection. The no-argument and padding-only overloads enable hiding. hide = false disables that declaration; null padding adds no custom hiding padding. hiding padding values are in dp.

Kotlin usage
import ai.coryn.replay.api.recordercompose.corynHideFromUiCapture
import ai.coryn.replay.shared.uicapture.CorynPadding

Text(
text = accountNumber,
modifier = Modifier.corynHideFromUiCapture(padding = CorynPadding.horizontal(12f))
)

Apply before showing sensitive content. For Views hosted in AndroidView, use this modifier on the Composable rather than the View masking API. UI hiding does not redact custom States, Events, screen arguments, Toast text, or network diagnostics.

CorynOverscrollFactoryWrapper​

Signature
@Composable
fun CorynOverscrollFactoryWrapper(content: @Composable () -> Unit)

Track the effective LocalOverscrollFactory for content that contains hidden Composables while preserving the supplied effect. Place the wrapper inside the Theme or custom factory provider affecting the hidden content. Wrap again inside nested factory overrides, including Dialogs or Popups that supply their own factory. A null factory disables overscroll and does not require wrapping.

Kotlin usage
AppTheme {
CorynOverscrollFactoryWrapper {
AppContent()
}
}

A hidden Composable using an untracked non-null factory triggers a recording-critical integration error and cancels recording. See Privacy Masking - Compose for placement examples and overscroll options for recording options.