mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-19 00:46:47 +08:00
Less Catalyst, more React
Summary: Catalyst is the old project name. Rename a few files. public Reviewed By: bestander Differential Revision: D2859553 fb-gh-sync-id: 65a87cc7bcc22f20326971becec02aa1c573e5b9
This commit is contained in:
committed by
facebook-github-bot-9
parent
481f560f64
commit
c95d74ac09
@@ -106,7 +106,7 @@ public class NativeViewHierarchyManager {
|
||||
mLayoutAnimationEnabled = enabled;
|
||||
}
|
||||
|
||||
public void updateProperties(int tag, CatalystStylesDiffMap props) {
|
||||
public void updateProperties(int tag, ReactStylesDiffMap props) {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
|
||||
ViewManager viewManager = resolveViewManager(tag);
|
||||
@@ -190,7 +190,7 @@ public class NativeViewHierarchyManager {
|
||||
ThemedReactContext themedContext,
|
||||
int tag,
|
||||
String className,
|
||||
@Nullable CatalystStylesDiffMap initialProps) {
|
||||
@Nullable ReactStylesDiffMap initialProps) {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
SystraceMessage.beginSection(
|
||||
Systrace.TRACE_TAG_REACT_VIEW,
|
||||
|
||||
@@ -70,7 +70,7 @@ public class NativeViewHierarchyOptimizer {
|
||||
public void handleCreateView(
|
||||
ReactShadowNode node,
|
||||
ThemedReactContext themedContext,
|
||||
@Nullable CatalystStylesDiffMap initialProps) {
|
||||
@Nullable ReactStylesDiffMap initialProps) {
|
||||
if (!ENABLED) {
|
||||
int tag = node.getReactTag();
|
||||
mUIViewOperationQueue.enqueueCreateView(
|
||||
@@ -109,7 +109,7 @@ public class NativeViewHierarchyOptimizer {
|
||||
public void handleUpdateView(
|
||||
ReactShadowNode node,
|
||||
String className,
|
||||
CatalystStylesDiffMap props) {
|
||||
ReactStylesDiffMap props) {
|
||||
if (!ENABLED) {
|
||||
mUIViewOperationQueue.enqueueUpdateProperties(node.getReactTag(), className, props);
|
||||
return;
|
||||
@@ -377,7 +377,7 @@ public class NativeViewHierarchyOptimizer {
|
||||
|
||||
private void transitionLayoutOnlyViewToNativeView(
|
||||
ReactShadowNode node,
|
||||
@Nullable CatalystStylesDiffMap props) {
|
||||
@Nullable ReactStylesDiffMap props) {
|
||||
ReactShadowNode parent = node.getParent();
|
||||
if (parent == null) {
|
||||
node.setIsLayoutOnly(false);
|
||||
@@ -419,7 +419,7 @@ public class NativeViewHierarchyOptimizer {
|
||||
mTagsWithLayoutVisited.clear();
|
||||
}
|
||||
|
||||
private static boolean isLayoutOnlyAndCollapsable(@Nullable CatalystStylesDiffMap props) {
|
||||
private static boolean isLayoutOnlyAndCollapsable(@Nullable ReactStylesDiffMap props) {
|
||||
if (props == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public class ReactShadowNode extends CSSNode {
|
||||
public void onBeforeLayout() {
|
||||
}
|
||||
|
||||
public final void updateProperties(CatalystStylesDiffMap props) {
|
||||
public final void updateProperties(ReactStylesDiffMap props) {
|
||||
ViewManagerPropertyUpdater.updateProps(this, props);
|
||||
onAfterUpdateTransaction();
|
||||
}
|
||||
|
||||
@@ -34,11 +34,11 @@ import com.facebook.react.bridge.ReadableMap;
|
||||
* property shouldn't be updated (whereas in all other cases it should be updated to the new value
|
||||
* or the property should be reset).
|
||||
*/
|
||||
public class CatalystStylesDiffMap {
|
||||
public class ReactStylesDiffMap {
|
||||
|
||||
/* package */ final ReadableMap mBackingMap;
|
||||
|
||||
public CatalystStylesDiffMap(ReadableMap props) {
|
||||
public ReactStylesDiffMap(ReadableMap props) {
|
||||
mBackingMap = props;
|
||||
}
|
||||
|
||||
@@ -141,9 +141,9 @@ public class UIImplementation {
|
||||
|
||||
mShadowNodeRegistry.addNode(cssNode);
|
||||
|
||||
CatalystStylesDiffMap styles = null;
|
||||
ReactStylesDiffMap styles = null;
|
||||
if (props != null) {
|
||||
styles = new CatalystStylesDiffMap(props);
|
||||
styles = new ReactStylesDiffMap(props);
|
||||
cssNode.updateProperties(styles);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class UIImplementation {
|
||||
protected void handleCreateView(
|
||||
ReactShadowNode cssNode,
|
||||
int rootViewTag,
|
||||
@Nullable CatalystStylesDiffMap styles) {
|
||||
@Nullable ReactStylesDiffMap styles) {
|
||||
if (!cssNode.isVirtual()) {
|
||||
mNativeViewHierarchyOptimizer.handleCreateView(cssNode, cssNode.getThemedContext(), styles);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class UIImplementation {
|
||||
}
|
||||
|
||||
if (props != null) {
|
||||
CatalystStylesDiffMap styles = new CatalystStylesDiffMap(props);
|
||||
ReactStylesDiffMap styles = new ReactStylesDiffMap(props);
|
||||
cssNode.updateProperties(styles);
|
||||
handleUpdateView(cssNode, className, styles);
|
||||
}
|
||||
@@ -182,7 +182,7 @@ public class UIImplementation {
|
||||
protected void handleUpdateView(
|
||||
ReactShadowNode cssNode,
|
||||
String className,
|
||||
CatalystStylesDiffMap styles) {
|
||||
ReactStylesDiffMap styles) {
|
||||
if (!cssNode.isVirtual()) {
|
||||
mNativeViewHierarchyOptimizer.handleUpdateView(cssNode, className, styles);
|
||||
}
|
||||
|
||||
@@ -78,9 +78,9 @@ public class UIViewOperationQueue {
|
||||
|
||||
private final class UpdatePropertiesOperation extends ViewOperation {
|
||||
|
||||
private final CatalystStylesDiffMap mProps;
|
||||
private final ReactStylesDiffMap mProps;
|
||||
|
||||
private UpdatePropertiesOperation(int tag, CatalystStylesDiffMap props) {
|
||||
private UpdatePropertiesOperation(int tag, ReactStylesDiffMap props) {
|
||||
super(tag);
|
||||
mProps = props;
|
||||
}
|
||||
@@ -127,13 +127,13 @@ public class UIViewOperationQueue {
|
||||
|
||||
private final ThemedReactContext mThemedContext;
|
||||
private final String mClassName;
|
||||
private final @Nullable CatalystStylesDiffMap mInitialProps;
|
||||
private final @Nullable ReactStylesDiffMap mInitialProps;
|
||||
|
||||
public CreateViewOperation(
|
||||
ThemedReactContext themedContext,
|
||||
int tag,
|
||||
String className,
|
||||
@Nullable CatalystStylesDiffMap initialProps) {
|
||||
@Nullable ReactStylesDiffMap initialProps) {
|
||||
super(tag);
|
||||
mThemedContext = themedContext;
|
||||
mClassName = className;
|
||||
@@ -567,7 +567,7 @@ public class UIViewOperationQueue {
|
||||
ThemedReactContext themedContext,
|
||||
int viewReactTag,
|
||||
String viewClassName,
|
||||
@Nullable CatalystStylesDiffMap initialProps) {
|
||||
@Nullable ReactStylesDiffMap initialProps) {
|
||||
mOperations.add(
|
||||
new CreateViewOperation(
|
||||
themedContext,
|
||||
@@ -576,7 +576,7 @@ public class UIViewOperationQueue {
|
||||
initialProps));
|
||||
}
|
||||
|
||||
public void enqueueUpdateProperties(int reactTag, String className, CatalystStylesDiffMap props) {
|
||||
public void enqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props) {
|
||||
mOperations.add(new UpdatePropertiesOperation(reactTag, props));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
import android.view.View;
|
||||
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.touch.CatalystInterceptingViewGroup;
|
||||
import com.facebook.react.touch.ReactInterceptingViewGroup;
|
||||
import com.facebook.react.touch.JSResponderHandler;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
@@ -30,7 +30,7 @@ import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
|
||||
@ReactPropertyHolder
|
||||
public abstract class ViewManager<T extends View, C extends ReactShadowNode> {
|
||||
|
||||
public final void updateProperties(T viewToUpdate, CatalystStylesDiffMap props) {
|
||||
public final void updateProperties(T viewToUpdate, ReactStylesDiffMap props) {
|
||||
ViewManagerPropertyUpdater.updateProps(this, viewToUpdate, props);
|
||||
onAfterUpdateTransaction(viewToUpdate);
|
||||
}
|
||||
@@ -43,8 +43,8 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode> {
|
||||
JSResponderHandler jsResponderHandler) {
|
||||
T view = createViewInstance(reactContext);
|
||||
addEventEmitters(reactContext, view);
|
||||
if (view instanceof CatalystInterceptingViewGroup) {
|
||||
((CatalystInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler);
|
||||
if (view instanceof ReactInterceptingViewGroup) {
|
||||
((ReactInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ public class ViewManagerPropertyUpdater {
|
||||
}
|
||||
|
||||
public interface ViewManagerSetter<T extends ViewManager, V extends View> extends Settable {
|
||||
void setProperty(T manager, V view, String name, CatalystStylesDiffMap props);
|
||||
void setProperty(T manager, V view, String name, ReactStylesDiffMap props);
|
||||
}
|
||||
|
||||
public interface ShadowNodeSetter<T extends ReactShadowNode> extends Settable {
|
||||
void setProperty(T node, String name, CatalystStylesDiffMap props);
|
||||
void setProperty(T node, String name, ReactStylesDiffMap props);
|
||||
}
|
||||
|
||||
private static final String TAG = "ViewManagerPropertyUpdater";
|
||||
@@ -33,7 +33,7 @@ public class ViewManagerPropertyUpdater {
|
||||
public static <T extends ViewManager, V extends View> void updateProps(
|
||||
T manager,
|
||||
V v,
|
||||
CatalystStylesDiffMap props) {
|
||||
ReactStylesDiffMap props) {
|
||||
ViewManagerSetter<T, V> setter = findManagerSetter(manager.getClass());
|
||||
ReadableMap propMap = props.mBackingMap;
|
||||
ReadableMapKeySetIterator iterator = propMap.keySetIterator();
|
||||
@@ -43,7 +43,7 @@ public class ViewManagerPropertyUpdater {
|
||||
}
|
||||
}
|
||||
|
||||
public static <T extends ReactShadowNode> void updateProps(T node, CatalystStylesDiffMap props) {
|
||||
public static <T extends ReactShadowNode> void updateProps(T node, ReactStylesDiffMap props) {
|
||||
ShadowNodeSetter<T> setter = findNodeSetter(node.getClass());
|
||||
ReadableMap propMap = props.mBackingMap;
|
||||
ReadableMapKeySetIterator iterator = propMap.keySetIterator();
|
||||
@@ -117,7 +117,7 @@ public class ViewManagerPropertyUpdater {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperty(T manager, V v, String name, CatalystStylesDiffMap props) {
|
||||
public void setProperty(T manager, V v, String name, ReactStylesDiffMap props) {
|
||||
ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);
|
||||
if (setter != null) {
|
||||
setter.updateViewProp(manager, v, props);
|
||||
@@ -144,7 +144,7 @@ public class ViewManagerPropertyUpdater {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperty(ReactShadowNode node, String name, CatalystStylesDiffMap props) {
|
||||
public void setProperty(ReactShadowNode node, String name, ReactStylesDiffMap props) {
|
||||
ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);
|
||||
if (setter != null) {
|
||||
setter.updateShadowNodeProp(node, props);
|
||||
|
||||
@@ -69,7 +69,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
public void updateViewProp(
|
||||
ViewManager viewManager,
|
||||
View viewToUpdate,
|
||||
CatalystStylesDiffMap props) {
|
||||
ReactStylesDiffMap props) {
|
||||
try {
|
||||
if (mIndex == null) {
|
||||
VIEW_MGR_ARGS[0] = viewToUpdate;
|
||||
@@ -92,7 +92,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
|
||||
public void updateShadowNodeProp(
|
||||
ReactShadowNode nodeToUpdate,
|
||||
CatalystStylesDiffMap props) {
|
||||
ReactStylesDiffMap props) {
|
||||
try {
|
||||
if (mIndex == null) {
|
||||
SHADOW_ARGS[0] = extractProperty(props);
|
||||
@@ -111,7 +111,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract @Nullable Object extractProperty(CatalystStylesDiffMap props);
|
||||
protected abstract @Nullable Object extractProperty(ReactStylesDiffMap props);
|
||||
}
|
||||
|
||||
private static class IntPropSetter extends PropSetter {
|
||||
@@ -129,7 +129,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected Object extractProperty(ReactStylesDiffMap props) {
|
||||
return props.getInt(mPropName, mDefaultValue);
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected Object extractProperty(ReactStylesDiffMap props) {
|
||||
return props.getDouble(mPropName, mDefaultValue);
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected Object extractProperty(ReactStylesDiffMap props) {
|
||||
return props.getBoolean(mPropName, mDefaultValue) ? Boolean.TRUE : Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected Object extractProperty(ReactStylesDiffMap props) {
|
||||
return props.getFloat(mPropName, mDefaultValue);
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
|
||||
return props.getArray(mPropName);
|
||||
}
|
||||
}
|
||||
@@ -208,7 +208,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
|
||||
return props.getMap(mPropName);
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
|
||||
return props.getString(mPropName);
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
|
||||
if (!props.isNull(mPropName)) {
|
||||
return props.getBoolean(mPropName, /* ignored */ false) ? Boolean.TRUE : Boolean.FALSE;
|
||||
}
|
||||
@@ -251,7 +251,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
|
||||
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
|
||||
if (!props.isNull(mPropName)) {
|
||||
return props.getInt(mPropName, /* ignored */ 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user