add expo dependencies

This commit is contained in:
Vincent BRIDIER 2022-09-30 16:21:14 +02:00
parent 24ef2334f7
commit 49b26e1a3b
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
8 changed files with 7993 additions and 144 deletions

View file

@ -3,4 +3,5 @@
- i18n-js
- @react-native-community/netinfo
- axios
- lodash
- lodash
- expo

View file

@ -1,5 +1,7 @@
package com.comapp;
import expo.modules.ReactActivityDelegateWrapper;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
@ -22,7 +24,8 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new MainActivityDelegate(this, getMainComponentName());
//return new MainActivityDelegate(this, getMainComponentName());
return new ReactActivityDelegateWrapper(this, new MainActivityDelegate(this, getMainComponentName()));
}
public static class MainActivityDelegate extends ReactActivityDelegate {

View file

@ -1,5 +1,9 @@
package com.comapp;
import android.content.res.Configuration;
import expo.modules.ApplicationLifecycleDispatcher;
import expo.modules.ReactNativeHostWrapper;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
@ -16,7 +20,8 @@ import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
//new ReactNativeHost(this) {
new ReactNativeHostWrapper(this, new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
@ -35,13 +40,16 @@ public class MainApplication extends Application implements ReactApplication {
protected String getJSMainModuleName() {
return "index";
}
};
//};
});
private final ReactNativeHost mNewArchitectureNativeHost =
new MainApplicationReactNativeHost(this);
//new MainApplicationReactNativeHost(this);
new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));
@Override
public ReactNativeHost getReactNativeHost() {
ApplicationLifecycleDispatcher.onApplicationCreate(this);
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
return mNewArchitectureNativeHost;
} else {
@ -88,4 +96,10 @@ public class MainApplication extends Application implements ReactApplication {
}
}
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
}

View file

@ -9,3 +9,6 @@ if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true")
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()

6216
ComApp/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,6 +12,7 @@
"dependencies": {
"@react-native-community/netinfo": "^9.3.2",
"axios": "^0.27.2",
"expo": "^46.0.13",
"i18n-js": "^4.1.1",
"install": "^0.13.0",
"lodash": "^4.17.21",

View file

@ -9,6 +9,9 @@ import NetInfo from "@react-native-community/netinfo";
import i18n from "../../I18n";
// Database
import { Setting } from "../../Database";
// FileSytem
import * as FileSystem from 'expo-file-system';
const api_token = 'toto';

File diff suppressed because it is too large Load diff