Images Setup
Currently, the images plugin only supports Fresco for Android as backend, but just like the network plugin, support for other image loading libraries could easily be added. Send us a PR!
Fresco and Android
The Fresco images plugin is shipped as a separate Maven artifact:
After including the plugin in your dependencies, you can add it to the client:
The FrescoFlipperPlugin
constructor offers a whole lot of configuration options which
can be useful if you have an advanced setup of Fresco in your application:
Leak Tracking
The Flipper plugin can help you track down CloseableReferences
who have not had
close()
called on them. This can have a negative impact on the performance of
your application.
To enable this functionality, you need to create a CloseableReferenceLeakTracker
and set it in both your ImagePipelineConfig
for Fresco and the FrescoPluginPlugin
on creation.
Attribution
In order to annotate images with the context they are used in, you have to set a caller context when loading the image. This can be any object, so for the simplest case, a String will suffice.
If a caller context is supplied, the image will be properly attributed in the Flipper image plugin.