Custom Views & Drawables Overview
Primitive Components are used to render views or drawables, and should only be created when you need to integrate your own views/drawables with Litho.
The Primitive Components section contains the following pages:
- Creating a Primitive Component - details how to create a Primitive Component responsible for rendering a View or Drawable. Also, compares Primitive Components with KComponents.
- Lifecycle of a Primitive - covers the purpose and creation of a Primitive in addition to how to create and mount its content.
- Measuring - shows different strategies to measure the content the Primitive Component will render.
- Controllers Pattern - illustrates the use of controllers by implementing a simple TimePicker that shows an arbitrary time.
- Content Pooling - details a strategy that can be used to populate the content pools to optimise first mount performance.
- Tracing - shows how to customize performance tracing information for Primitive Components.
info
Primitive Components provide the building blocks for creating components that render native Android Views or Drawables.
If you have existing MountSpec components, see Migrating MountSpecs for migration guidance.