diff --git a/android/app/src/main/java/com/massive/MainActivity.kt b/android/app/src/main/java/com/massive/MainActivity.kt index 4eb09d9..179b082 100644 --- a/android/app/src/main/java/com/massive/MainActivity.kt +++ b/android/app/src/main/java/com/massive/MainActivity.kt @@ -1,33 +1,5 @@ package com.massive -import android.os.Bundle -import com.facebook.react.ReactActivity -import com.facebook.react.ReactActivityDelegate -import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled -import com.facebook.react.defaults.DefaultReactActivityDelegate +import com.reactnativenavigation.NavigationActivity -class MainActivity : ReactActivity() { - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun getMainComponentName(): String? { - return "massive" - } - - /** - * Returns the instance of the [ReactActivityDelegate]. Here we use a util class [ ] which allows you to easily enable Fabric and Concurrent React - * (aka React 18) with two boolean flags. - */ - override fun createReactActivityDelegate(): ReactActivityDelegate { - return DefaultReactActivityDelegate( - this, - mainComponentName!!, // If you opted-in for the New Architecture, we enable the Fabric Renderer. - fabricEnabled - ) - } - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(null) - } -} \ No newline at end of file +class MainActivity : NavigationActivity() \ No newline at end of file diff --git a/android/app/src/main/java/com/massive/MainApplication.kt b/android/app/src/main/java/com/massive/MainApplication.kt index 9d3baa7..6b04423 100644 --- a/android/app/src/main/java/com/massive/MainApplication.kt +++ b/android/app/src/main/java/com/massive/MainApplication.kt @@ -8,9 +8,11 @@ import com.facebook.react.ReactPackage import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.soloader.SoLoader +import com.reactnativenavigation.NavigationApplication +import com.reactnativenavigation.react.NavigationReactNativeHost -class MainApplication : Application(), ReactApplication { - private val mReactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) { +class MainApplication : NavigationApplication() { + private val mReactNativeHost = object : NavigationReactNativeHost(this) { override fun getUseDeveloperSupport(): Boolean { return BuildConfig.DEBUG } @@ -37,7 +39,6 @@ class MainApplication : Application(), ReactApplication { override fun onCreate() { super.onCreate() - SoLoader.init(this, /* native exopackage */false) if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { // If you opted-in for the New Architecture, we load the native entry point for this app. load() diff --git a/android/build.gradle b/android/build.gradle index 256d913..dec5453 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,14 +9,19 @@ buildscript { // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" + kotlinVersion = "1.8.22" + RNNKotlinVersion = kotlinVersion } repositories { google() + jcenter() + mavenCentral() + mavenLocal() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") } } diff --git a/index.js b/index.js index a850d03..a4f03d5 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,22 @@ * @format */ -import {AppRegistry} from 'react-native'; -import App from './App'; -import {name as appName} from './app.json'; +import { Navigation } from "react-native-navigation"; +import App from './App' -AppRegistry.registerComponent(appName, () => App); +Navigation.registerComponent('com.massive.WelcomeScreen', () => App) +Navigation.events().registerAppLaunchedListener(() => { + Navigation.setRoot({ + root: { + stack: { + children: [ + { + component: { + name: 'com.myApp.WelcomeScreen' + } + } + ] + } + } + }); +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 41452d6..a42d3c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "massive", - "version": "2.23", + "version": "2.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "massive", - "version": "2.23", + "version": "2.24", "license": "GPL-3.0-only", "dependencies": { "@babel/plugin-proposal-class-properties": "^7.18.6", @@ -34,6 +34,7 @@ "react-native-file-access": "^3.0.4", "react-native-gesture-handler": "^2.12.0", "react-native-linear-gradient": "^2.7.3", + "react-native-navigation": "^7.38.1", "react-native-pager-view": "^6.2.0", "react-native-paper": "^5.9.1", "react-native-permissions": "^3.10.1", @@ -9615,6 +9616,11 @@ "version": "18.2.0", "license": "MIT" }, + "node_modules/react-lifecycles-compat": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-2.0.0.tgz", + "integrity": "sha512-txfpPCQYiazVdcbMRhatqWKcAxJweUu2wDXvts5/7Wyp6+Y9cHojqXHsLPEckzutfHlxZhG8Oiundbmp8Fd6eQ==" + }, "node_modules/react-native": { "version": "0.72.3", "license": "MIT", @@ -9729,6 +9735,36 @@ "react-native": "*" } }, + "node_modules/react-native-navigation": { + "version": "7.38.1", + "resolved": "https://registry.npmjs.org/react-native-navigation/-/react-native-navigation-7.38.1.tgz", + "integrity": "sha512-NMGXJjSWe9qfWRjuvWODV+egUYkQ6Emx4MMF/Ccf0LtikgfYzIUPm5vXXPW/BVEk24PGO1CDUFCVYAZmERZtdQ==", + "dependencies": { + "hoist-non-react-statics": "3.x.x", + "lodash": "4.17.x", + "prop-types": "15.x.x", + "react-lifecycles-compat": "2.0.0", + "tslib": "1.9.3" + }, + "bin": { + "rnn-link": "autolink/postlink/run.js" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "remx": "*" + }, + "peerDependenciesMeta": { + "remx": { + "optional": true + } + } + }, + "node_modules/react-native-navigation/node_modules/tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, "node_modules/react-native-pager-view": { "version": "6.2.0", "license": "MIT", diff --git a/package.json b/package.json index 3c52213..4dd3781 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "react-native-file-access": "^3.0.4", "react-native-gesture-handler": "^2.12.0", "react-native-linear-gradient": "^2.7.3", + "react-native-navigation": "^7.38.1", "react-native-pager-view": "^6.2.0", "react-native-paper": "^5.9.1", "react-native-permissions": "^3.10.1", @@ -71,4 +72,4 @@ "engines": { "node": ">=16" } -} \ No newline at end of file +}