mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 00:20:31 +00:00
Litho UIImplementation
Reviewed By: marco-cova Differential Revision: D5880274 fbshipit-source-id: e6741579d3de6090dea8d26cd07241d57adba84d
This commit is contained in:
parent
d07279c978
commit
7677af1d10
@ -11,14 +11,13 @@ package com.facebook.react.uimanager;
|
|||||||
|
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
|
|
||||||
import com.facebook.react.common.SingleThreadAsserter;
|
import com.facebook.react.common.SingleThreadAsserter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple container class to keep track of {@link ReactShadowNode}s associated with a particular
|
* Simple container class to keep track of {@link ReactShadowNode}s associated with a particular
|
||||||
* UIManagerModule instance.
|
* UIManagerModule instance.
|
||||||
*/
|
*/
|
||||||
/*package*/ class ShadowNodeRegistry {
|
public class ShadowNodeRegistry {
|
||||||
|
|
||||||
private final SparseArray<ReactShadowNode> mTagsToCSSNodes;
|
private final SparseArray<ReactShadowNode> mTagsToCSSNodes;
|
||||||
private final SparseBooleanArray mRootTags;
|
private final SparseBooleanArray mRootTags;
|
||||||
|
@ -44,14 +44,14 @@ import javax.annotation.Nullable;
|
|||||||
*/
|
*/
|
||||||
public class UIImplementation {
|
public class UIImplementation {
|
||||||
|
|
||||||
|
protected final EventDispatcher mEventDispatcher;
|
||||||
|
protected final ReactApplicationContext mReactContext;
|
||||||
|
protected final ShadowNodeRegistry mShadowNodeRegistry = new ShadowNodeRegistry();
|
||||||
private final Set<Integer> mMeasuredRootNodes = new HashSet<>();
|
private final Set<Integer> mMeasuredRootNodes = new HashSet<>();
|
||||||
private final ShadowNodeRegistry mShadowNodeRegistry = new ShadowNodeRegistry();
|
|
||||||
private final ViewManagerRegistry mViewManagers;
|
private final ViewManagerRegistry mViewManagers;
|
||||||
private final UIViewOperationQueue mOperationsQueue;
|
private final UIViewOperationQueue mOperationsQueue;
|
||||||
private final NativeViewHierarchyOptimizer mNativeViewHierarchyOptimizer;
|
private final NativeViewHierarchyOptimizer mNativeViewHierarchyOptimizer;
|
||||||
private final int[] mMeasureBuffer = new int[4];
|
private final int[] mMeasureBuffer = new int[4];
|
||||||
private final ReactApplicationContext mReactContext;
|
|
||||||
protected final EventDispatcher mEventDispatcher;
|
|
||||||
|
|
||||||
private long mLastCalculateLayoutTime = 0;
|
private long mLastCalculateLayoutTime = 0;
|
||||||
|
|
||||||
|
@ -330,8 +330,10 @@ import javax.annotation.Nullable;
|
|||||||
*/
|
*/
|
||||||
/*package*/ static Map<String, PropSetter> getNativePropSettersForShadowNodeClass(
|
/*package*/ static Map<String, PropSetter> getNativePropSettersForShadowNodeClass(
|
||||||
Class<? extends ReactShadowNode> cls) {
|
Class<? extends ReactShadowNode> cls) {
|
||||||
if (cls == ReactShadowNodeImpl.class) {
|
for (Class iface : cls.getInterfaces()) {
|
||||||
return EMPTY_PROPS_MAP;
|
if (iface == ReactShadowNode.class) {
|
||||||
|
return EMPTY_PROPS_MAP;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Map<String, PropSetter> props = CLASS_PROPS_CACHE.get(cls);
|
Map<String, PropSetter> props = CLASS_PROPS_CACHE.get(cls);
|
||||||
if (props != null) {
|
if (props != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user