-
- All Implemented Interfaces:
-
com.facebook.react.bridge.LifecycleEventListener
,com.facebook.react.bridge.NativeModule
,com.facebook.react.modules.common.ModuleDataCleaner.Cleanable
,com.facebook.react.turbomodule.core.interfaces.TurboModule
public class FrescoModule extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable, LifecycleEventListener, TurboModule
Module to initialize the Fresco library.
Does not expose any methods to JavaScript code. For initialization and cleanup only.
-
-
Constructor Summary
Constructors Constructor Description FrescoModule(ReactApplicationContext reactContext)
Create a new Fresco module with a default configuration (or the previously given configurationvia FrescoModule. FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy)
Create a new Fresco module with a default configuration (or the previously given configurationvia FrescoModule. FrescoModule(ReactApplicationContext reactContext, ImagePipeline imagePipeline, boolean clearOnDestroy)
Create a new Fresco module with a default configuration (or the previously given configurationvia FrescoModule. FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy, ImagePipelineConfig config)
Create a new Fresco module with a given ImagePipelineConfig.
-
Method Summary
Modifier and Type Method Description void
initialize()
This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules. String
getName()
void
clearSensitiveData()
static boolean
hasBeenInitialized()
Check whether the FrescoModule has already been initialized. static ImagePipelineConfig.Builder
getDefaultConfigBuilder(ReactContext context)
Get the default Fresco configuration builder. 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. void
invalidate()
The CatalystInstance is going away with Venice. -
-
Constructor Detail
-
FrescoModule
FrescoModule(ReactApplicationContext reactContext)
Create a new Fresco module with a default configuration (or the previously given configurationvia FrescoModule.- Parameters:
reactContext
- the context to use
-
FrescoModule
FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy)
Create a new Fresco module with a default configuration (or the previously given configurationvia FrescoModule.- Parameters:
reactContext
- the context to useclearOnDestroy
- whether to clear the memory cache in onHostDestroy: this should be{@code * true}
for pure RN apps and{@code false}
for apps that use Fresco outside of RN as well
-
FrescoModule
FrescoModule(ReactApplicationContext reactContext, ImagePipeline imagePipeline, boolean clearOnDestroy)
Create a new Fresco module with a default configuration (or the previously given configurationvia FrescoModule.- Parameters:
reactContext
- the context to useclearOnDestroy
- whether to clear the memory cache in onHostDestroy: this should be{@code * true}
for pure RN apps and{@code false}
for apps that use Fresco outside of RN as well
-
FrescoModule
FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy, ImagePipelineConfig config)
Create a new Fresco module with a given ImagePipelineConfig.- Parameters:
reactContext
- the context to useclearOnDestroy
- whether to clear the memory cache in onHostDestroy: this should be{@code * true}
for pure RN apps and{@code false}
for apps that use Fresco outside of RN as wellconfig
- the Fresco configuration, which will only be used for the first initialization
-
-
Method Detail
-
initialize
void initialize()
This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules.
-
clearSensitiveData
void clearSensitiveData()
-
hasBeenInitialized
static boolean hasBeenInitialized()
Check whether the FrescoModule has already been initialized. If this is the case, Calls to FrescoModule will ignore the givenconfiguration.
-
getDefaultConfigBuilder
static ImagePipelineConfig.Builder getDefaultConfigBuilder(ReactContext context)
Get the default Fresco configuration builder. Allows adding of configuration options inaddition to the default values.
-
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.
-
invalidate
void invalidate()
The CatalystInstance is going away with Venice. Therefore, the TurboModule infra introduces theinvalidate() method to allow NativeModules to clean up after themselves.
-
-
-
-