interface ViewfinderInitScope


A scoped environment provided when a Viewfinder is first initialized.

The environment can be used to register a lambda to invoke when a new ViewfinderSurfaceSessionScope is available.

Summary

Public functions

Unit

Registers a callback to be invoked when a new ViewfinderSurfaceSessionScope is created.

Public functions

onSurfaceSession

Added in 1.5.0-beta01
fun onSurfaceSession(block: suspend ViewfinderSurfaceSessionScope.() -> Unit): Unit

Registers a callback to be invoked when a new ViewfinderSurfaceSessionScope is created.

The provided callback will be invoked each time a new ViewfinderSurfaceSessionScope is available. If a new ViewfinderSurfaceSessionScope is available, the previous one will be cancelled before block is invoked with the new one.

The provided callback will always be invoked from the main thread.