public class FrescoModule extends ReactContextBaseJavaModule implements ModuleDataCleaner.Cleanable
Does not expose any methods to JavaScript code. For initialization and cleanup only.
BaseJavaModule.JavaMethod, BaseJavaModule.SyncJavaHook
NativeModule.NativeMethod, NativeModule.SyncNativeHook
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, ImagePipelineConfig) . |
FrescoModule(ReactApplicationContext reactContext,
ImagePipelineConfig config)
Create a new Fresco module with a given ImagePipelineConfig.
|
Modifier and Type | Method and Description |
---|---|
void |
clearSensitiveData() |
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. |
getCurrentActivity, getReactApplicationContext
canOverrideExistingModule, getConstants, getMethods, getSyncHooks, onCatalystInstanceDestroy, onReactBridgeInitialized, supportsWebWorkers, writeConstantsField
public FrescoModule(ReactApplicationContext reactContext)
FrescoModule(ReactApplicationContext, ImagePipelineConfig)
.reactContext
- the context to usepublic FrescoModule(ReactApplicationContext reactContext, @Nullable 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 useconfig
- the Fresco configuration, which will only be used for the first initializationpublic void initialize()
NativeModule
CatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules.initialize
in interface NativeModule
initialize
in class BaseJavaModule
public java.lang.String getName()
getName
in interface NativeModule
require()
this module
from javascript.public void clearSensitiveData()
clearSensitiveData
in interface ModuleDataCleaner.Cleanable
public static boolean hasBeenInitialized()
FrescoModule(ReactApplicationContext, ImagePipelineConfig)
will
ignore the given configuration.