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

Recomposer

abstract class Recomposer
kotlin.Any
   ↳ androidx.compose.Recomposer

Summary

Public constructors

Public methods

abstract Unit

Used to recompose changes from scheduleChangesDispatch immediately without waiting.

Protected methods

Unit

abstract Unit

Companion functions

Recomposer

Retrieves Recomposer for the current thread.

Boolean

Check if any composer in this thread has invalid ranges .

Boolean

Check if there's pending changes to be recomposed in this thread

Public constructors

<init>

Recomposer()

Public methods

recomposeSync

@TestOnly abstract fun recomposeSync(): Unit

Used to recompose changes from scheduleChangesDispatch immediately without waiting.

This is supposed to be used in tests only.

Protected methods

dispatchRecomposes

protected fun dispatchRecomposes(): Unit

scheduleChangesDispatch

protected abstract fun scheduleChangesDispatch(): Unit

Companion functions

current

@TestOnly fun current(): Recomposer

Retrieves Recomposer for the current thread. Needs to be the main thread.

hasInvalidations

@TestOnly fun hasInvalidations(): Boolean

Check if any composer in this thread has invalid ranges . This is more expensive than hasPendingChanges and should only be called when hasPendingChanges returns true to validate that the pending change has work to do.

Return
true if any recomposer has invalid ranges.

hasPendingChanges

fun hasPendingChanges(): Boolean

Check if there's pending changes to be recomposed in this thread

Return
true if there 're pending changes in this thread, false otherwise

See Also