ImageCreator

open class ImageCreator : NodeCreator<BannerComponentNode, ImageVerifier>

Utility class that can be used to load a given 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

Functions

initialize
Link copied to clipboard
open fun initialize(context: Context)
Must be called before loading images.
isNodeType
Link copied to clipboard
open fun isNodeType(bannerComponents: BannerComponents): Boolean
postProcess
Link copied to clipboard
open fun postProcess(textView: TextView, bannerComponentNodes: List<BannerComponentNode>)
Coordinators which make edits to the text after it's been populated into the text view shouldoverride this method.
open fun postProcess(textView: TextView, bannerComponentNodes: List<BannerComponentNode>)
Coordinators which make edits to the text after it's been populated into the text view shouldoverride this method.
prefetchImageCache
Link copied to clipboard
open fun prefetchImageCache(legStep: LegStep)
Will pre-fetch images for a given LegStep.
preProcess
Link copied to clipboard
open fun preProcess(textView: TextView, bannerComponentNodes: List<BannerComponentNode>)
One coordinator should override this method, and this should be the coordinator which populatesthe textView with text.
setupNode
Link copied to clipboard
open fun setupNode(components: BannerComponents, index: Int, startIndex: Int, modifier: String): BannerComponentNode
abstract fun setupNode(components: BannerComponents, index: Int, startIndex: Int, modifier: String): N
shutdown
Link copied to clipboard
open fun shutdown()

Properties

instance
Link copied to clipboard
private open val instance: ImageCreator