summaryrefslogtreecommitdiffstats
path: root/android/app/src/main/java
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2023-12-09 17:22:38 +0100
committerjdlugosz963 <jdlugosz963@gmail.com>2023-12-09 17:22:38 +0100
commitde52f51a0ad59500ac24992d63a45f0972ee38fe (patch)
tree18d927ce2ee5a03d8073ea1d2acdb08e3bded782 /android/app/src/main/java
downloadcyberbadge_mobile-de52f51a0ad59500ac24992d63a45f0972ee38fe.tar.gz
cyberbadge_mobile-de52f51a0ad59500ac24992d63a45f0972ee38fe.zip
Initial commit
Generated by react-native@0.73.0
Diffstat (limited to 'android/app/src/main/java')
-rw-r--r--android/app/src/main/java/com/cyberbadge_mobile/MainActivity.kt22
-rw-r--r--android/app/src/main/java/com/cyberbadge_mobile/MainApplication.kt45
2 files changed, 67 insertions, 0 deletions
diff --git a/android/app/src/main/java/com/cyberbadge_mobile/MainActivity.kt b/android/app/src/main/java/com/cyberbadge_mobile/MainActivity.kt
new file mode 100644
index 0000000..1417a4e
--- /dev/null
+++ b/android/app/src/main/java/com/cyberbadge_mobile/MainActivity.kt
@@ -0,0 +1,22 @@
1package com.cyberbadge_mobile
2
3import com.facebook.react.ReactActivity
4import com.facebook.react.ReactActivityDelegate
5import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6import com.facebook.react.defaults.DefaultReactActivityDelegate
7
8class MainActivity : ReactActivity() {
9
10 /**
11 * Returns the name of the main component registered from JavaScript. This is used to schedule
12 * rendering of the component.
13 */
14 override fun getMainComponentName(): String = "cyberbadge_mobile"
15
16 /**
17 * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18 * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19 */
20 override fun createReactActivityDelegate(): ReactActivityDelegate =
21 DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22}
diff --git a/android/app/src/main/java/com/cyberbadge_mobile/MainApplication.kt b/android/app/src/main/java/com/cyberbadge_mobile/MainApplication.kt
new file mode 100644
index 0000000..3fc08cf
--- /dev/null
+++ b/android/app/src/main/java/com/cyberbadge_mobile/MainApplication.kt
@@ -0,0 +1,45 @@
1package com.cyberbadge_mobile
2
3import android.app.Application
4import com.facebook.react.PackageList
5import com.facebook.react.ReactApplication
6import com.facebook.react.ReactHost
7import com.facebook.react.ReactNativeHost
8import com.facebook.react.ReactPackage
9import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11import com.facebook.react.defaults.DefaultReactNativeHost
12import com.facebook.react.flipper.ReactNativeFlipper
13import com.facebook.soloader.SoLoader
14
15class MainApplication : Application(), ReactApplication {
16
17 override val reactNativeHost: ReactNativeHost =
18 object : DefaultReactNativeHost(this) {
19 override fun getPackages(): List<ReactPackage> {
20 // Packages that cannot be autolinked yet can be added manually here, for example:
21 // packages.add(new MyReactNativePackage());
22 return PackageList(this).packages
23 }
24
25 override fun getJSMainModuleName(): String = "index"
26
27 override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28
29 override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30 override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31 }
32
33 override val reactHost: ReactHost
34 get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
35
36 override fun onCreate() {
37 super.onCreate()
38 SoLoader.init(this, false)
39 if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40 // If you opted-in for the New Architecture, we load the native entry point for this app.
41 load()
42 }
43 ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
44 }
45}