public class ImageCreator
extends java.lang.Object
BannerText
into the provided
TextView
.
For each BannerComponents
, either the text or given shield URL will be used (the shield
URL taking priority).
If a shield URL is found, Picasso
is used to load the image. Then, once the image is loaded,
a new ImageSpan
is created and set to the appropriate position of the Spannable
Modifier and Type | Method and Description |
---|---|
static ImageCreator |
getInstance()
Primary access method (using singleton pattern)
|
void |
initialize(android.content.Context context)
Must be called before loading images.
|
void |
prefetchImageCache(com.mapbox.api.directions.v5.models.LegStep legStep)
Will pre-fetch images for a given
LegStep . |
void |
shutdown() |
public static ImageCreator getInstance()
public void initialize(android.content.Context context)
Initializes a new Picasso
instance as well as the
ArrayList
of InstructionTarget
.
context
- to init Picassopublic void prefetchImageCache(com.mapbox.api.directions.v5.models.LegStep legStep)
LegStep
.
If loaded successfully, this will allow the images to be displayed
without delay in the InstructionView
.
legStep
- providing the image Urlspublic void shutdown()