-
- All Implemented Interfaces:
-
com.facebook.react.bridge.LifecycleEventListener
,com.facebook.react.bridge.NativeModule
,com.facebook.react.bridge.ReactModuleWithSpec
,com.facebook.react.turbomodule.core.interfaces.TurboModule
public class ImageLoaderModule extends NativeImageLoaderAndroidSpec implements LifecycleEventListener
-
-
Constructor Summary
Constructors Constructor Description ImageLoaderModule(ReactApplicationContext reactContext)
ImageLoaderModule(ReactApplicationContext reactContext, Object callerContext)
ImageLoaderModule(ReactApplicationContext reactContext, ImagePipeline imagePipeline, ReactCallerContextFactory callerContextFactory)
-
Method Summary
Modifier and Type Method Description String
getName()
void
getSize(String uriString, Promise promise)
Fetch the width and height of the given image. void
getSizeWithHeaders(String uriString, ReadableMap headers, Promise promise)
Fetch the width and height of the given image with headers. void
prefetchImage(String uriString, double requestIdAsDouble, Promise promise)
Prefetches the given image to the Fresco image disk cache. void
abortRequest(double requestId)
void
queryCache(ReadableArray uris, Promise promise)
void
onHostResume()
Called either when the host activity receives a resume event (e.g. void
onHostPause()
Called when host activity receives pause event (e.g. void
onHostDestroy()
Called when host activity receives destroy event (e.g. -
Methods inherited from class com.facebook.fbreact.specs.NativeImageLoaderAndroidSpec
getSize, getSizeWithHeaders, prefetchImage, queryCache
-
Methods inherited from class com.facebook.react.bridge.BaseJavaModule
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ImageLoaderModule
ImageLoaderModule(ReactApplicationContext reactContext)
-
ImageLoaderModule
ImageLoaderModule(ReactApplicationContext reactContext, Object callerContext)
-
ImageLoaderModule
ImageLoaderModule(ReactApplicationContext reactContext, ImagePipeline imagePipeline, ReactCallerContextFactory callerContextFactory)
-
-
Method Detail
-
getSize
void getSize(String uriString, Promise promise)
Fetch the width and height of the given image.
- Parameters:
uriString
- the URI of the remote image to prefetchpromise
- the promise that is fulfilled when the image is successfully prefetched orrejected when there is an error
-
getSizeWithHeaders
void getSizeWithHeaders(String uriString, ReadableMap headers, Promise promise)
Fetch the width and height of the given image with headers.
- Parameters:
uriString
- the URI of the remote image to prefetchheaders
- headers send with the requestpromise
- the promise that is fulfilled when the image is successfully prefetched orrejected when there is an error
-
prefetchImage
void prefetchImage(String uriString, double requestIdAsDouble, Promise promise)
Prefetches the given image to the Fresco image disk cache.
- Parameters:
uriString
- the URI of the remote image to prefetchrequestIdAsDouble
- the client-supplied request ID used to identify this requestpromise
- the promise that is fulfilled when the image is successfully prefetched orrejected when there is an error
-
abortRequest
void abortRequest(double requestId)
-
queryCache
void queryCache(ReadableArray uris, Promise promise)
-
onHostResume
void onHostResume()
Called either when the host activity receives a resume event (e.g. onResume orif the native module that implements this is initialized while the host activity is alreadyresumed. Always called for the most current activity.
-
onHostPause
void onHostPause()
Called when host activity receives pause event (e.g. onPause. Always calledfor the most current activity.
-
onHostDestroy
void onHostDestroy()
Called when host activity receives destroy event (e.g. onDestroy. Only calledfor the last React activity to be destroyed.
-
-
-
-