mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Enable NativeAnimationDriver in Fabric
Summary:
Enables NativeAnimationDriver in Fabric.
Fabric animations:
{F151048224}
Pre-Fabric animations:
{F151048344}
Reviewed By: mdvacca
Differential Revision: D14114388
fbshipit-source-id: 1f64db168ae037535a31def7da28b9e0474b7198
This commit is contained in:
1 parent
a89fe4165c
commit
ab6ea9c938
8 files changed
+207
-185
No files matched your search
@@ -11,9 +11,8 @@ import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
import com.facebook.react.bridge.JavaOnlyMap;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
||||
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
||||
import com.facebook.react.uimanager.UIImplementation;
|
||||
|
||||
import com.facebook.react.bridge.UIManager;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -28,14 +27,11 @@ import javax.annotation.Nullable;
|
||||
|
||||
private int mConnectedViewTag = -1;
|
||||
private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;
|
||||
private final UIImplementation mUIImplementation;
|
||||
private final UIManager mUIManager;
|
||||
private final Map<String, Integer> mPropNodeMapping;
|
||||
// This is the backing map for `mDiffMap` we can mutate this to update it instead of having to
|
||||
// create a new one for each update.
|
||||
private final JavaOnlyMap mPropMap;
|
||||
private final ReactStylesDiffMap mDiffMap;
|
||||
|
||||
PropsAnimatedNode(ReadableMap config, NativeAnimatedNodesManager nativeAnimatedNodesManager, UIImplementation uiImplementation) {
|
||||
PropsAnimatedNode(ReadableMap config, NativeAnimatedNodesManager nativeAnimatedNodesManager, UIManager uiManager) {
|
||||
ReadableMap props = config.getMap("props");
|
||||
ReadableMapKeySetIterator iter = props.keySetIterator();
|
||||
mPropNodeMapping = new HashMap<>();
|
||||
@@ -45,9 +41,8 @@ import javax.annotation.Nullable;
|
||||
mPropNodeMapping.put(propKey, nodeIndex);
|
||||
}
|
||||
mPropMap = new JavaOnlyMap();
|
||||
mDiffMap = new ReactStylesDiffMap(mPropMap);
|
||||
mNativeAnimatedNodesManager = nativeAnimatedNodesManager;
|
||||
mUIImplementation = uiImplementation;
|
||||
mUIManager = uiManager;
|
||||
}
|
||||
|
||||
public void connectToView(int viewTag) {
|
||||
@@ -73,9 +68,9 @@ import javax.annotation.Nullable;
|
||||
mPropMap.putNull(it.nextKey());
|
||||
}
|
||||
|
||||
mUIImplementation.synchronouslyUpdateViewOnUIThread(
|
||||
mUIManager.synchronouslyUpdateViewOnUIThread(
|
||||
mConnectedViewTag,
|
||||
mDiffMap);
|
||||
mPropMap);
|
||||
}
|
||||
|
||||
public final void updateView() {
|
||||
@@ -96,8 +91,8 @@ import javax.annotation.Nullable;
|
||||
}
|
||||
}
|
||||
|
||||
mUIImplementation.synchronouslyUpdateViewOnUIThread(
|
||||
mUIManager.synchronouslyUpdateViewOnUIThread(
|
||||
mConnectedViewTag,
|
||||
mDiffMap);
|
||||
mPropMap);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user