Interface

SurfaceScope

SurfaceScope is a scoped environment provided by AndroidExternalSurface and AndroidEmbeddedExternalSurface to handle Surface lifecycle events.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
interface SurfaceScope

SurfaceScope is a scoped environment provided by AndroidExternalSurface and AndroidEmbeddedExternalSurface to handle Surface lifecycle events.

Functions

onChanged

fun Surface.onChanged(onChanged: Surface.(width: Int, height: Int) -> Unit)

Invokes onChanged when the surface's geometry (width and height) changes. Always invoked on the main thread.


onDestroyed

fun Surface.onDestroyed(onDestroyed: Surface.() -> Unit)

Invokes onDestroyed when the surface is destroyed. All rendering into the surface should stop immediately after onDestroyed is invoked. Always invoked on the main thread.