Skip to content

Commit 7471e36

Browse files
committed
Fixes after PR
1 parent 4b12594 commit 7471e36

File tree

7 files changed

+34
-47
lines changed

7 files changed

+34
-47
lines changed

e2e/Utils.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,15 @@ const utils = {
6464

6565
},
6666
expectImagesToBeNotEqual: (imagePath, expectedImagePath) => {
67-
let isDifferent = false;
6867
try {
6968
bitmapDiff(imagePath, expectedImagePath);
7069
} catch (error) {
71-
isDifferent = true;
70+
return
7271
}
7372

74-
if (!isDifferent) {
75-
throw new Error(
76-
`Expected bitmaps at '${imagePath}' and '${expectedImagePath}' to be different`,
77-
);
78-
}
73+
throw new Error(
74+
`Expected bitmaps at '${imagePath}' and '${expectedImagePath}' to be different`,
75+
);
7976
},
8077
};
8178

lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void onCreate() {
5353
* @return a singleton {@link ReactGateway}
5454
*/
5555
protected ReactGateway createReactGateway() {
56-
return new ReactGateway(getReactHost(), getReactNativeHost().getUseDeveloperSupport());
56+
return new ReactGateway(getReactHost(), getReactNativeHost());
5757
}
5858

5959
public ReactGateway getReactGateway() {

lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactInitializer.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,15 @@ void onActivityResumed(NavigationActivity activity) {
3737

3838
void onActivityPaused(NavigationActivity activity) {
3939
isActivityReadyForUi = false;
40-
// TODO: Check it needed
41-
//if (reactHost.hasStartedCreatingInitialContext()) {
4240
reactHost.onHostPause(activity);
43-
//}
4441
}
4542

4643
void onActivityDestroyed(NavigationActivity activity) {
4744
reactHost.removeReactInstanceEventListener(this);
48-
//if (reactHost.gehasStartedCreatingInitialContext()) {
4945
reactHost.onHostDestroy(activity);
50-
//}
5146
}
5247

5348
private void prepareReactApp() {
54-
// TODO: Check if needed
55-
//if (shouldCreateContext()) {
5649
reactHost.start();
5750
if (waitingForAppLaunchEvent) {
5851
if (reactHost.getCurrentReactContext() != null) {

lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@
1212

1313
public class ReactGateway {
1414

15-
private final ReactHost host;
16-
private final NavigationReactInitializer initializer;
17-
private final JsDevReloadHandler jsDevReloadHandler;
15+
private final ReactHost host;
16+
private final NavigationReactInitializer initializer;
17+
private final JsDevReloadHandler jsDevReloadHandler;
1818

19-
public ReactGateway(ReactHost host, boolean isDebug) {
19+
public ReactGateway(ReactHost host, ReactNativeHost reactNativeHost) {
2020
this.host = host;
21-
initializer = new NavigationReactInitializer(host, isDebug);
21+
initializer = new NavigationReactInitializer(host, reactNativeHost.getUseDeveloperSupport());
2222
jsDevReloadHandler = new JsDevReloadHandler(host.getDevSupportManager());
2323
if (host instanceof BundleDownloadListenerProvider) {
2424
((BundleDownloadListenerProvider) host).setBundleLoaderListener(jsDevReloadHandler);
2525
}
2626
}
2727

28-
public void onActivityCreated(NavigationActivity activity) {
29-
initializer.onActivityCreated();
28+
public void onActivityCreated(NavigationActivity activity) {
29+
initializer.onActivityCreated();
3030
jsDevReloadHandler.setReloadListener(activity);
31-
}
31+
}
3232

33-
public void onActivityResumed(NavigationActivity activity) {
34-
initializer.onActivityResumed(activity);
35-
jsDevReloadHandler.onActivityResumed(activity);
36-
}
33+
public void onActivityResumed(NavigationActivity activity) {
34+
initializer.onActivityResumed(activity);
35+
jsDevReloadHandler.onActivityResumed(activity);
36+
}
3737

3838
public boolean onNewIntent(Intent intent) {
3939
if (host.getCurrentReactContext() != null) {
@@ -47,22 +47,22 @@ public void onConfigurationChanged(NavigationActivity activity, @NonNull Configu
4747
host.onConfigurationChanged(activity);
4848
}
4949

50-
public void onActivityPaused(NavigationActivity activity) {
51-
initializer.onActivityPaused(activity);
52-
jsDevReloadHandler.onActivityPaused(activity);
53-
}
50+
public void onActivityPaused(NavigationActivity activity) {
51+
initializer.onActivityPaused(activity);
52+
jsDevReloadHandler.onActivityPaused(activity);
53+
}
5454

55-
public void onActivityDestroyed(NavigationActivity activity) {
55+
public void onActivityDestroyed(NavigationActivity activity) {
5656
jsDevReloadHandler.removeReloadListener(activity);
57-
initializer.onActivityDestroyed(activity);
58-
}
57+
initializer.onActivityDestroyed(activity);
58+
}
5959

60-
public boolean onKeyUp(Activity activity, int keyCode) {
61-
return jsDevReloadHandler.onKeyUp(activity, keyCode);
62-
}
60+
public boolean onKeyUp(Activity activity, int keyCode) {
61+
return jsDevReloadHandler.onKeyUp(activity, keyCode);
62+
}
6363

6464
public void onBackPressed() {
65-
host.onBackPressed();
65+
host.onBackPressed();
6666
}
6767

6868
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"@typescript-eslint/parser": "8.21.0",
9999
"babel-jest": "^27.0.0",
100100
"clang-format": "^1.4.0",
101-
"detox": "20.33.0-prerelease.0",
101+
"detox": "20.34.4",
102102
"detox-testing-library-rnn-adapter": "^2.0.3",
103103
"eslint": "^8.19.0",
104104
"eslint-config-prettier": "6.11.0",

scripts/start.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ if (isWindows) runWin32();
1111
else run();
1212

1313
function run() {
14-
//exec.killPort(8081);
15-
//exec.execSync(`watchman watch-del-all || true`);
16-
//exec.execSync(`adb reverse tcp:8081 tcp:8081 || true`);
1714
exec.execSync(`react-native start --sourceExts ${sourceExts}`);
1815
}
1916

2017
function runWin32() {
21-
//exec.execSync(`adb reverse tcp:8081 tcp:8081`);
2218
exec.execSync(`react-native start --sourceExts ${sourceExts}`);
2319
}

0 commit comments

Comments
 (0)