Skip to content

Commit 5f719ac

Browse files
committed
react native navigation
Signed-off-by: andrey <motor4ik@gmail.com>
1 parent 0e12360 commit 5f719ac

File tree

181 files changed

+5324
-4016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+5324
-4016
lines changed

android/app/src/main/java/im/status/ethereum/MainActivity.java

+3-20
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
2727

2828
import com.facebook.react.ReactFragmentActivity;
29-
import com.facebook.react.ReactActivity;
29+
import com.reactnativenavigation.NavigationActivity;
3030
import com.facebook.react.modules.core.PermissionListener;
3131
import org.devio.rn.splashscreen.SplashScreen;
3232

3333
import java.util.Properties;
3434
import im.status.ethereum.module.StatusThreadPoolExecutor;
3535

36-
public class MainActivity extends ReactFragmentActivity
36+
public class MainActivity extends NavigationActivity
3737
implements ActivityCompat.OnRequestPermissionsResultCallback{
3838

3939

@@ -178,14 +178,7 @@ protected void onDestroy() {
178178
super.onDestroy();
179179
}
180180

181-
/**
182-
* Returns the name of the main component registered from JavaScript.
183-
* This is used to schedule rendering of the component.
184-
*/
185-
@Override
186-
protected String getMainComponentName() {
187-
return "StatusIm";
188-
}
181+
189182

190183
@Override
191184
public void onConfigurationChanged(Configuration newConfig) {
@@ -242,14 +235,4 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
242235
mPermissionListener = null;
243236
}
244237
}
245-
246-
@Override
247-
protected ReactActivityDelegate createReactActivityDelegate() {
248-
return new ReactActivityDelegate(this, getMainComponentName()) {
249-
@Override
250-
protected ReactRootView createRootView() {
251-
return new RNGestureHandlerEnabledRootView(MainActivity.this);
252-
}
253-
};
254-
}
255238
}

android/app/src/main/java/im/status/ethereum/MainApplication.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
1111
import com.facebook.react.ReactApplication;
1212
import com.facebook.react.ReactNativeHost;
13+
import com.reactnativenavigation.NavigationApplication;
14+
import com.reactnativenavigation.react.NavigationReactNativeHost;
1315
import com.facebook.react.ReactPackage;
14-
import com.facebook.soloader.SoLoader;
1516
import com.facebook.react.ReactInstanceManager;
1617

1718
import java.util.List;
@@ -20,9 +21,9 @@
2021
import im.status.ethereum.module.StatusPackage;
2122
import im.status.ethereum.pushnotifications.PushNotificationPackage;
2223

23-
public class MainApplication extends MultiDexApplication implements ReactApplication {
24+
public class MainApplication extends NavigationApplication {
2425

25-
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
26+
private final ReactNativeHost mReactNativeHost = new NavigationReactNativeHost(this) {
2627
@Override
2728
public boolean getUseDeveloperSupport() {
2829
return BuildConfig.DEBUG;
@@ -54,7 +55,7 @@ public ReactNativeHost getReactNativeHost() {
5455
@Override
5556
public void onCreate() {
5657
super.onCreate();
57-
SoLoader.init(this, /* native exopackage */ false);
58+
5859
WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG_WEBVIEW == "1");
5960
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
6061
}

android/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Project-wide gradle configuration properties for use by all modules
55
*/
66
ext {
7+
RNNKotlinVersion = "1.4.31"
78
buildToolsVersion = project.buildToolsVersion
89
minSdkVersion = Integer.valueOf(project.minSdkVersion)
910
compileSdkVersion = Integer.valueOf(project.compileSdkVersion)
@@ -19,6 +20,7 @@ buildscript {
1920
jcenter()
2021
}
2122
dependencies {
23+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31"
2224
classpath "com.android.tools.build:gradle:${project.ext.gradlePluginVersion}"
2325
// WARNING: Do not place your application dependencies here!
2426
// They belong in the individual module build.gradle files.

ios/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :ios, '10.0'
1+
platform :ios, '11.0'
22

33
require_relative '../node_modules/react-native/scripts/react_native_pods'
44
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

ios/Podfile.lock

+44-10
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ PODS:
290290
- React
291291
- ReactNativeDarkMode (0.2.2):
292292
- React
293+
- ReactNativeNavigation (7.13.0):
294+
- React-Core
295+
- React-RCTImage
296+
- React-RCTText
297+
- ReactNativeNavigation/Core (= 7.13.0)
298+
- ReactNativeNavigation/Core (7.13.0):
299+
- React-Core
300+
- React-RCTImage
301+
- React-RCTText
293302
- RNCAsyncStorage (1.11.0):
294303
- React
295304
- RNCClipboard (1.2.2):
@@ -321,10 +330,35 @@ PODS:
321330
- React
322331
- RNReactNativeHapticFeedback (1.9.0):
323332
- React
324-
- RNReanimated (1.13.0):
325-
- React
326-
- RNScreens (2.10.1):
333+
- RNReanimated (2.1.0):
334+
- DoubleConversion
335+
- FBLazyVector
336+
- FBReactNativeSpec
337+
- Folly
338+
- glog
339+
- RCTRequired
340+
- RCTTypeSafety
327341
- React
342+
- React-callinvoker
343+
- React-Core
344+
- React-Core/DevSupport
345+
- React-Core/RCTWebSocket
346+
- React-CoreModules
347+
- React-cxxreact
348+
- React-jsi
349+
- React-jsiexecutor
350+
- React-jsinspector
351+
- React-RCTActionSheet
352+
- React-RCTAnimation
353+
- React-RCTBlob
354+
- React-RCTImage
355+
- React-RCTLinking
356+
- React-RCTNetwork
357+
- React-RCTSettings
358+
- React-RCTText
359+
- React-RCTVibration
360+
- ReactCommon/turbomodule/core
361+
- Yoga
328362
- RNSVG (9.13.6):
329363
- React
330364
- secp256k1 (0.1.6)
@@ -387,6 +421,7 @@ DEPENDENCIES:
387421
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
388422
- "ReactNativeAudioToolkit (from `../node_modules/@react-native-community/audio-toolkit`)"
389423
- ReactNativeDarkMode (from `../node_modules/react-native-dark-mode`)
424+
- ReactNativeNavigation (from `../node_modules/react-native-navigation`)
390425
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
391426
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
392427
- "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)"
@@ -400,7 +435,6 @@ DEPENDENCIES:
400435
- RNPermissions (from `../node_modules/react-native-permissions`)
401436
- RNReactNativeHapticFeedback (from `../node_modules/react-native-haptic-feedback`)
402437
- RNReanimated (from `../node_modules/react-native-reanimated`)
403-
- RNScreens (from `../node_modules/react-native-screens`)
404438
- RNSVG (from `../node_modules/react-native-svg`)
405439
- secp256k1 (from `https://github.com/status-im/secp256k1.swift.git`)
406440
- SQLCipher (~> 3.0)
@@ -507,6 +541,8 @@ EXTERNAL SOURCES:
507541
:path: "../node_modules/@react-native-community/audio-toolkit"
508542
ReactNativeDarkMode:
509543
:path: "../node_modules/react-native-dark-mode"
544+
ReactNativeNavigation:
545+
:path: "../node_modules/react-native-navigation"
510546
RNCAsyncStorage:
511547
:path: "../node_modules/@react-native-community/async-storage"
512548
RNCClipboard:
@@ -533,8 +569,6 @@ EXTERNAL SOURCES:
533569
:path: "../node_modules/react-native-haptic-feedback"
534570
RNReanimated:
535571
:path: "../node_modules/react-native-reanimated"
536-
RNScreens:
537-
:path: "../node_modules/react-native-screens"
538572
RNSVG:
539573
:path: "../node_modules/react-native-svg"
540574
secp256k1:
@@ -562,7 +596,7 @@ SPEC CHECKSUMS:
562596
FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
563597
FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
564598
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
565-
glog: cee4319f395bad5865ef3f32466c2e0ae677432c
599+
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
566600
Keycard: dd96182888da0aacf4de821b641103143bbb26cc
567601
Permission-Camera: afad27bf90337684d4a86f3825112d648c8c4d3b
568602
Permission-Microphone: 0ffabc3fe1c75cfb260525ee3f529383c9f4368c
@@ -602,6 +636,7 @@ SPEC CHECKSUMS:
602636
ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b
603637
ReactNativeAudioToolkit: de9610f323e855ac6574be8c99621f3d57c5df06
604638
ReactNativeDarkMode: 0178ffca3b10f6a7c9f49d6f9810232b328fa949
639+
ReactNativeNavigation: 4c4ca87edc0da4ee818158a62cb6188088454e5c
605640
RNCAsyncStorage: d059c3ee71738c39834a627476322a5a8cd5bf36
606641
RNCClipboard: 8148e21ac347c51fd6cd4b683389094c216bb543
607642
RNCMaskedView: 71fc32d971f03b7f03d6ab6b86b730c4ee64f5b6
@@ -614,8 +649,7 @@ SPEC CHECKSUMS:
614649
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
615650
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
616651
RNReactNativeHapticFeedback: 2566b468cc8d0e7bb2f84b23adc0f4614594d071
617-
RNReanimated: 89f5e0a04d1dd52fbf27e7e7030d8f80a646a3fc
618-
RNScreens: b748efec66e095134c7166ca333b628cd7e6f3e2
652+
RNReanimated: 70f662b5232dd5d19ccff581e919a54ea73df51c
619653
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
620654
secp256k1: f61d67e6fdcb85fd727acf1bf35ace6036db540c
621655
SQLCipher: f9fcf29b2e59ced7defc2a2bdd0ebe79b40d4990
@@ -624,6 +658,6 @@ SPEC CHECKSUMS:
624658
TouchID: ba4c656d849cceabc2e4eef722dea5e55959ecf4
625659
Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6
626660

627-
PODFILE CHECKSUM: 3df5a5ce6c538b5f3727cb3ee1c20bf66d7ac3eb
661+
PODFILE CHECKSUM: 27b3929c4d7f0b5afd76276d0bd4ae289ec11f18
628662

629663
COCOAPODS: 1.10.0

ios/StatusIm/AppDelegate.m

+7-16
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
#import "AppDelegate.h"
11+
#import <ReactNativeNavigation/ReactNativeNavigation.h>
1112

1213
#import <asl.h>
1314
#import "ReactNativeConfig.h"
@@ -18,7 +19,6 @@
1819

1920
#import <React/RCTBridge.h>
2021
#import <React/RCTBundleURLProvider.h>
21-
#import <React/RCTRootView.h>
2222

2323
#import <UserNotifications/UserNotifications.h>
2424
#import <RNCPushNotificationIOS.h>
@@ -77,21 +77,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
7777
dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"BLANK_PREVIEW"];
7878
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
7979

80-
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
81-
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
82-
moduleName:@"StatusIm"
83-
initialProperties:nil];
84-
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
85-
86-
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
87-
_blankView = [[UIView alloc]initWithFrame:self.window.frame];
88-
_blankView.backgroundColor = [UIColor whiteColor];
89-
_blankView.alpha = 0;
90-
91-
UIViewController *rootViewController = [UIViewController new];
92-
rootViewController.view = rootView;
93-
self.window.rootViewController = rootViewController;
94-
[self.window makeKeyAndVisible];
80+
[ReactNativeNavigation bootstrapWithDelegate:self launchOptions:launchOptions];
81+
9582
[RNSplashScreen show];
9683

9784
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
@@ -116,6 +103,10 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserAct
116103
restorationHandler:restorationHandler];
117104
}
118105

106+
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
107+
return [ReactNativeNavigation extraModulesForBridge:bridge];
108+
}
109+
119110
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
120111
{
121112
#if DEBUG

ios/StatusIm/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
<string>UIInterfaceOrientationLandscapeRight</string>
127127
</array>
128128
<key>UIViewControllerBasedStatusBarAppearance</key>
129-
<false/>
129+
<true/>
130130
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
131131
<array>
132132
<string>A00000080400010101</string>

ios/StatusImPR/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<string>UIInterfaceOrientationLandscapeRight</string>
133133
</array>
134134
<key>UIViewControllerBasedStatusBarAppearance</key>
135-
<false/>
135+
<true/>
136136
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
137137
<array>
138138
<string>A00000080400010101</string>

0 commit comments

Comments
 (0)