-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from VerusCoin/dev
v1.0.20
- Loading branch information
Showing
109 changed files
with
2,466 additions
and
2,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 39 additions & 78 deletions
117
android/app/src/main/java/com/verusmobile/MainApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,62 @@ | ||
package com.verusmobile; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
import com.facebook.react.PackageList; | ||
|
||
import com.facebook.react.ReactApplication; | ||
import com.facebook.react.ReactInstanceManager; | ||
import com.facebook.react.ReactNativeHost; | ||
import com.facebook.react.ReactPackage; | ||
import com.facebook.react.config.ReactFeatureFlags; | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; | ||
import com.facebook.react.defaults.DefaultReactNativeHost; | ||
import com.facebook.soloader.SoLoader; | ||
|
||
import com.facebook.react.bridge.JSIModulePackage; | ||
import com.swmansion.reanimated.ReanimatedJSIModulePackage; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
import java.util.List; | ||
|
||
|
||
public class MainApplication extends Application implements ReactApplication { | ||
|
||
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { | ||
@Override | ||
public boolean getUseDeveloperSupport() { | ||
return BuildConfig.DEBUG; | ||
} | ||
|
||
@Override | ||
protected List<ReactPackage> getPackages() { | ||
@SuppressWarnings("UnnecessaryLocalVariable") | ||
List<ReactPackage> packages = new PackageList(this).getPackages(); | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// packages.add(new MyReactNativePackage()); | ||
return packages; | ||
} | ||
|
||
@Override | ||
protected String getJSMainModuleName() { | ||
return "index"; | ||
} | ||
|
||
@Override | ||
protected JSIModulePackage getJSIModulePackage() { | ||
return new ReanimatedJSIModulePackage(); // <- add | ||
} | ||
}; | ||
|
||
// private final ReactNativeHost mNewArchitectureNativeHost = new MainApplicationReactNativeHost(this); | ||
public class MainApplication extends Application implements ReactApplication { | ||
|
||
private final ReactNativeHost mReactNativeHost = | ||
new DefaultReactNativeHost(this) { | ||
@Override | ||
public boolean getUseDeveloperSupport() { | ||
return BuildConfig.DEBUG; | ||
} | ||
|
||
@Override | ||
protected List<ReactPackage> getPackages() { | ||
@SuppressWarnings("UnnecessaryLocalVariable") | ||
List<ReactPackage> packages = new PackageList(this).getPackages(); | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// packages.add(new MyReactNativePackage()); | ||
return packages; | ||
} | ||
|
||
@Override | ||
protected String getJSMainModuleName() { | ||
return "index"; | ||
} | ||
|
||
@Override | ||
protected boolean isNewArchEnabled() { | ||
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; | ||
} | ||
|
||
@Override | ||
protected Boolean isHermesEnabled() { | ||
return BuildConfig.IS_HERMES_ENABLED; | ||
} | ||
}; | ||
|
||
@Override | ||
public ReactNativeHost getReactNativeHost() { | ||
return mReactNativeHost; | ||
// if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// return mNewArchitectureNativeHost; | ||
// } else { | ||
// return mReactNativeHost; | ||
// } | ||
} | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
|
||
// If you opted-in for the New Architecture, we enable the TurboModule system | ||
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; | ||
|
||
SoLoader.init(this, /* native exopackage */ false); | ||
initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||
} | ||
/** | ||
* Loads Flipper in React Native templates. Call this in the onCreate method with something like | ||
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||
* | ||
* @param context | ||
* @param reactInstanceManager | ||
*/ | ||
private static void initializeFlipper( | ||
Context context, ReactInstanceManager reactInstanceManager) { | ||
if (BuildConfig.DEBUG) { | ||
try { | ||
/* | ||
We use reflection here to pick up the class that initializes Flipper, | ||
since Flipper library is not available in release mode | ||
*/ | ||
Class<?> aClass = Class.forName("com.verusmobile.ReactNativeFlipper"); | ||
aClass | ||
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) | ||
.invoke(null, context, reactInstanceManager); | ||
} catch (ClassNotFoundException e) { | ||
e.printStackTrace(); | ||
} catch (NoSuchMethodException e) { | ||
e.printStackTrace(); | ||
} catch (IllegalAccessException e) { | ||
e.printStackTrace(); | ||
} catch (InvocationTargetException e) { | ||
e.printStackTrace(); | ||
} | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// If you opted-in for the New Architecture, we load the native entry point for this app. | ||
DefaultNewArchitectureEntryPoint.load(); | ||
} | ||
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
android/app/src/main/java/com/verusmobile/ReactNativeFlipper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root | ||
* directory of this source tree. | ||
*/ | ||
package com.verusmobile; | ||
|
||
import android.content.Context; | ||
import com.facebook.react.ReactInstanceManager; | ||
|
||
/** | ||
* Class responsible of loading Flipper inside your React Native application. This is the release | ||
* flavor of it so it's empty as we don't want to load Flipper. | ||
*/ | ||
public class ReactNativeFlipper { | ||
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { | ||
// Do nothing as we don't want to initialize Flipper on Release. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.