ContentT- The type of the content.
public interface Mountable<ContentT>
Mountablemust define what content it creates, and its type. It should also implement a mechanism to measure itself given arbitrary width and height specs. A
Mountablecan also specify a collection of Binders to set and unset properties on the content.
This interface is abstraction of [RenderUnit].
Mountablemust only create one type of content.
Mountablemust be immutable.
Equivalenceto improve performance.
|Modifier and Type||Method and Description|
Creates new mountable content when called.
A list of
Specifies if the content type is
Given a and set the width and height this Mountable will require in .
ContentT createContent(Context context)
context- The Android context.
java.lang.Object measure(ComponentContext context, int widthSpec, int heightSpec, Size size, java.lang.Object previousLayoutData)
If measure is called again in the same layout pass, then will be the layout data returned by the previous measure call.
As a performance optimisation the framework will skip this method if this Mountable is equal
to the previous Mountable, and if the size specs are compatible. In order to do this the
framework will check if every field of the Mountable is equal using reflection. It is highly
recommended to implement
Equivalence to avoid using the reflection based equivalence