hybrid-navigation 2.13.15 → 2.13.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,20 +42,12 @@ public class ReactAppCompatActivity extends AwesomeActivity implements DefaultHa
42
42
  activityDelegate.onCreate(savedInstanceState);
43
43
  ReactBridgeManager bridgeManager = getReactBridgeManager();
44
44
  bridgeManager.addReactModuleRegisterListener(this);
45
+
45
46
  if (isReactModuleRegisterCompleted()) {
46
- inflateStyle();
47
- ensureViewHierarchy(bridgeManager);
47
+ onReactModuleRegisterCompleted();
48
48
  }
49
49
  }
50
-
51
- private void ensureViewHierarchy(ReactBridgeManager bridgeManager) {
52
- Fragment fragment = getSupportFragmentManager().findFragmentById(android.R.id.content);
53
- if (fragment instanceof AwesomeFragment) {
54
- FLog.i(TAG, "ReactAppCompatActivity#ensureViewHierarchy");
55
- bridgeManager.setViewHierarchyReady(true);
56
- }
57
- }
58
-
50
+
59
51
  public void inflateStyle() {
60
52
  Style style = getStyle();
61
53
  GlobalStyle globalStyle = Garden.getGlobalStyle();
@@ -80,7 +72,11 @@ public class ReactAppCompatActivity extends AwesomeActivity implements DefaultHa
80
72
  activityDelegate.onResume();
81
73
  }
82
74
  inflateStyle();
83
- createMainComponent();
75
+ // 部分手机,如三星,Activity 销毁后重建,不会重建 Fragment。
76
+ Fragment fragment = getSupportFragmentManager().findFragmentById(android.R.id.content);
77
+ if (fragment == null) {
78
+ createMainComponent();
79
+ }
84
80
  }
85
81
 
86
82
  private void createMainComponent() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "2.13.15",
4
+ "version": "2.13.17",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",