Layouting in Android

The layouting cycle (measure and arrange) in Uno on Android involves a complex interaction between Android UI framework methods and Uno methods. These interactions are summarized in the diagram below. This information is primarily intended to help when debugging Uno, but may be interesting to anyone curious as to how native Android methods are connected to the UWP contract exposed by Uno.

Measure Invalidation
actually calls
set IS_DIRTY
parent: set IS_DIRTY_PATH
internally on parent
on next animation loop
legend
Uno methods
Native (Android) methods
Application/Framework implementation
UI Loop Scheduling
Measure Phase
Arrange Phase
top-level element
IS_DIRTY set
IS_DIRTY_PATH set:
call for children
with previous availableSize
for children (generally)
(return value will set)
x
through OnLayout() override
for children (generally)
ViewRootImpl.PerformTraversal()
ViewRootImpl.PerformMeasure()
View.PerformLayout()
View.Measure()
View.OnMeasure()
(override) FrameworkElement.OnMeasure()
ILayouterElement.DoMeasure()
Layouter.MeasureOverride()
Layouter.MeasureChild()
(override) Element.MeasureOverride()
FrameworkElement.MeasureElement()
Layouter.MeasureChildOverride()
View.Layout()
View.SetMeasuredDimension()
View.OnLayout()
UnoViewGroup.OnLayoutCore() - abstract
(override) FrameworkElement.OnLayoutCore()
Layouter.Arrange()
Layouter.ArrangeOverride()
Element.ArrangeOverride()
FrameworkElement.ArrangeElement(child)
Layouter.ArrangeChild()
Layouter.ArrangeChildOverride()
UIElement.InvalidateArrange()
UIElement.InvalidateMeasure()
View.RequestLayout()
ViewRootImpl.RequestLayout()
ViewRootImpl.ScheduleTraversals()