Skip to content

Commit

Permalink
react native navigation
Browse files Browse the repository at this point in the history
Signed-off-by: andrey <[email protected]>
  • Loading branch information
flexsurfer committed Jun 14, 2021
1 parent 0e12360 commit 5f719ac
Show file tree
Hide file tree
Showing 181 changed files with 5,324 additions and 4,016 deletions.
23 changes: 3 additions & 20 deletions android/app/src/main/java/im/status/ethereum/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

import com.facebook.react.ReactFragmentActivity;
import com.facebook.react.ReactActivity;
import com.reactnativenavigation.NavigationActivity;
import com.facebook.react.modules.core.PermissionListener;
import org.devio.rn.splashscreen.SplashScreen;

import java.util.Properties;
import im.status.ethereum.module.StatusThreadPoolExecutor;

public class MainActivity extends ReactFragmentActivity
public class MainActivity extends NavigationActivity
implements ActivityCompat.OnRequestPermissionsResultCallback{


Expand Down Expand Up @@ -178,14 +178,7 @@ protected void onDestroy() {
super.onDestroy();
}

/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "StatusIm";
}


@Override
public void onConfigurationChanged(Configuration newConfig) {
Expand Down Expand Up @@ -242,14 +235,4 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
mPermissionListener = null;
}
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.reactnativenavigation.NavigationApplication;
import com.reactnativenavigation.react.NavigationReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import com.facebook.react.ReactInstanceManager;

import java.util.List;
Expand All @@ -20,9 +21,9 @@
import im.status.ethereum.module.StatusPackage;
import im.status.ethereum.pushnotifications.PushNotificationPackage;

public class MainApplication extends MultiDexApplication implements ReactApplication {
public class MainApplication extends NavigationApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
private final ReactNativeHost mReactNativeHost = new NavigationReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
Expand Down Expand Up @@ -54,7 +55,7 @@ public ReactNativeHost getReactNativeHost() {
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);

WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG_WEBVIEW == "1");
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
Expand Down
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Project-wide gradle configuration properties for use by all modules
*/
ext {
RNNKotlinVersion = "1.4.31"
buildToolsVersion = project.buildToolsVersion
minSdkVersion = Integer.valueOf(project.minSdkVersion)
compileSdkVersion = Integer.valueOf(project.compileSdkVersion)
Expand All @@ -19,6 +20,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31"
classpath "com.android.tools.build:gradle:${project.ext.gradlePluginVersion}"
// WARNING: Do not place your application dependencies here!
// They belong in the individual module build.gradle files.
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '10.0'
platform :ios, '11.0'

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
Expand Down
54 changes: 44 additions & 10 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ PODS:
- React
- ReactNativeDarkMode (0.2.2):
- React
- ReactNativeNavigation (7.13.0):
- React-Core
- React-RCTImage
- React-RCTText
- ReactNativeNavigation/Core (= 7.13.0)
- ReactNativeNavigation/Core (7.13.0):
- React-Core
- React-RCTImage
- React-RCTText
- RNCAsyncStorage (1.11.0):
- React
- RNCClipboard (1.2.2):
Expand Down Expand Up @@ -321,10 +330,35 @@ PODS:
- React
- RNReactNativeHapticFeedback (1.9.0):
- React
- RNReanimated (1.13.0):
- React
- RNScreens (2.10.1):
- RNReanimated (2.1.0):
- DoubleConversion
- FBLazyVector
- FBReactNativeSpec
- Folly
- glog
- RCTRequired
- RCTTypeSafety
- React
- React-callinvoker
- React-Core
- React-Core/DevSupport
- React-Core/RCTWebSocket
- React-CoreModules
- React-cxxreact
- React-jsi
- React-jsiexecutor
- React-jsinspector
- React-RCTActionSheet
- React-RCTAnimation
- React-RCTBlob
- React-RCTImage
- React-RCTLinking
- React-RCTNetwork
- React-RCTSettings
- React-RCTText
- React-RCTVibration
- ReactCommon/turbomodule/core
- Yoga
- RNSVG (9.13.6):
- React
- secp256k1 (0.1.6)
Expand Down Expand Up @@ -387,6 +421,7 @@ DEPENDENCIES:
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "ReactNativeAudioToolkit (from `../node_modules/@react-native-community/audio-toolkit`)"
- ReactNativeDarkMode (from `../node_modules/react-native-dark-mode`)
- ReactNativeNavigation (from `../node_modules/react-native-navigation`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
- "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)"
Expand All @@ -400,7 +435,6 @@ DEPENDENCIES:
- RNPermissions (from `../node_modules/react-native-permissions`)
- RNReactNativeHapticFeedback (from `../node_modules/react-native-haptic-feedback`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNSVG (from `../node_modules/react-native-svg`)
- secp256k1 (from `https://github.com/status-im/secp256k1.swift.git`)
- SQLCipher (~> 3.0)
Expand Down Expand Up @@ -507,6 +541,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/audio-toolkit"
ReactNativeDarkMode:
:path: "../node_modules/react-native-dark-mode"
ReactNativeNavigation:
:path: "../node_modules/react-native-navigation"
RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage"
RNCClipboard:
Expand All @@ -533,8 +569,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-haptic-feedback"
RNReanimated:
:path: "../node_modules/react-native-reanimated"
RNScreens:
:path: "../node_modules/react-native-screens"
RNSVG:
:path: "../node_modules/react-native-svg"
secp256k1:
Expand Down Expand Up @@ -562,7 +596,7 @@ SPEC CHECKSUMS:
FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
glog: cee4319f395bad5865ef3f32466c2e0ae677432c
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
Keycard: dd96182888da0aacf4de821b641103143bbb26cc
Permission-Camera: afad27bf90337684d4a86f3825112d648c8c4d3b
Permission-Microphone: 0ffabc3fe1c75cfb260525ee3f529383c9f4368c
Expand Down Expand Up @@ -602,6 +636,7 @@ SPEC CHECKSUMS:
ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b
ReactNativeAudioToolkit: de9610f323e855ac6574be8c99621f3d57c5df06
ReactNativeDarkMode: 0178ffca3b10f6a7c9f49d6f9810232b328fa949
ReactNativeNavigation: 4c4ca87edc0da4ee818158a62cb6188088454e5c
RNCAsyncStorage: d059c3ee71738c39834a627476322a5a8cd5bf36
RNCClipboard: 8148e21ac347c51fd6cd4b683389094c216bb543
RNCMaskedView: 71fc32d971f03b7f03d6ab6b86b730c4ee64f5b6
Expand All @@ -614,8 +649,7 @@ SPEC CHECKSUMS:
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
RNReactNativeHapticFeedback: 2566b468cc8d0e7bb2f84b23adc0f4614594d071
RNReanimated: 89f5e0a04d1dd52fbf27e7e7030d8f80a646a3fc
RNScreens: b748efec66e095134c7166ca333b628cd7e6f3e2
RNReanimated: 70f662b5232dd5d19ccff581e919a54ea73df51c
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
secp256k1: f61d67e6fdcb85fd727acf1bf35ace6036db540c
SQLCipher: f9fcf29b2e59ced7defc2a2bdd0ebe79b40d4990
Expand All @@ -624,6 +658,6 @@ SPEC CHECKSUMS:
TouchID: ba4c656d849cceabc2e4eef722dea5e55959ecf4
Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6

PODFILE CHECKSUM: 3df5a5ce6c538b5f3727cb3ee1c20bf66d7ac3eb
PODFILE CHECKSUM: 27b3929c4d7f0b5afd76276d0bd4ae289ec11f18

COCOAPODS: 1.10.0
23 changes: 7 additions & 16 deletions ios/StatusIm/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#import "AppDelegate.h"
#import <ReactNativeNavigation/ReactNativeNavigation.h>

#import <asl.h>
#import "ReactNativeConfig.h"
Expand All @@ -18,7 +19,6 @@

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

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

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"StatusIm"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
_blankView = [[UIView alloc]initWithFrame:self.window.frame];
_blankView.backgroundColor = [UIColor whiteColor];
_blankView.alpha = 0;

UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[ReactNativeNavigation bootstrapWithDelegate:self launchOptions:launchOptions];

[RNSplashScreen show];

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

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
return [ReactNativeNavigation extraModulesForBridge:bridge];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
Expand Down
2 changes: 1 addition & 1 deletion ios/StatusIm/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<true/>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A00000080400010101</string>
Expand Down
2 changes: 1 addition & 1 deletion ios/StatusImPR/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<true/>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A00000080400010101</string>
Expand Down
Loading

0 comments on commit 5f719ac

Please sign in to comment.