The Developer Preview for Android 11 is now available; test it out and share your feedback.

CompositionContext

class CompositionContext
kotlin.Any
   ↳ androidx.compose.CompositionContext

Summary

Public methods

Unit

Boolean

Recomposes any changes without forcing the component to compose and blocks until composition completes.

Companion functions

CompositionContext
prepare(context: Context, root: Any, component: Component, compositionReference: CompositionReference?)

CompositionContext
prepare(component: Component, ambientReference: CompositionReference?, makeComposer: Recomposer.() -> Composer<*>)

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Properties

Component

Composer<*>

Public methods

compose

fun compose(): Unit

recomposeSync

fun recomposeSync(): Boolean

Recomposes any changes without forcing the component to compose and blocks until composition completes.

Return
true if there were pending changes, false otherwise.

Properties

component

val component: Component

composer

val composer: Composer<*>

Companion functions

prepare

fun prepare(
    context: Context,
    root: Any,
    component: Component,
    compositionReference: CompositionReference?
): CompositionContext

prepare

fun prepare(
    component: Component,
    ambientReference: CompositionReference?,
    makeComposer: Recomposer.() -> Composer<*>
): CompositionContext