An example of how to write a custom implementation of a custom view’s
Builds on the previous lesson’s four example layouts with the
TimerView from the first lesson to improve and correct the layout behavior. Iterates through the
onMeasure() implementation to show different approaches and the different factors coming into play when trying to build flexible and adaptable measurement logic.
In this episode you will learn:
- How to override the
onMeasure()method with custom logic.
- What factors might affect the measurement of views.
- How to estimate text size as part of the measurement of views.
- How to reconcile measured view content with layout parameters and parent constraints.
- How to incorporate padding into measurement calculations.