preFillBitmapPool

open fun preFillBitmapPool(bitmapAttributeBuilders: Array<PreFillType.Builder>)

Pre-fills the BitmapPool using the given sizes.

Enough Bitmaps are added to completely fill the pool, so most or all of the Bitmaps currently in the pool will be evicted. Bitmaps are allocated according to the weights of the given sizes, where each size gets (weight / prefillWeightSum) percent of the pool to fill.

Note - Pre-filling is done asynchronously using and IdleHandler. Any currently running pre-fill will be cancelled and replaced by a call to this method.

This method should be used with caution, overly aggressive pre-filling is substantially worse than not pre-filling at all. Pre-filling should only be started in onCreate to avoid constantly clearing and re-filling the BitmapPool. Rotation should be carefully considered as well. It may be worth calling this method only when no saved instance state exists so that pre-filling only happens when the Activity is first created, rather than on every rotation.

Parameters

bitmapAttributeBuilders

The list of Builders representing individual sizes and configurations of Bitmaps to be pre-filled.