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

AndroidOwner

interface AndroidOwner : Owner
androidx.compose.ui.platform.AndroidOwner

Interface to be implemented by Owners able to handle Android View specific functionality.

Summary

Nested classes

Combines objects populated via ViewTree*Owner

Public methods
abstract Unit

Called to inform the owner that a new Android View was attached to the hierarchy.

abstract Unit

Called to ask the owner to draw a child Android View to canvas.

abstract Unit

Called to invalidate the Android View sub-hierarchy handled by this Owner.

abstract Unit

Called to inform the owner that an Android View was detached from the hierarchy.

abstract Unit

The callback to be executed when viewTreeOwners is created and not-null anymore.

Inherited functions
Properties
abstract (Configuration) -> Unit

Used for updating the ConfigurationAmbient when configuration changes - consume the configuration ambient instead of changing this observer if you are writing a component that adapts to configuration changes.

abstract View

The view backing this Owner.

abstract AndroidOwner.ViewTreeOwners?

Current ViewTreeOwners.

Inherited properties

Public methods

addAndroidView

abstract fun addAndroidView(
    view: AndroidViewHolder,
    layoutNode: LayoutNode
): Unit

Called to inform the owner that a new Android View was attached to the hierarchy.

drawAndroidView

abstract fun drawAndroidView(
    view: AndroidViewHolder,
    canvas: Canvas
): Unit

Called to ask the owner to draw a child Android View to canvas.

invalidateDescendants

abstract fun invalidateDescendants(): Unit

Called to invalidate the Android View sub-hierarchy handled by this Owner.

removeAndroidView

abstract fun removeAndroidView(view: AndroidViewHolder): Unit

Called to inform the owner that an Android View was detached from the hierarchy.

setOnViewTreeOwnersAvailable

abstract fun setOnViewTreeOwnersAvailable(callback: (AndroidOwner.ViewTreeOwners) -> Unit): Unit

The callback to be executed when viewTreeOwners is created and not-null anymore. Note that this callback will be fired inline when it is already available

Properties

configurationChangeObserver

abstract var configurationChangeObserver: (Configuration) -> Unit

Used for updating the ConfigurationAmbient when configuration changes - consume the configuration ambient instead of changing this observer if you are writing a component that adapts to configuration changes.

view

abstract val view: View

The view backing this Owner.

viewTreeOwners

abstract val viewTreeOwners: AndroidOwner.ViewTreeOwners?

Current ViewTreeOwners. Use setOnViewTreeOwnersAvailable if you want to execute your code when the object will be created.