public interface ContentAllocator<Content>
Instances must implement at least createContent method to allocate the RenderUnit content (View or Drawable).
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_PREALLOCATION
Default size of the content pool.
|
Modifier and Type | Method and Description |
---|---|
default boolean |
canPreallocate()
This API informs the framework to fill the content pool for this Mountable ahead of time.
|
Content |
createContent(Context context)
Allocates the mountable content (View or Drawable).
|
default Content |
createPoolableContent(Context context)
Creates a mount-content that can be pooled.
|
default MountItemsPool.ItemPool |
createRecyclingPool()
Creates an ItemPool for this mountable content.
|
default java.lang.Object |
getPoolableContentType()
Returns an object defining the type of the mount-content.
|
default boolean |
isRecyclingDisabled()
Return true if pooling should be disabled for this mount content.
|
default MountItemsPool.ItemPool |
onCreateMountContentPool()
Creates the content pool the framework should use for this Mountable.
|
default int |
poolSize()
This API informs the framework about the size of the content pool.
|
static final int DEFAULT_MAX_PREALLOCATION
Content createContent(Context context)
default Content createPoolableContent(Context context)
default java.lang.Object getPoolableContentType()
default boolean isRecyclingDisabled()
default MountItemsPool.ItemPool createRecyclingPool()
default boolean canPreallocate()
false
, i.e. content is not pre-allocated. Pre-allocation of the
content can improve performance in some circumstances where creating the content is expensive.true
to preallocate the content, otherwise false
Experimental. Currently for Litho team internal use only.
default int poolSize()
Experimental. Currently for Litho team internal use only.
default MountItemsPool.ItemPool onCreateMountContentPool()
Experimental. Currently for Litho team internal use only.