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

ViewComposer

class ViewComposer : Composer<Any>
kotlin.Any
   ↳ androidx.compose.Composer<kotlin.Any>
   ↳ androidx.compose.ViewComposer

Summary

Public constructors

<init>(context: Context, root: Any, slotTable: SlotTable, recomposer: Recomposer, adapters: ViewAdapters? = ViewAdapters())

Public methods

Unit
emit(key: Any, ctor: (context: Context) -> T, update: ViewUpdater<T>.() -> Unit)

Unit
emit(key: Any, ctor: (context: Context) -> T, update: ViewUpdater<T>.() -> Unit, children: () -> Unit)

Unit
emit(key: Any, ctor: () -> T, update: ViewUpdater<T>.() -> Unit)

Unit
emit(key: Any, ctor: () -> T, update: ViewUpdater<T>.() -> Unit, children: () -> Unit)

Inherited functions

Extension functions

From androidx.compose
Boolean?
ViewComposer.registerAdapter(adapter: (parent: Any, child: Any) -> Any?)

Inherited extension functions

From androidx.compose
T
Composer<N>.cache(valid: Boolean = true, block: () -> T)

Cache a value in the composition.

Any?

Get the next value of the slot table.

actual T
Composer<*>.runWithComposing(block: () -> T)

Properties

ViewAdapters?

Context

Any

Inherited properties

Public constructors

<init>

ViewComposer(
    context: Context,
    root: Any,
    slotTable: SlotTable,
    recomposer: Recomposer,
    adapters: ViewAdapters? = ViewAdapters())

Public methods

emit

inline fun <T : View> emit(
    key: Any,
    ctor: (context: Context) -> T,
    update: ViewUpdater<T>.() -> Unit
): Unit

emit

inline fun <T : ViewGroup> emit(
    key: Any,
    ctor: (context: Context) -> T,
    update: ViewUpdater<T>.() -> Unit,
    children: () -> Unit
): Unit

emit

inline fun <T : Emittable> emit(
    key: Any,
    ctor: () -> T,
    update: ViewUpdater<T>.() -> Unit
): Unit

emit

inline fun <T : Emittable> emit(
    key: Any,
    ctor: () -> T,
    update: ViewUpdater<T>.() -> Unit,
    children: () -> Unit
): Unit

Properties

adapters

val adapters: ViewAdapters?

context

val context: Context

root

val root: Any