Litho UIImplementation

Reviewed By: marco-cova

Differential Revision: D5880274

fbshipit-source-id: e6741579d3de6090dea8d26cd07241d57adba84d
This commit is contained in:
Andrew Chen (Eng) 2017-10-04 08:23:09 -07:00 committed by Facebook Github Bot
parent d07279c978
commit 7677af1d10
3 changed files with 8 additions and 7 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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) {