mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-10 10:00:16 +08:00
Make the new bridge the default
Reviewed By: astreet Differential Revision: D3507482 fbshipit-source-id: b62f3bf0fe1dd4f49594e441f4e00b9e20ec972b
This commit is contained in:
committed by
Facebook Github Bot 2
parent
1a0c69f4b7
commit
bf79f87895
@@ -195,7 +195,7 @@ public abstract class ReactInstanceManager {
|
||||
protected @Nullable Activity mCurrentActivity;
|
||||
protected @Nullable DefaultHardwareBackBtnHandler mDefaultHardwareBackBtnHandler;
|
||||
protected @Nullable RedBoxHandler mRedBoxHandler;
|
||||
protected boolean mUseNewBridge;
|
||||
protected boolean mUseOldBridge;
|
||||
|
||||
protected Builder() {
|
||||
}
|
||||
@@ -310,8 +310,8 @@ public abstract class ReactInstanceManager {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setUseNewBridge() {
|
||||
mUseNewBridge = true;
|
||||
public Builder setUseOldBridge(boolean enable) {
|
||||
mUseOldBridge = enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -339,8 +339,8 @@ public abstract class ReactInstanceManager {
|
||||
mUIImplementationProvider = new UIImplementationProvider();
|
||||
}
|
||||
|
||||
if (mUseNewBridge) {
|
||||
return new XReactInstanceManagerImpl(
|
||||
if (mUseOldBridge) {
|
||||
return new ReactInstanceManagerImpl(
|
||||
Assertions.assertNotNull(
|
||||
mApplication,
|
||||
"Application property has not been set with this builder"),
|
||||
@@ -357,7 +357,7 @@ public abstract class ReactInstanceManager {
|
||||
mJSCConfig,
|
||||
mRedBoxHandler);
|
||||
} else {
|
||||
return new ReactInstanceManagerImpl(
|
||||
return new XReactInstanceManagerImpl(
|
||||
Assertions.assertNotNull(
|
||||
mApplication,
|
||||
"Application property has not been set with this builder"),
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
package com.facebook.react;
|
||||
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.uimanager.UIImplementationProvider;
|
||||
|
||||
public abstract class XReactInstanceManager {
|
||||
/**
|
||||
* Creates a builder that is defaulted to using the new bridge.
|
||||
*/
|
||||
public static ReactInstanceManager.Builder builder() {
|
||||
return new ReactInstanceManager.Builder().setUseNewBridge();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user