Owner

interface Owner
androidx.ui.core.Owner

Owner implements the connection to the underlying view system. On Android, this connects to Android android.view.Views and all layout, draw, input, and accessibility is hooked through them.

Summary

Public methods

abstract IntPxPosition

Returns the most global position of the owner that Compose can access (such as the device screen).

abstract Unit

Observing the model reads can be temporary disabled.

abstract Unit

Called by ComponentNode when it is attached to the view system and now has an owner.

abstract Unit

Called by ComponentNode when it is detached from the view system, such as during ComponentNode.emitRemoveAt.

abstract Unit
onEndLayout(layoutNode: LayoutNode)

Called when layout (placement) ends.

abstract Unit
onEndMeasure(layoutNode: LayoutNode)

Called when measure ends.

abstract Unit

Called from a DrawNode, this registers with the underlying view system that a redraw of the given drawNode is required.

abstract Unit

Called by LayoutNode to indicate the new position of layoutNode.

abstract Unit

Called when some params of RepaintBoundaryNode are updated.

abstract Unit

Called by LayoutNode to request the Owner a new measurement+layout.

abstract Unit
onSizeChange(layoutNode: LayoutNode)

Called by LayoutNode to indicate the new size of layoutNode.

abstract Unit

Called when layout (placement) starts.

abstract Unit

Called when measure starts.

Properties

abstract Density

abstract Long

Public methods

calculatePosition

abstract fun calculatePosition(): IntPxPosition

Returns the most global position of the owner that Compose can access (such as the device screen).

enableModelReadObserving

abstract fun enableModelReadObserving(enabled: Boolean): Unit

Observing the model reads can be temporary disabled. For example if we are currently within the measure stage and we want some code block to be skipped from the observing we disable if before calling the block, execute block and then enable it again.

onAttach

abstract fun onAttach(node: ComponentNode): Unit

Called by ComponentNode when it is attached to the view system and now has an owner. This is used by Owner to update ComponentNode.ownerData and track which nodes are associated with it. It will only be called when node is not already attached to an owner.

onDetach

abstract fun onDetach(node: ComponentNode): Unit

Called by ComponentNode when it is detached from the view system, such as during ComponentNode.emitRemoveAt. This will only be called for nodes that are already ComponentNode.attached.

onEndLayout

abstract fun onEndLayout(layoutNode: LayoutNode): Unit

Called when layout (placement) ends.

onEndMeasure

abstract fun onEndMeasure(layoutNode: LayoutNode): Unit

Called when measure ends.

onInvalidate

abstract fun onInvalidate(drawNode: DrawNode): Unit

Called from a DrawNode, this registers with the underlying view system that a redraw of the given drawNode is required. It may cause other nodes to redraw, if necessary.

onPositionChange

abstract fun onPositionChange(layoutNode: LayoutNode): Unit

Called by LayoutNode to indicate the new position of layoutNode. The owner may need to track updated layouts.

onRepaintBoundaryParamsChange

abstract fun onRepaintBoundaryParamsChange(repaintBoundaryNode: RepaintBoundaryNode): Unit

Called when some params of RepaintBoundaryNode are updated. This is not causing re-recording of the RepaintBoundary, but updates params like outline, clipping, elevation or alpha.

onRequestMeasure

abstract fun onRequestMeasure(layoutNode: LayoutNode): Unit

Called by LayoutNode to request the Owner a new measurement+layout.

onSizeChange

abstract fun onSizeChange(layoutNode: LayoutNode): Unit

Called by LayoutNode to indicate the new size of layoutNode. The owner may need to track updated layouts.

onStartLayout

abstract fun onStartLayout(layoutNode: LayoutNode): Unit

Called when layout (placement) starts.

onStartMeasure

abstract fun onStartMeasure(layoutNode: LayoutNode): Unit

Called when measure starts.

Properties

density

abstract val density: Density

measureIteration

abstract val measureIteration: Long