/** * Initialize all the native modules */ @VisibleForTesting @Override public void initialize() { UiThreadUtil.assertOnUiThread(); Assertions.assertCondition( !mInitialized, "This catalyst instance has already been initialized"); // We assume that the instance manager blocks on running the JS bundle. If // that changes, then we need to set mAcceptCalls just after posting the // task that will run the js bundle. Assertions.assertCondition( mAcceptCalls, "RunJSBundle hasn't completed."); mInitialized = true; mNativeModulesQueueThread.runOnQueue(new Runnable() { @Override public void run() { mJavaRegistry.notifyJSInstanceInitialized(); } }); }
/** * Initialize all the native modules */ @VisibleForTesting @Override public void initialize() { UiThreadUtil.assertOnUiThread(); Assertions.assertCondition( !mInitialized, "This catalyst instance has already been initialized"); // We assume that the instance manager blocks on running the JS bundle. If // that changes, then we need to set mAcceptCalls just after posting the // task that will run the js bundle. Assertions.assertCondition( mAcceptCalls, "RunJSBundle hasn't completed."); mInitialized = true; mJavaRegistry.notifyCatalystInstanceInitialized(); }
@VisibleForTesting public int getBackgroundColor() { if (getBackground() != null) { return ((ReactViewBackgroundDrawable) getBackground()).getColor(); } return DEFAULT_BACKGROUND_COLOR; }
/** * Initialize all the native modules */ @VisibleForTesting @Override public void initialize() { UiThreadUtil.assertOnUiThread(); Assertions.assertCondition( !mInitialized, "This catalyst instance has already been initialized"); mInitialized = true; mJavaRegistry.notifyCatalystInstanceInitialized(); }
/** * Is used by unit test to setup mWasMeasured and mIsAttachedToWindow flags, that will let this * view to be properly attached to catalyst instance by startReactApplication call */ @VisibleForTesting /* package */ void simulateAttachForTesting() { mIsAttachedToWindow = true; mIsAttachedToInstance = true; mWasMeasured = true; }
@VisibleForTesting public int getColor() { return mColor; }
@VisibleForTesting public int getMode() { return mMode; }
@VisibleForTesting public @Nullable Dialog getDialog() { return mDialog; }
@VisibleForTesting void setGlobalVariable(String propName, String jsonValue);
@VisibleForTesting public @Nullable ReactContext getCurrentReactContext() { return mCurrentReactContext; }
/** * Is used by unit test to setup mWasMeasured and mIsAttachedToWindow flags, that will let this * view to be properly attached to catalyst instance by startReactApplication call */ @VisibleForTesting /* package */ void simulateAttachForTesting() { mIsAttachedToInstance = true; mWasMeasured = true; }
@VisibleForTesting @Override public void setGlobalVariable(String propName, String jsonValue) { mBridge.setGlobalVariable(propName, jsonValue); }
@VisibleForTesting @Override public @Nullable ReactContext getCurrentReactContext() { return mCurrentReactContext; }
@VisibleForTesting public abstract @Nullable ReactContext getCurrentReactContext();