FrameManager

object FrameManager
kotlin.Any
   ↳ androidx.compose.FrameManager

The frame manager manages the priority frame in the main thread.

Once the FrameManager has started there is always an open frame in the main thread. If a model object is committed in any frame then the frame manager schedules the current frame to commit with the Choreographer and a new frame is open. Any model objects read during composition are recorded in an invalidations map. If they are mutated during a frame the recompose scope that was active during the read is invalidated.

Summary

Public methods

Unit

T
framed(block: () -> T)

Ensure that block is executed in a frame.

T
isolated(block: () -> T)

Unit

T
unframed(block: () -> T)

Public methods

ensureStarted

fun ensureStarted(): Unit

framed

fun <T> framed(block: () -> T): T

Ensure that block is executed in a frame. If the code is not in a frame create one for the code to run in that is committed when block commits.

isolated

@TestOnly fun <T> isolated(block: () -> T): T

nextFrame

fun nextFrame(): Unit

unframed

@TestOnly fun <T> unframed(block: () -> T): T