TtImageLoaderInterceptor
Simplifies testing of remotely downloaded images.
When using either RemoteDrawable or TtImageLoader directly, this class by default will immediately and synchronously complete the retrieval of Uris referring to locally resolvable Drawables. When a placeholder is set and the Uri cannot be instantly resolved, it is loaded directly as if it is a locally resolvable Drawable.
Any other types of requests that cannot be resolve synchronously, such as content provider URIs or internet URIs, will by default complete successfully and return R.drawable.tt_test_default_remote_drawable.
Use resolveUri and failUri to override this behavior and respectively choose a custom drawable to load, or make the request fail.
Functions
Intercept any requests to load uri, failing their resolution and causing TtImageLoader to either display the placeholder if set, or the error image if set, or nothing.
Remove all interception rules previously defined with resolveUri and failUri.
Start intercepting requests for TtImageLoader.
Restore the normal TtImageLoader behavior.