public class FrescoModule extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable, LifecycleEventListener
Does not expose any methods to JavaScript code. For initialization and cleanup only.
NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
FrescoModule(ReactApplicationContext reactContext)
Create a new Fresco module with a default configuration (or the previously given configuration
via
FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig). |
FrescoModule(ReactApplicationContext reactContext,
boolean clearOnDestroy)
Create a new Fresco module with a default configuration (or the previously given configuration
via
FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig). |
FrescoModule(ReactApplicationContext reactContext,
boolean clearOnDestroy,
ImagePipelineConfig config)
Create a new Fresco module with a given ImagePipelineConfig.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearSensitiveData() |
static ImagePipelineConfig.Builder |
getDefaultConfigBuilder(ReactContext context)
Get the default Fresco configuration builder.
|
java.lang.String |
getName() |
static boolean |
hasBeenInitialized()
Check whether the FrescoModule has already been initialized.
|
void |
initialize()
This is called at the end of
CatalystApplicationFragment#createCatalystInstance() after
the CatalystInstance has been created, in order to initialize NativeModules that require the
CatalystInstance or JS modules. |
void |
onHostDestroy()
Called when host activity receives destroy event (e.g.
|
void |
onHostPause()
Called when host activity receives pause event (e.g.
|
void |
onHostResume()
Called either when the host activity receives a resume event (e.g.
|
getCurrentActivity, getReactApplicationContextcanOverrideExistingModule, getConstants, hasConstants, invalidate, onCatalystInstanceDestroypublic static final java.lang.String NAME
public FrescoModule(ReactApplicationContext reactContext)
FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig).reactContext - the context to usepublic FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy)
FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig).clearOnDestroy - whether to clear the memory cache in onHostDestroy: this should be true for pure RN apps and false for apps that use Fresco outside of RN as wellreactContext - the context to usepublic FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy, ImagePipelineConfig config)
hasBeenInitialized() to check
this and call FrescoModule(ReactApplicationContext) if it is already initialized.
Otherwise, the given Fresco configuration will be ignored.reactContext - the context to useclearOnDestroy - whether to clear the memory cache in onHostDestroy: this should be true for pure RN apps and false for apps that use Fresco outside of RN as wellconfig - the Fresco configuration, which will only be used for the first initializationpublic void initialize()
NativeModuleCatalystApplicationFragment#createCatalystInstance() after
the CatalystInstance has been created, in order to initialize NativeModules that require the
CatalystInstance or JS modules.initialize in interface NativeModuleinitialize in class BaseJavaModulepublic java.lang.String getName()
getName in interface NativeModulerequire() this module
from javascript.public void clearSensitiveData()
clearSensitiveData in interface ModuleDataCleaner.Cleanablepublic static boolean hasBeenInitialized()
#FrescoModule(ReactApplicationContext, ImagePipelineConfig) will ignore the given
configuration.public static ImagePipelineConfig.Builder getDefaultConfigBuilder(ReactContext context)
ImagePipelineConfig.Builder that has been initialized with default valuespublic void onHostResume()
LifecycleEventListenerActivity#onResume or
if the native module that implements this is initialized while the host activity is already
resumed. Always called for the most current activity.onHostResume in interface LifecycleEventListenerpublic void onHostPause()
LifecycleEventListenerActivity#onPause. Always called
for the most current activity.onHostPause in interface LifecycleEventListenerpublic void onHostDestroy()
LifecycleEventListenerActivity#onDestroy. Only called
for the last React activity to be destroyed.onHostDestroy in interface LifecycleEventListener