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:
Martin Konicek
2016-01-25 05:55:06 -08:00
committed by facebook-github-bot-9
parent 481f560f64
commit c95d74ac09
30 changed files with 112 additions and 112 deletions

View File

@@ -18,7 +18,7 @@ import com.facebook.react.bridge.JSCJavaScriptExecutor;
import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.NativeModuleRegistry; import com.facebook.react.bridge.NativeModuleRegistry;
import com.facebook.react.bridge.JavaScriptModulesConfig; import com.facebook.react.bridge.JavaScriptModulesConfig;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec; import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.android.internal.util.Predicate; import com.android.internal.util.Predicate;
@@ -38,7 +38,7 @@ public class ReactTestHelper {
public CatalystInstanceImpl build() { public CatalystInstanceImpl build() {
CatalystInstanceImpl instance = mTestCase.new ReactTestInstanceBuilder() CatalystInstanceImpl instance = mTestCase.new ReactTestInstanceBuilder()
.setCatalystQueueConfigurationSpec(CatalystQueueConfigurationSpec.createDefault()) .setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())
.setJSExecutor(new JSCJavaScriptExecutor()) .setJSExecutor(new JSCJavaScriptExecutor())
.setRegistry(mNativeModuleRegistryBuilder.build()) .setRegistry(mNativeModuleRegistryBuilder.build())
.setJSModulesConfig(mJSModulesConfigBuilder.build()) .setJSModulesConfig(mJSModulesConfigBuilder.build())

View File

@@ -46,7 +46,7 @@ import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableMap; import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.WritableNativeMap; import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec; import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.facebook.react.common.ApplicationHolder; import com.facebook.react.common.ApplicationHolder;
import com.facebook.react.common.ReactConstants; import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.common.annotations.VisibleForTesting;
@@ -711,7 +711,7 @@ import com.facebook.systrace.Systrace;
? mNativeModuleCallExceptionHandler ? mNativeModuleCallExceptionHandler
: mDevSupportManager; : mDevSupportManager;
CatalystInstanceImpl.Builder catalystInstanceBuilder = new CatalystInstanceImpl.Builder() CatalystInstanceImpl.Builder catalystInstanceBuilder = new CatalystInstanceImpl.Builder()
.setCatalystQueueConfigurationSpec(CatalystQueueConfigurationSpec.createDefault()) .setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())
.setJSExecutor(jsExecutor) .setJSExecutor(jsExecutor)
.setRegistry(nativeModuleRegistry) .setRegistry(nativeModuleRegistry)
.setJSModulesConfig(javaScriptModulesConfig) .setJSModulesConfig(javaScriptModulesConfig)

View File

@@ -11,7 +11,7 @@ package com.facebook.react.bridge;
import java.util.Collection; import java.util.Collection;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration; import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.common.annotations.VisibleForTesting;
@@ -29,7 +29,7 @@ public interface CatalystInstance {
@DoNotStrip @DoNotStrip
void invokeCallback(final int callbackID, final NativeArray arguments); void invokeCallback(final int callbackID, final NativeArray arguments);
/** /**
* Destroys this catalyst instance, waiting for any other threads in CatalystQueueConfiguration * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
* (besides the UI thread) to finish running. Must be called from the UI thread so that we can * (besides the UI thread) to finish running. Must be called from the UI thread so that we can
* fully shut down other threads. * fully shut down other threads.
*/ */
@@ -42,7 +42,7 @@ public interface CatalystInstance {
@VisibleForTesting @VisibleForTesting
void initialize(); void initialize();
CatalystQueueConfiguration getCatalystQueueConfiguration(); ReactQueueConfiguration getReactQueueConfiguration();
<T extends JavaScriptModule> T getJSModule(Class<T> jsInterface); <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface);
<T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface); <T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface);

View File

@@ -21,9 +21,9 @@ import java.util.concurrent.atomic.AtomicInteger;
import com.facebook.common.logging.FLog; import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions; import com.facebook.infer.annotation.Assertions;
import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration; import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationImpl; import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec; import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.facebook.react.bridge.queue.QueueThreadExceptionHandler; import com.facebook.react.bridge.queue.QueueThreadExceptionHandler;
import com.facebook.react.common.ReactConstants; import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.common.annotations.VisibleForTesting;
@@ -43,7 +43,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
private static final AtomicInteger sNextInstanceIdForTrace = new AtomicInteger(1); private static final AtomicInteger sNextInstanceIdForTrace = new AtomicInteger(1);
// Access from any thread // Access from any thread
private final CatalystQueueConfigurationImpl mCatalystQueueConfiguration; private final ReactQueueConfigurationImpl mReactQueueConfiguration;
private final CopyOnWriteArrayList<NotThreadSafeBridgeIdleDebugListener> mBridgeIdleListeners; private final CopyOnWriteArrayList<NotThreadSafeBridgeIdleDebugListener> mBridgeIdleListeners;
private final AtomicInteger mPendingJSCalls = new AtomicInteger(0); private final AtomicInteger mPendingJSCalls = new AtomicInteger(0);
private final String mJsPendingCallsTitleForTrace = private final String mJsPendingCallsTitleForTrace =
@@ -64,14 +64,14 @@ public class CatalystInstanceImpl implements CatalystInstance {
private boolean mJSBundleHasLoaded; private boolean mJSBundleHasLoaded;
private CatalystInstanceImpl( private CatalystInstanceImpl(
final CatalystQueueConfigurationSpec catalystQueueConfigurationSpec, final ReactQueueConfigurationSpec ReactQueueConfigurationSpec,
final JavaScriptExecutor jsExecutor, final JavaScriptExecutor jsExecutor,
final NativeModuleRegistry registry, final NativeModuleRegistry registry,
final JavaScriptModulesConfig jsModulesConfig, final JavaScriptModulesConfig jsModulesConfig,
final JSBundleLoader jsBundleLoader, final JSBundleLoader jsBundleLoader,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) { NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
mCatalystQueueConfiguration = CatalystQueueConfigurationImpl.create( mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
catalystQueueConfigurationSpec, ReactQueueConfigurationSpec,
new NativeExceptionHandler()); new NativeExceptionHandler());
mBridgeIdleListeners = new CopyOnWriteArrayList<>(); mBridgeIdleListeners = new CopyOnWriteArrayList<>();
mJavaRegistry = registry; mJavaRegistry = registry;
@@ -81,7 +81,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
mTraceListener = new JSProfilerTraceListener(); mTraceListener = new JSProfilerTraceListener();
try { try {
mBridge = mCatalystQueueConfiguration.getJSQueueThread().callOnQueue( mBridge = mReactQueueConfiguration.getJSQueueThread().callOnQueue(
new Callable<ReactBridge>() { new Callable<ReactBridge>() {
@Override @Override
public ReactBridge call() throws Exception { public ReactBridge call() throws Exception {
@@ -101,7 +101,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
private ReactBridge initializeBridge( private ReactBridge initializeBridge(
JavaScriptExecutor jsExecutor, JavaScriptExecutor jsExecutor,
JavaScriptModulesConfig jsModulesConfig) { JavaScriptModulesConfig jsModulesConfig) {
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread(); mReactQueueConfiguration.getJSQueueThread().assertIsOnThread();
Assertions.assertCondition(mBridge == null, "initializeBridge should be called once"); Assertions.assertCondition(mBridge == null, "initializeBridge should be called once");
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactBridgeCtor"); Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactBridgeCtor");
@@ -110,7 +110,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
bridge = new ReactBridge( bridge = new ReactBridge(
jsExecutor, jsExecutor,
new NativeModulesReactCallback(), new NativeModulesReactCallback(),
mCatalystQueueConfiguration.getNativeModulesQueueThread()); mReactQueueConfiguration.getNativeModulesQueueThread());
} finally { } finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
} }
@@ -133,7 +133,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
@Override @Override
public void runJSBundle() { public void runJSBundle() {
try { try {
mJSBundleHasLoaded = mCatalystQueueConfiguration.getJSQueueThread().callOnQueue( mJSBundleHasLoaded = mReactQueueConfiguration.getJSQueueThread().callOnQueue(
new Callable<Boolean>() { new Callable<Boolean>() {
@Override @Override
public Boolean call() throws Exception { public Boolean call() throws Exception {
@@ -179,11 +179,11 @@ public class CatalystInstanceImpl implements CatalystInstance {
tracingName, tracingName,
traceID); traceID);
mCatalystQueueConfiguration.getJSQueueThread().runOnQueue( mReactQueueConfiguration.getJSQueueThread().runOnQueue(
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread(); mReactQueueConfiguration.getJSQueueThread().assertIsOnThread();
Systrace.endAsyncFlow( Systrace.endAsyncFlow(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
@@ -222,11 +222,11 @@ public class CatalystInstanceImpl implements CatalystInstance {
"<callback>", "<callback>",
traceID); traceID);
mCatalystQueueConfiguration.getJSQueueThread().runOnQueue( mReactQueueConfiguration.getJSQueueThread().runOnQueue(
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread(); mReactQueueConfiguration.getJSQueueThread().assertIsOnThread();
Systrace.endAsyncFlow( Systrace.endAsyncFlow(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
@@ -248,7 +248,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
} }
/** /**
* Destroys this catalyst instance, waiting for any other threads in CatalystQueueConfiguration * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
* (besides the UI thread) to finish running. Must be called from the UI thread so that we can * (besides the UI thread) to finish running. Must be called from the UI thread so that we can
* fully shut down other threads. * fully shut down other threads.
*/ */
@@ -263,7 +263,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
// TODO: tell all APIs to shut down // TODO: tell all APIs to shut down
mDestroyed = true; mDestroyed = true;
mJavaRegistry.notifyCatalystInstanceDestroy(); mJavaRegistry.notifyCatalystInstanceDestroy();
mCatalystQueueConfiguration.destroy(); mReactQueueConfiguration.destroy();
boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0); boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
if (!wasIdle && !mBridgeIdleListeners.isEmpty()) { if (!wasIdle && !mBridgeIdleListeners.isEmpty()) {
for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) { for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
@@ -274,7 +274,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
Systrace.unregisterListener(mTraceListener); Systrace.unregisterListener(mTraceListener);
// We can access the Bridge from any thread now because we know either we are on the JS thread // We can access the Bridge from any thread now because we know either we are on the JS thread
// or the JS thread has finished via CatalystQueueConfiguration#destroy() // or the JS thread has finished via ReactQueueConfiguration#destroy()
mBridge.dispose(); mBridge.dispose();
} }
@@ -298,8 +298,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
} }
@Override @Override
public CatalystQueueConfiguration getCatalystQueueConfiguration() { public ReactQueueConfiguration getReactQueueConfiguration() {
return mCatalystQueueConfiguration; return mReactQueueConfiguration;
} }
@Override @Override
@@ -418,7 +418,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
@Override @Override
public void call(int moduleId, int methodId, ReadableNativeArray parameters) { public void call(int moduleId, int methodId, ReadableNativeArray parameters) {
mCatalystQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread(); mReactQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread();
// Suppress any callbacks if destroyed - will only lead to sadness. // Suppress any callbacks if destroyed - will only lead to sadness.
if (mDestroyed) { if (mDestroyed) {
@@ -430,7 +430,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
@Override @Override
public void onBatchComplete() { public void onBatchComplete() {
mCatalystQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread(); mReactQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread();
// The bridge may have been destroyed due to an exception during the batch. In that case // The bridge may have been destroyed due to an exception during the batch. In that case
// native modules could be in a bad state so we don't want to call anything on them. We // native modules could be in a bad state so we don't want to call anything on them. We
@@ -457,7 +457,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
// framework/native code, it was triggered by JS and theoretically since we were able // framework/native code, it was triggered by JS and theoretically since we were able
// to set up the bridge, JS could change its logic, reload, and not trigger that crash. // to set up the bridge, JS could change its logic, reload, and not trigger that crash.
mNativeModuleCallExceptionHandler.handleException(e); mNativeModuleCallExceptionHandler.handleException(e);
mCatalystQueueConfiguration.getUIQueueThread().runOnQueue( mReactQueueConfiguration.getUIQueueThread().runOnQueue(
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -481,16 +481,16 @@ public class CatalystInstanceImpl implements CatalystInstance {
public static class Builder { public static class Builder {
private @Nullable CatalystQueueConfigurationSpec mCatalystQueueConfigurationSpec; private @Nullable ReactQueueConfigurationSpec mReactQueueConfigurationSpec;
private @Nullable JSBundleLoader mJSBundleLoader; private @Nullable JSBundleLoader mJSBundleLoader;
private @Nullable NativeModuleRegistry mRegistry; private @Nullable NativeModuleRegistry mRegistry;
private @Nullable JavaScriptModulesConfig mJSModulesConfig; private @Nullable JavaScriptModulesConfig mJSModulesConfig;
private @Nullable JavaScriptExecutor mJSExecutor; private @Nullable JavaScriptExecutor mJSExecutor;
private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler; private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;
public Builder setCatalystQueueConfigurationSpec( public Builder setReactQueueConfigurationSpec(
CatalystQueueConfigurationSpec catalystQueueConfigurationSpec) { ReactQueueConfigurationSpec ReactQueueConfigurationSpec) {
mCatalystQueueConfigurationSpec = catalystQueueConfigurationSpec; mReactQueueConfigurationSpec = ReactQueueConfigurationSpec;
return this; return this;
} }
@@ -522,7 +522,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
public CatalystInstanceImpl build() { public CatalystInstanceImpl build() {
return new CatalystInstanceImpl( return new CatalystInstanceImpl(
Assertions.assertNotNull(mCatalystQueueConfigurationSpec), Assertions.assertNotNull(mReactQueueConfigurationSpec),
Assertions.assertNotNull(mJSExecutor), Assertions.assertNotNull(mJSExecutor),
Assertions.assertNotNull(mRegistry), Assertions.assertNotNull(mRegistry),
Assertions.assertNotNull(mJSModulesConfig), Assertions.assertNotNull(mJSModulesConfig),

View File

@@ -21,7 +21,7 @@ import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import com.facebook.infer.annotation.Assertions; import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration; import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.bridge.queue.MessageQueueThread; import com.facebook.react.bridge.queue.MessageQueueThread;
/** /**
@@ -60,7 +60,7 @@ public class ReactContext extends ContextWrapper {
mCatalystInstance = catalystInstance; mCatalystInstance = catalystInstance;
CatalystQueueConfiguration queueConfig = catalystInstance.getCatalystQueueConfiguration(); ReactQueueConfiguration queueConfig = catalystInstance.getReactQueueConfiguration();
mUiMessageQueueThread = queueConfig.getUIQueueThread(); mUiMessageQueueThread = queueConfig.getUIQueueThread();
mNativeModulesMessageQueueThread = queueConfig.getNativeModulesQueueThread(); mNativeModulesMessageQueueThread = queueConfig.getNativeModulesQueueThread();
mJSMessageQueueThread = queueConfig.getJSQueueThread(); mJSMessageQueueThread = queueConfig.getJSQueueThread();

View File

@@ -18,7 +18,7 @@ package com.facebook.react.bridge.queue;
* Native Modules Queue Thread: The thread and Looper that native modules are invoked on. * Native Modules Queue Thread: The thread and Looper that native modules are invoked on.
* JS Queue Thread: The thread and Looper that JS is executed on. * JS Queue Thread: The thread and Looper that JS is executed on.
*/ */
public interface CatalystQueueConfiguration { public interface ReactQueueConfiguration {
MessageQueueThread getUIQueueThread(); MessageQueueThread getUIQueueThread();
MessageQueueThread getNativeModulesQueueThread(); MessageQueueThread getNativeModulesQueueThread();
MessageQueueThread getJSQueueThread(); MessageQueueThread getJSQueueThread();

View File

@@ -15,13 +15,13 @@ import android.os.Looper;
import com.facebook.react.common.MapBuilder; import com.facebook.react.common.MapBuilder;
public class CatalystQueueConfigurationImpl implements CatalystQueueConfiguration { public class ReactQueueConfigurationImpl implements ReactQueueConfiguration {
private final MessageQueueThreadImpl mUIQueueThread; private final MessageQueueThreadImpl mUIQueueThread;
private final MessageQueueThreadImpl mNativeModulesQueueThread; private final MessageQueueThreadImpl mNativeModulesQueueThread;
private final MessageQueueThreadImpl mJSQueueThread; private final MessageQueueThreadImpl mJSQueueThread;
private CatalystQueueConfigurationImpl( private ReactQueueConfigurationImpl(
MessageQueueThreadImpl uiQueueThread, MessageQueueThreadImpl uiQueueThread,
MessageQueueThreadImpl nativeModulesQueueThread, MessageQueueThreadImpl nativeModulesQueueThread,
MessageQueueThreadImpl jsQueueThread) { MessageQueueThreadImpl jsQueueThread) {
@@ -58,8 +58,8 @@ public class CatalystQueueConfigurationImpl implements CatalystQueueConfiguratio
} }
} }
public static CatalystQueueConfigurationImpl create( public static ReactQueueConfigurationImpl create(
CatalystQueueConfigurationSpec spec, ReactQueueConfigurationSpec spec,
QueueThreadExceptionHandler exceptionHandler) { QueueThreadExceptionHandler exceptionHandler) {
Map<MessageQueueThreadSpec, MessageQueueThreadImpl> specsToThreads = MapBuilder.newHashMap(); Map<MessageQueueThreadSpec, MessageQueueThreadImpl> specsToThreads = MapBuilder.newHashMap();
@@ -80,6 +80,6 @@ public class CatalystQueueConfigurationImpl implements CatalystQueueConfiguratio
MessageQueueThreadImpl.create(spec.getNativeModulesQueueThreadSpec(), exceptionHandler); MessageQueueThreadImpl.create(spec.getNativeModulesQueueThreadSpec(), exceptionHandler);
} }
return new CatalystQueueConfigurationImpl(uiThread, nativeModulesThread, jsThread); return new ReactQueueConfigurationImpl(uiThread, nativeModulesThread, jsThread);
} }
} }

View File

@@ -14,17 +14,17 @@ import javax.annotation.Nullable;
import com.facebook.infer.annotation.Assertions; import com.facebook.infer.annotation.Assertions;
/** /**
* Spec for creating a CatalystQueueConfiguration. This exists so that CatalystInstance is able to * Spec for creating a ReactQueueConfiguration. This exists so that CatalystInstance is able to
* set Exception handlers on the MessageQueueThreads it uses and it would not be super clean if the * set Exception handlers on the MessageQueueThreads it uses and it would not be super clean if the
* threads were configured, then passed to CatalystInstance where they are configured more. These * threads were configured, then passed to CatalystInstance where they are configured more. These
* specs allows the Threads to be created fully configured. * specs allows the Threads to be created fully configured.
*/ */
public class CatalystQueueConfigurationSpec { public class ReactQueueConfigurationSpec {
private final MessageQueueThreadSpec mNativeModulesQueueThreadSpec; private final MessageQueueThreadSpec mNativeModulesQueueThreadSpec;
private final MessageQueueThreadSpec mJSQueueThreadSpec; private final MessageQueueThreadSpec mJSQueueThreadSpec;
private CatalystQueueConfigurationSpec( private ReactQueueConfigurationSpec(
MessageQueueThreadSpec nativeModulesQueueThreadSpec, MessageQueueThreadSpec nativeModulesQueueThreadSpec,
MessageQueueThreadSpec jsQueueThreadSpec) { MessageQueueThreadSpec jsQueueThreadSpec) {
mNativeModulesQueueThreadSpec = nativeModulesQueueThreadSpec; mNativeModulesQueueThreadSpec = nativeModulesQueueThreadSpec;
@@ -43,7 +43,7 @@ public class CatalystQueueConfigurationSpec {
return new Builder(); return new Builder();
} }
public static CatalystQueueConfigurationSpec createDefault() { public static ReactQueueConfigurationSpec createDefault() {
return builder() return builder()
.setJSQueueThreadSpec(MessageQueueThreadSpec.newBackgroundThreadSpec("js")) .setJSQueueThreadSpec(MessageQueueThreadSpec.newBackgroundThreadSpec("js"))
.setNativeModulesQueueThreadSpec( .setNativeModulesQueueThreadSpec(
@@ -70,8 +70,8 @@ public class CatalystQueueConfigurationSpec {
return this; return this;
} }
public CatalystQueueConfigurationSpec build() { public ReactQueueConfigurationSpec build() {
return new CatalystQueueConfigurationSpec( return new ReactQueueConfigurationSpec(
Assertions.assertNotNull(mNativeModulesQueueSpec), Assertions.assertNotNull(mNativeModulesQueueSpec),
Assertions.assertNotNull(mJSQueueSpec)); Assertions.assertNotNull(mJSQueueSpec));
} }

View File

@@ -64,7 +64,7 @@ public class ReactPropertyProcessor extends AbstractProcessor {
private static final Set<TypeName> BOXED_PRIMITIVES; private static final Set<TypeName> BOXED_PRIMITIVES;
private static final TypeName PROPS_TYPE = private static final TypeName PROPS_TYPE =
ClassName.get("com.facebook.react.uimanager", "CatalystStylesDiffMap"); ClassName.get("com.facebook.react.uimanager", "ReactStylesDiffMap");
private static final TypeName STRING_TYPE = TypeName.get(String.class); private static final TypeName STRING_TYPE = TypeName.get(String.class);
private static final TypeName READABLE_MAP_TYPE = TypeName.get(ReadableMap.class); private static final TypeName READABLE_MAP_TYPE = TypeName.get(ReadableMap.class);
private static final TypeName READABLE_ARRAY_TYPE = TypeName.get(ReadableArray.class); private static final TypeName READABLE_ARRAY_TYPE = TypeName.get(ReadableArray.class);

View File

@@ -18,7 +18,7 @@ import android.view.ViewParent;
/** /**
* This class coordinates JSResponder commands for {@link UIManagerModule}. It should be set as * This class coordinates JSResponder commands for {@link UIManagerModule}. It should be set as
* OnInterceptTouchEventListener for all newly created native views that implements * OnInterceptTouchEventListener for all newly created native views that implements
* {@link CatalystInterceptingViewGroup} and thanks to the information whether JSResponder is set * {@link ReactInterceptingViewGroup} and thanks to the information whether JSResponder is set
* and to which view it will correctly coordinate the return values of * and to which view it will correctly coordinate the return values of
* {@link OnInterceptTouchEventListener} such that touch events will be dispatched to the view * {@link OnInterceptTouchEventListener} such that touch events will be dispatched to the view
* selected by JS gesture recognizer. * selected by JS gesture recognizer.

View File

@@ -16,7 +16,7 @@ package com.facebook.react.touch;
* which then is used to control touch event flow in cases in which they requested to be intercepted * which then is used to control touch event flow in cases in which they requested to be intercepted
* by some parent view based on a JS gesture detector. * by some parent view based on a JS gesture detector.
*/ */
public interface CatalystInterceptingViewGroup { public interface ReactInterceptingViewGroup {
/** /**
* A {@link ViewGroup} instance that implement this interface is responsible for storing the * A {@link ViewGroup} instance that implement this interface is responsible for storing the

View File

@@ -106,7 +106,7 @@ public class NativeViewHierarchyManager {
mLayoutAnimationEnabled = enabled; mLayoutAnimationEnabled = enabled;
} }
public void updateProperties(int tag, CatalystStylesDiffMap props) { public void updateProperties(int tag, ReactStylesDiffMap props) {
UiThreadUtil.assertOnUiThread(); UiThreadUtil.assertOnUiThread();
ViewManager viewManager = resolveViewManager(tag); ViewManager viewManager = resolveViewManager(tag);
@@ -190,7 +190,7 @@ public class NativeViewHierarchyManager {
ThemedReactContext themedContext, ThemedReactContext themedContext,
int tag, int tag,
String className, String className,
@Nullable CatalystStylesDiffMap initialProps) { @Nullable ReactStylesDiffMap initialProps) {
UiThreadUtil.assertOnUiThread(); UiThreadUtil.assertOnUiThread();
SystraceMessage.beginSection( SystraceMessage.beginSection(
Systrace.TRACE_TAG_REACT_VIEW, Systrace.TRACE_TAG_REACT_VIEW,

View File

@@ -70,7 +70,7 @@ public class NativeViewHierarchyOptimizer {
public void handleCreateView( public void handleCreateView(
ReactShadowNode node, ReactShadowNode node,
ThemedReactContext themedContext, ThemedReactContext themedContext,
@Nullable CatalystStylesDiffMap initialProps) { @Nullable ReactStylesDiffMap initialProps) {
if (!ENABLED) { if (!ENABLED) {
int tag = node.getReactTag(); int tag = node.getReactTag();
mUIViewOperationQueue.enqueueCreateView( mUIViewOperationQueue.enqueueCreateView(
@@ -109,7 +109,7 @@ public class NativeViewHierarchyOptimizer {
public void handleUpdateView( public void handleUpdateView(
ReactShadowNode node, ReactShadowNode node,
String className, String className,
CatalystStylesDiffMap props) { ReactStylesDiffMap props) {
if (!ENABLED) { if (!ENABLED) {
mUIViewOperationQueue.enqueueUpdateProperties(node.getReactTag(), className, props); mUIViewOperationQueue.enqueueUpdateProperties(node.getReactTag(), className, props);
return; return;
@@ -377,7 +377,7 @@ public class NativeViewHierarchyOptimizer {
private void transitionLayoutOnlyViewToNativeView( private void transitionLayoutOnlyViewToNativeView(
ReactShadowNode node, ReactShadowNode node,
@Nullable CatalystStylesDiffMap props) { @Nullable ReactStylesDiffMap props) {
ReactShadowNode parent = node.getParent(); ReactShadowNode parent = node.getParent();
if (parent == null) { if (parent == null) {
node.setIsLayoutOnly(false); node.setIsLayoutOnly(false);
@@ -419,7 +419,7 @@ public class NativeViewHierarchyOptimizer {
mTagsWithLayoutVisited.clear(); mTagsWithLayoutVisited.clear();
} }
private static boolean isLayoutOnlyAndCollapsable(@Nullable CatalystStylesDiffMap props) { private static boolean isLayoutOnlyAndCollapsable(@Nullable ReactStylesDiffMap props) {
if (props == null) { if (props == null) {
return true; return true;
} }

View File

@@ -168,7 +168,7 @@ public class ReactShadowNode extends CSSNode {
public void onBeforeLayout() { public void onBeforeLayout() {
} }
public final void updateProperties(CatalystStylesDiffMap props) { public final void updateProperties(ReactStylesDiffMap props) {
ViewManagerPropertyUpdater.updateProps(this, props); ViewManagerPropertyUpdater.updateProps(this, props);
onAfterUpdateTransaction(); onAfterUpdateTransaction();
} }

View File

@@ -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 * property shouldn't be updated (whereas in all other cases it should be updated to the new value
* or the property should be reset). * or the property should be reset).
*/ */
public class CatalystStylesDiffMap { public class ReactStylesDiffMap {
/* package */ final ReadableMap mBackingMap; /* package */ final ReadableMap mBackingMap;
public CatalystStylesDiffMap(ReadableMap props) { public ReactStylesDiffMap(ReadableMap props) {
mBackingMap = props; mBackingMap = props;
} }

View File

@@ -141,9 +141,9 @@ public class UIImplementation {
mShadowNodeRegistry.addNode(cssNode); mShadowNodeRegistry.addNode(cssNode);
CatalystStylesDiffMap styles = null; ReactStylesDiffMap styles = null;
if (props != null) { if (props != null) {
styles = new CatalystStylesDiffMap(props); styles = new ReactStylesDiffMap(props);
cssNode.updateProperties(styles); cssNode.updateProperties(styles);
} }
@@ -153,7 +153,7 @@ public class UIImplementation {
protected void handleCreateView( protected void handleCreateView(
ReactShadowNode cssNode, ReactShadowNode cssNode,
int rootViewTag, int rootViewTag,
@Nullable CatalystStylesDiffMap styles) { @Nullable ReactStylesDiffMap styles) {
if (!cssNode.isVirtual()) { if (!cssNode.isVirtual()) {
mNativeViewHierarchyOptimizer.handleCreateView(cssNode, cssNode.getThemedContext(), styles); mNativeViewHierarchyOptimizer.handleCreateView(cssNode, cssNode.getThemedContext(), styles);
} }
@@ -173,7 +173,7 @@ public class UIImplementation {
} }
if (props != null) { if (props != null) {
CatalystStylesDiffMap styles = new CatalystStylesDiffMap(props); ReactStylesDiffMap styles = new ReactStylesDiffMap(props);
cssNode.updateProperties(styles); cssNode.updateProperties(styles);
handleUpdateView(cssNode, className, styles); handleUpdateView(cssNode, className, styles);
} }
@@ -182,7 +182,7 @@ public class UIImplementation {
protected void handleUpdateView( protected void handleUpdateView(
ReactShadowNode cssNode, ReactShadowNode cssNode,
String className, String className,
CatalystStylesDiffMap styles) { ReactStylesDiffMap styles) {
if (!cssNode.isVirtual()) { if (!cssNode.isVirtual()) {
mNativeViewHierarchyOptimizer.handleUpdateView(cssNode, className, styles); mNativeViewHierarchyOptimizer.handleUpdateView(cssNode, className, styles);
} }

View File

@@ -78,9 +78,9 @@ public class UIViewOperationQueue {
private final class UpdatePropertiesOperation extends ViewOperation { 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); super(tag);
mProps = props; mProps = props;
} }
@@ -127,13 +127,13 @@ public class UIViewOperationQueue {
private final ThemedReactContext mThemedContext; private final ThemedReactContext mThemedContext;
private final String mClassName; private final String mClassName;
private final @Nullable CatalystStylesDiffMap mInitialProps; private final @Nullable ReactStylesDiffMap mInitialProps;
public CreateViewOperation( public CreateViewOperation(
ThemedReactContext themedContext, ThemedReactContext themedContext,
int tag, int tag,
String className, String className,
@Nullable CatalystStylesDiffMap initialProps) { @Nullable ReactStylesDiffMap initialProps) {
super(tag); super(tag);
mThemedContext = themedContext; mThemedContext = themedContext;
mClassName = className; mClassName = className;
@@ -567,7 +567,7 @@ public class UIViewOperationQueue {
ThemedReactContext themedContext, ThemedReactContext themedContext,
int viewReactTag, int viewReactTag,
String viewClassName, String viewClassName,
@Nullable CatalystStylesDiffMap initialProps) { @Nullable ReactStylesDiffMap initialProps) {
mOperations.add( mOperations.add(
new CreateViewOperation( new CreateViewOperation(
themedContext, themedContext,
@@ -576,7 +576,7 @@ public class UIViewOperationQueue {
initialProps)); 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)); mOperations.add(new UpdatePropertiesOperation(reactTag, props));
} }

View File

@@ -16,7 +16,7 @@ import java.util.Map;
import android.view.View; import android.view.View;
import com.facebook.react.bridge.ReadableArray; 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.touch.JSResponderHandler;
import com.facebook.react.uimanager.annotations.ReactProp; import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.annotations.ReactPropGroup; import com.facebook.react.uimanager.annotations.ReactPropGroup;
@@ -30,7 +30,7 @@ import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
@ReactPropertyHolder @ReactPropertyHolder
public abstract class ViewManager<T extends View, C extends ReactShadowNode> { 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); ViewManagerPropertyUpdater.updateProps(this, viewToUpdate, props);
onAfterUpdateTransaction(viewToUpdate); onAfterUpdateTransaction(viewToUpdate);
} }
@@ -43,8 +43,8 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode> {
JSResponderHandler jsResponderHandler) { JSResponderHandler jsResponderHandler) {
T view = createViewInstance(reactContext); T view = createViewInstance(reactContext);
addEventEmitters(reactContext, view); addEventEmitters(reactContext, view);
if (view instanceof CatalystInterceptingViewGroup) { if (view instanceof ReactInterceptingViewGroup) {
((CatalystInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler); ((ReactInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler);
} }
return view; return view;
} }

View File

@@ -17,11 +17,11 @@ public class ViewManagerPropertyUpdater {
} }
public interface ViewManagerSetter<T extends ViewManager, V extends View> extends Settable { 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 { 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"; private static final String TAG = "ViewManagerPropertyUpdater";
@@ -33,7 +33,7 @@ public class ViewManagerPropertyUpdater {
public static <T extends ViewManager, V extends View> void updateProps( public static <T extends ViewManager, V extends View> void updateProps(
T manager, T manager,
V v, V v,
CatalystStylesDiffMap props) { ReactStylesDiffMap props) {
ViewManagerSetter<T, V> setter = findManagerSetter(manager.getClass()); ViewManagerSetter<T, V> setter = findManagerSetter(manager.getClass());
ReadableMap propMap = props.mBackingMap; ReadableMap propMap = props.mBackingMap;
ReadableMapKeySetIterator iterator = propMap.keySetIterator(); 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()); ShadowNodeSetter<T> setter = findNodeSetter(node.getClass());
ReadableMap propMap = props.mBackingMap; ReadableMap propMap = props.mBackingMap;
ReadableMapKeySetIterator iterator = propMap.keySetIterator(); ReadableMapKeySetIterator iterator = propMap.keySetIterator();
@@ -117,7 +117,7 @@ public class ViewManagerPropertyUpdater {
} }
@Override @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); ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);
if (setter != null) { if (setter != null) {
setter.updateViewProp(manager, v, props); setter.updateViewProp(manager, v, props);
@@ -144,7 +144,7 @@ public class ViewManagerPropertyUpdater {
} }
@Override @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); ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);
if (setter != null) { if (setter != null) {
setter.updateShadowNodeProp(node, props); setter.updateShadowNodeProp(node, props);

View File

@@ -69,7 +69,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
public void updateViewProp( public void updateViewProp(
ViewManager viewManager, ViewManager viewManager,
View viewToUpdate, View viewToUpdate,
CatalystStylesDiffMap props) { ReactStylesDiffMap props) {
try { try {
if (mIndex == null) { if (mIndex == null) {
VIEW_MGR_ARGS[0] = viewToUpdate; VIEW_MGR_ARGS[0] = viewToUpdate;
@@ -92,7 +92,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
public void updateShadowNodeProp( public void updateShadowNodeProp(
ReactShadowNode nodeToUpdate, ReactShadowNode nodeToUpdate,
CatalystStylesDiffMap props) { ReactStylesDiffMap props) {
try { try {
if (mIndex == null) { if (mIndex == null) {
SHADOW_ARGS[0] = extractProperty(props); 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 { private static class IntPropSetter extends PropSetter {
@@ -129,7 +129,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected Object extractProperty(CatalystStylesDiffMap props) { protected Object extractProperty(ReactStylesDiffMap props) {
return props.getInt(mPropName, mDefaultValue); return props.getInt(mPropName, mDefaultValue);
} }
} }
@@ -149,7 +149,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected Object extractProperty(CatalystStylesDiffMap props) { protected Object extractProperty(ReactStylesDiffMap props) {
return props.getDouble(mPropName, mDefaultValue); return props.getDouble(mPropName, mDefaultValue);
} }
} }
@@ -164,7 +164,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected Object extractProperty(CatalystStylesDiffMap props) { protected Object extractProperty(ReactStylesDiffMap props) {
return props.getBoolean(mPropName, mDefaultValue) ? Boolean.TRUE : Boolean.FALSE; return props.getBoolean(mPropName, mDefaultValue) ? Boolean.TRUE : Boolean.FALSE;
} }
} }
@@ -184,7 +184,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected Object extractProperty(CatalystStylesDiffMap props) { protected Object extractProperty(ReactStylesDiffMap props) {
return props.getFloat(mPropName, mDefaultValue); return props.getFloat(mPropName, mDefaultValue);
} }
} }
@@ -196,7 +196,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) { protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
return props.getArray(mPropName); return props.getArray(mPropName);
} }
} }
@@ -208,7 +208,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) { protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
return props.getMap(mPropName); return props.getMap(mPropName);
} }
} }
@@ -220,7 +220,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) { protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
return props.getString(mPropName); return props.getString(mPropName);
} }
} }
@@ -232,7 +232,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) { protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
if (!props.isNull(mPropName)) { if (!props.isNull(mPropName)) {
return props.getBoolean(mPropName, /* ignored */ false) ? Boolean.TRUE : Boolean.FALSE; return props.getBoolean(mPropName, /* ignored */ false) ? Boolean.TRUE : Boolean.FALSE;
} }
@@ -251,7 +251,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
} }
@Override @Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) { protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
if (!props.isNull(mPropName)) { if (!props.isNull(mPropName)) {
return props.getInt(mPropName, /* ignored */ 0); return props.getInt(mPropName, /* ignored */ 0);
} }

View File

@@ -11,7 +11,7 @@ package com.facebook.react.views.art;
import android.view.View; import android.view.View;
import com.facebook.react.uimanager.CatalystStylesDiffMap; import com.facebook.react.uimanager.ReactStylesDiffMap;
import com.facebook.react.uimanager.ReactShadowNode; import com.facebook.react.uimanager.ReactShadowNode;
import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewManager; import com.facebook.react.uimanager.ViewManager;

View File

@@ -17,7 +17,7 @@ import android.graphics.Paint;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException; import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.CatalystStylesDiffMap; import com.facebook.react.uimanager.ReactStylesDiffMap;
import com.facebook.react.uimanager.DisplayMetricsHolder; import com.facebook.react.uimanager.DisplayMetricsHolder;
import com.facebook.react.uimanager.annotations.ReactProp; import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.ReactShadowNode; import com.facebook.react.uimanager.ReactShadowNode;

View File

@@ -12,7 +12,7 @@ package com.facebook.react.views.art;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.CatalystStylesDiffMap; import com.facebook.react.uimanager.ReactStylesDiffMap;
/** /**
* Contains static helper methods for accessing props. * Contains static helper methods for accessing props.

View File

@@ -10,7 +10,7 @@
package com.facebook.react.views.text; package com.facebook.react.views.text;
import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.uimanager.CatalystStylesDiffMap; import com.facebook.react.uimanager.ReactStylesDiffMap;
import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.uimanager.ThemedReactContext;
/** /**

View File

@@ -12,7 +12,7 @@ package com.facebook.react.views.view;
import android.graphics.Rect; import android.graphics.Rect;
import android.view.View; import android.view.View;
import com.facebook.react.uimanager.CatalystStylesDiffMap; import com.facebook.react.uimanager.ReactStylesDiffMap;
/** /**
* Interface that should be implemented by {@link View} subclasses that support * Interface that should be implemented by {@link View} subclasses that support
@@ -52,7 +52,7 @@ public interface ReactClippingViewGroup {
* *
* Helper method {@link ReactClippingViewGroupHelper#applyRemoveClippedSubviewsProperty} may be * Helper method {@link ReactClippingViewGroupHelper#applyRemoveClippedSubviewsProperty} may be
* used by {@link ViewManager} subclass to apply this property based on property update map * used by {@link ViewManager} subclass to apply this property based on property update map
* {@link CatalystStylesDiffMap}. * {@link ReactStylesDiffMap}.
*/ */
void setRemoveClippedSubviews(boolean removeClippedSubviews); void setRemoveClippedSubviews(boolean removeClippedSubviews);

View File

@@ -15,7 +15,7 @@ import android.graphics.Rect;
import android.view.View; import android.view.View;
import android.view.ViewParent; import android.view.ViewParent;
import com.facebook.react.uimanager.CatalystStylesDiffMap; import com.facebook.react.uimanager.ReactStylesDiffMap;
/** /**
* Provides implementation of common tasks for view and it's view manager supporting property * Provides implementation of common tasks for view and it's view manager supporting property

View File

@@ -315,7 +315,7 @@ import com.facebook.csslayout.Spacing;
} }
private int getBorderColor(int position) { private int getBorderColor(int position) {
// Check CatalystStylesDiffMap#getColorInt() to see why this is needed // Check ReactStylesDiffMap#getColorInt() to see why this is needed
return mBorderColor != null ? (int) (long) mBorderColor.get(position) : DEFAULT_BORDER_COLOR; return mBorderColor != null ? (int) (long) mBorderColor.get(position) : DEFAULT_BORDER_COLOR;
} }
} }

View File

@@ -23,7 +23,7 @@ import android.view.ViewGroup;
import com.facebook.infer.annotation.Assertions; import com.facebook.infer.annotation.Assertions;
import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.touch.CatalystInterceptingViewGroup; import com.facebook.react.touch.ReactInterceptingViewGroup;
import com.facebook.react.touch.OnInterceptTouchEventListener; import com.facebook.react.touch.OnInterceptTouchEventListener;
import com.facebook.react.uimanager.MeasureSpecAssertions; import com.facebook.react.uimanager.MeasureSpecAssertions;
import com.facebook.react.uimanager.PointerEvents; import com.facebook.react.uimanager.PointerEvents;
@@ -34,7 +34,7 @@ import com.facebook.react.uimanager.ReactPointerEventsView;
* initializes most of the storage needed for them. * initializes most of the storage needed for them.
*/ */
public class ReactViewGroup extends ViewGroup implements public class ReactViewGroup extends ViewGroup implements
CatalystInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView { ReactInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView {
private static final int ARRAY_CAPACITY_INCREMENT = 12; private static final int ARRAY_CAPACITY_INCREMENT = 12;
private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT; private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;

View File

@@ -9,9 +9,9 @@
package com.facebook.react.bridge; package com.facebook.react.bridge;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration; import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationImpl; import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec; import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.facebook.react.bridge.queue.MessageQueueThreadSpec; import com.facebook.react.bridge.queue.MessageQueueThreadSpec;
import com.facebook.react.bridge.queue.QueueThreadExceptionHandler; import com.facebook.react.bridge.queue.QueueThreadExceptionHandler;
import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.UIManagerModule;
@@ -38,14 +38,14 @@ public class ReactTestHelper {
} }
/** /**
* @return a CatalystInstance mock that has a default working CatalystQueueConfiguration. * @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
*/ */
public static CatalystInstance createMockCatalystInstance() { public static CatalystInstance createMockCatalystInstance() {
CatalystQueueConfigurationSpec spec = CatalystQueueConfigurationSpec.builder() ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
.setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec()) .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
.setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec()) .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
.build(); .build();
CatalystQueueConfiguration catalystQueueConfiguration = CatalystQueueConfigurationImpl.create( ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
spec, spec,
new QueueThreadExceptionHandler() { new QueueThreadExceptionHandler() {
@Override @Override
@@ -55,7 +55,7 @@ public class ReactTestHelper {
}); });
CatalystInstance reactInstance = mock(CatalystInstance.class); CatalystInstance reactInstance = mock(CatalystInstance.class);
when(reactInstance.getCatalystQueueConfiguration()).thenReturn(catalystQueueConfiguration); when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
when(reactInstance.getNativeModule(UIManagerModule.class)) when(reactInstance.getNativeModule(UIManagerModule.class))
.thenReturn(mock(UIManagerModule.class)); .thenReturn(mock(UIManagerModule.class));

View File

@@ -345,7 +345,7 @@ public class MyCustomViewManager extends SimpleViewManager<MyCustomView> {
} }
@Override @Override
public void updateView(MyCustomView view, CatalystStylesDiffMap props) { public void updateView(MyCustomView view, ReactStylesDiffMap props) {
super.updateView(view, props); super.updateView(view, props);
if (props.hasKey(PROP_MY_CUSTOM_PROPERTY)) { if (props.hasKey(PROP_MY_CUSTOM_PROPERTY)) {