intercept

public final Unit intercept(Function1<Interceptor.Configurator, Unit> configurator)

Sets the interceptors for the screen. Interceptors will be invoked on all interactions while the screen is active.

The screen is considered active when it is invoked in one of the following ways:

val screen = SomeScreen()

screen { // Active
view { click() }
...
} // Inactive

// OR

onScreen<SomeScreen>() { // Active
view { click() }
...
} // Inactive

If you use nesting screens, all interceptors of the screens that became active will be invoked in LIFO order (using Deque).

Parameters

configurator

Configuration of the interceptors

See also