OnCreateMountContent
The method annotated with this annotation will be called to instantiate the mount content for the MountSpec, when the pool of objects corresponding to this mount content type is empty and recycling is not possible. The mount content can be either a View or a Drawable.
You can think of methods annotated with OnCreateMountContent
as the equivalent of the RecyclerView.Adapter's createViewHolder method. If the pool for this mount content is not empty and the framework can recycle mount content objects, this method will not be invoked.
The annotated method will return the created mount content, either a View or a Drawable type, and receives the following arguments from the framework:
Required:
- ComponentContext
The OnCreateMountContent method cannot provide inter-stage props.