Google is committed to advancing racial equity for Black communities. See how.

androidx.compose.runtime

Interfaces

Applier

An Applier is responsible for applying the tree-based operations that get emitted during a composition.

CommitScope

A CommitScope represents an object that executes some code and has a cleanup in the context of the Composition lifecycle.

Composition

A composition object is usually constructed for you, and returned from an API that is used to initially compose a UI.

CompositionLifecycleObserver

Objects implementing this interface are notified when they are initially used in a composition and when they are no longer being used.

DisposableEffectDisposable

EmbeddingContext

MutableState

A mutable value holder where reads to the value property during the execution of a Composable function, the current RecomposeScope will be subscribed to changes of that value.

ProduceStateScope

Receiver scope for use with produceState.

ScopeUpdateScope

Internal compose compiler plugin API that is used to update the function the composer will call to recompose a recomposition scope.

SnapshotMutationPolicy

A policy to control how the result of mutableStateOf report and merge changes to the state object.

State

A value holder where reads to the value property during the execution of a Composable function, the current RecomposeScope will be subscribed to changes of that value.

Classes

AbstractApplier

An abstract Applier implementation that builds the tree "top down".

Ambient

Compose passes data through the composition tree explicitly through means of parameters to composable functions.

Anchor

An Anchor tracks a groups as its index changes due to other groups being inserted and removed before it.

Composer

Implementation of a composer for mutable tree.

CompositionReference

A CompositionReference is an opaque type that is used to logically "link" two compositions together.

DisposableEffectScope

Receiver scope for DisposableEffect that offers the onDispose clause that should be the last statement in any call to DisposableEffect.

KeyInfo

Information about groups and their keys.

ObserverMap

A map from a key to a set of values used for keeping the relation between some entities and a models changes of which this entities are observing.

ProvidableAmbient

A ProvidableAmbient can be used in Providers to provide values.

ProvidedValue

An instance to hold a value provided by Providers and is created by the ProvidableAmbient.provides infixed operator.

Recomposer

The scheduler for performing recomposition and applying updates to one or more Compositions.

Reference

ReferenceQueue

SkippableUpdater

SlotReader

A reader of a slot table.

SlotTable

SlotWriter

The writer for a slot table.

Updater

WeakHashMap

WeakReference

Annotations

CheckResult

Composable

Composable functions are the fundamental building blocks of an application built with Compose.

ComposableContract

This annotation can be applied to Composable functions and provide metadata to the compiler that imply compose-specific contracts that the author of the function is guaranteeing the function complies with.

ComposeCompilerApi

ExperimentalComposeApi

Immutable

Immutable can be used to mark class as producing immutable instances.

InternalComposeApi

MainThread

NoLiveLiterals

This annotation is used to indicate to the Compose Compiler to not attempt to generate live literals inside the scope of the declaration it is applied to, even when the live literals code generation is turned on.

Stable

Stable is used to communicate some guarantees to the compose compiler about how a certain type or function will behave.

StableMarker

StableMarker marks an annotation as indicating a type is stable.

TestOnly

UnionType

Top-level functions summary

Unit

Unit

A side effect of composition that must run for any new unique value of subject and must be reversed or cleaned up if subject changes or if the DisposableEffect leaves the composition.

Unit
DisposableEffect(subject1: Any?, subject2: Any?, effect: DisposableEffectScope.() -> DisposableEffectDisposable)

A side effect of composition that must run for any new unique value of subject1 or subject2 and must be reversed or cleaned up if subject1 or subject2 changes, or if the DisposableEffect leaves the composition.

Unit
DisposableEffect(subject1: Any?, subject2: Any?, subject3: Any?, effect: DisposableEffectScope.() -> DisposableEffectDisposable)

A side effect of composition that must run for any new unique value of subject1, subject2 or subject3 and must be reversed or cleaned up if subject1, subject2 or subject3 changes, or if the DisposableEffect leaves the composition.

Unit

A side effect of composition that must run for any new unique value of subjects and must be reversed or cleaned up if any subjects change or if the DisposableEffect leaves the composition.

actual EmbeddingContext

Unit
LaunchedEffect(block: suspend CoroutineScope.() -> Unit)

When LaunchedEffect enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedEffect(subject: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedEffect enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedEffect(subject1: Any?, subject2: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedEffect enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedEffect(subject1: Any?, subject2: Any?, subject3: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedEffect enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedEffect(vararg subjects: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedEffect enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedTask(block: suspend CoroutineScope.() -> Unit)

When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedTask(key: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedTask(key1: Any?, key2: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedTask(key1: Any?, key2: Any?, key3: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext.

Unit
LaunchedTask(vararg keys: Any?, block: suspend CoroutineScope.() -> Unit)

When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext.

Unit
Providers(vararg values: ProvidedValue<*>, content: () -> Unit)

Providers binds values to ProvidableAmbient keys.

Unit
SideEffect(effect: () -> Unit)

Schedule effect to run when the current composition completes successfully and applies changes.

ProvidableAmbient<T>
ambientOf(policy: SnapshotMutationPolicy<T> = @OptIn(ExperimentalComposeApi::class) structuralEqualityPolicy(), defaultFactory: () -> T = null)

Create an ambient key that can be provided using Providers.

Composition
compositionFor(key: Any, applier: Applier<*>, parent: CompositionReference, onCreated: () -> Unit = {})

This method is the way to initiate a composition.

CompositionReference

An Effect to construct a CompositionReference at the current point of composition.

State<T>
derivedStateOf(calculation: () -> T)

Creates a State object whose State.value is the result of calculation.

Unit
emit(noinline ctor: () -> T, update: Updater<T>.() -> Unit)

Emits a node into the composition of type T.

Unit
emit(noinline ctor: () -> T, update: Updater<T>.() -> Unit, content: () -> Unit)

Emits a node into the composition of type T.

Unit
emit(noinline ctor: () -> T, update: Updater<T>.() -> Unit, noinline skippableUpdate: SkippableUpdater<T>.() -> Unit, content: () -> Unit)

() -> Unit

Represents empty content for a Composable function.

Boolean

Any?

Any?

T
key(vararg inputs: Any?, block: () -> T)

key is a utility composable that is used to "group" or "key" a block of execution inside of a composition.

actual String?

SnapshotStateList<T>

Create a instance of MutableList that is observable and can be snapshot.

SnapshotStateList<T>
mutableStateListOf(vararg elements: T)

Create an instance of MutableList that is observable and can be snapshot.

SnapshotStateMap<K, V>

Create a instance of MutableSet<K, V> that is observable and can be snapshot.

SnapshotStateMap<K, V>
mutableStateMapOf(vararg pairs: Pair<K, V>)

Create a instance of MutableMap<K, V> that is observable and can be snapshot.

MutableState<T>
mutableStateOf(value: T, policy: SnapshotMutationPolicy<T> = structuralEqualityPolicy())

Return a new MutableState initialized with the passed in value

SnapshotMutationPolicy<T>

A policy never treat values of a MutableState as equivalent.

Unit
onActive(callback: CommitScope.() -> Unit)

An effect used to observe the lifecycle of the composition.

Unit
onCommit(noinline callback: CommitScope.() -> Unit)

The onCommit effect is a lifecycle effect that will execute