ComputedViewSize
Represents computed size information for a View during the layout process.
This class is used internally by the View system to pass sizing constraints and computed dimensions between parent and child views during layout calculations. It supports object pooling for performance optimization.
The NO_SIZE constant indicates that a dimension has not been computed or constrained.
Static Members
Sentinel value indicating that a size dimension has not been set or computed. This special value is used to distinguish unset dimensions from zero dimensions.
Gets a ComputedViewSize instance from the object pool. The instance is reset to default values before being returned.
Returns | Description |
---|---|
ComputedViewSize | A reset ComputedViewSize instance ready for use |
Instance Members
The layout mask from the parent view, indicating sizing constraints. Determines how the child view should calculate its dimensions. Default is FLEXIBLE.
The width constraint from the parent view. May be NO_SIZE if no width constraint is imposed.
The height constraint from the parent view. May be NO_SIZE if no height constraint is imposed.
The computed width for the view after layout calculation. Set by the view during its computeSize phase.
The computed height for the view after layout calculation. Set by the view during its computeSize phase.
Special computed width for content fitting scenarios. Used by views like TextView that need to calculate their ideal width based on content before applying constraints.
Returns this instance to the object pool for reuse. Should be called when the instance is no longer needed.
new(?parentLayoutMask: Null<ViewLayoutMask>, ?parentWidth: Null<Float>, ?parentHeight: Null<Float>, ?computedWidth: Null<Float>, ?computedHeight: Null<Float>, ?computedFitWidth: Null<Float>): Void
Name | Type | Default | Description |
---|---|---|---|
parentLayoutMask |
Null<ViewLayoutMask> | (optional) | * The layout mask from the parent view, indicating sizing constraints. Determines how the child view should calculate its dimensions. Default is FLEXIBLE. |
parentWidth |
Null<Float> | (optional) | * The width constraint from the parent view. May be NO_SIZE if no width constraint is imposed. |
parentHeight |
Null<Float> | (optional) | * The height constraint from the parent view. May be NO_SIZE if no height constraint is imposed. |
computedWidth |
Null<Float> | (optional) | * The computed width for the view after layout calculation. Set by the view during its computeSize phase. |
computedHeight |
Null<Float> | (optional) | * The computed height for the view after layout calculation. Set by the view during its computeSize phase. |
computedFitWidth |
Null<Float> | (optional) | * Special computed width for content fitting scenarios. Used by views like TextView that need to calculate their ideal width based on content before applying constraints. |
Private Members
Metadata
Name | Parameters |
---|---|
:structInit |
- |