public class NativeAnimatedModule extends ReactContextBaseJavaModule implements OnBatchCompleteListener, LifecycleEventListener
NativeAnimatedNodesManager. Since all the methods from
NativeAnimatedNodesManager need to be called from the UI thread, we we create a queue of
animated graph operations that is then enqueued to be executed in the UI Thread at the end of the
batch of JS->native calls (similarily to how it's handled in UIManagerModule). This
isolates us from the problems that may be caused by concurrent updates of animated graph while UI
thread is "executing" the animation loop.BaseJavaModule.JavaMethodNativeModule.NativeMethodMETHOD_TYPE_REMOTE, METHOD_TYPE_REMOTE_ASYNC| Constructor and Description |
|---|
NativeAnimatedModule(ReactApplicationContext reactContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
connectAnimatedNodes(int parentNodeTag,
int childNodeTag) |
void |
connectAnimatedNodeToView(int animatedNodeTag,
int viewTag) |
void |
createAnimatedNode(int tag,
ReadableMap config) |
void |
disconnectAnimatedNodeFromView(int animatedNodeTag,
int viewTag) |
void |
disconnectAnimatedNodes(int parentNodeTag,
int childNodeTag) |
void |
dropAnimatedNode(int tag) |
java.lang.String |
getName() |
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 |
onBatchComplete() |
void |
onHostDestroy()
Called when host (activity/service) receives destroy event (e.g.
|
void |
onHostPause()
Called when host (activity/service) receives pause event (e.g.
|
void |
onHostResume()
Called when host (activity/service) receives resume event (e.g.
|
void |
setAnimatedNodeValue(int tag,
double value) |
void |
startAnimatingNode(int animatedNodeTag,
ReadableMap animationConfig,
Callback endCallback) |
getCurrentActivity, getReactApplicationContextcanOverrideExistingModule, getConstants, getMethods, onCatalystInstanceDestroy, onReactBridgeInitialized, supportsWebWorkers, writeConstantsFieldpublic NativeAnimatedModule(ReactApplicationContext reactContext)
public 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 void onBatchComplete()
onBatchComplete in interface OnBatchCompleteListenerpublic void onHostResume()
LifecycleEventListenerActivity#onResumeonHostResume in interface LifecycleEventListenerpublic void onHostPause()
LifecycleEventListenerActivity#onPauseonHostPause in interface LifecycleEventListenerpublic void onHostDestroy()
LifecycleEventListenerActivity#onDestroyonHostDestroy in interface LifecycleEventListenerpublic java.lang.String getName()
getName in interface NativeModulerequire() this module
from javascript.public void createAnimatedNode(int tag,
ReadableMap config)
public void dropAnimatedNode(int tag)
public void setAnimatedNodeValue(int tag,
double value)
public void startAnimatingNode(int animatedNodeTag,
ReadableMap animationConfig,
Callback endCallback)
public void connectAnimatedNodes(int parentNodeTag,
int childNodeTag)
public void disconnectAnimatedNodes(int parentNodeTag,
int childNodeTag)
public void connectAnimatedNodeToView(int animatedNodeTag,
int viewTag)
public void disconnectAnimatedNodeFromView(int animatedNodeTag,
int viewTag)