|
@@ -15,37 +15,29 @@ import java.io.File
|
|
|
|
|
|
class MainApplication : Application(), ReactApplication {
|
|
class MainApplication : Application(), ReactApplication {
|
|
|
|
|
|
- override val reactNativeHost: ReactNativeHost =
|
|
|
|
- object : DefaultReactNativeHost(this) {
|
|
|
|
- override fun getPackages(): List<ReactPackage> =
|
|
|
|
- PackageList(this).packages.apply {
|
|
|
|
- // Packages that cannot be autolinked yet can be added manually here, for example:
|
|
|
|
- add(NavigationPackage())
|
|
|
|
- }
|
|
|
|
|
|
+ override val reactNativeHost: ReactNativeHost = object : DefaultReactNativeHost(this) {
|
|
|
|
+ override fun getPackages(): List<ReactPackage> = PackageList(this).packages.apply {
|
|
|
|
+ // Packages that cannot be autolinked yet can be added manually here, for example:
|
|
|
|
+ add(NavigationPackage())
|
|
|
|
+ }
|
|
|
|
|
|
- override fun getJSMainModuleName(): String =
|
|
|
|
- if (getUseDeveloperSupport()) "index" else "commom"
|
|
|
|
|
|
+ override fun getJSMainModuleName(): String =
|
|
|
|
+ if (getUseDeveloperSupport()) "index" else "commom"
|
|
|
|
|
|
- override fun getBundleAssetName(): String? =
|
|
|
|
- if (getUseDeveloperSupport()) "index.android.bundle" else null
|
|
|
|
|
|
+ override fun getBundleAssetName(): String? =
|
|
|
|
+ if (getUseDeveloperSupport()) "index.android.bundle" else null
|
|
|
|
|
|
- //
|
|
|
|
-// override fun getJSBundleFile(): String? = if (getUseDeveloperSupport()) {
|
|
|
|
-// super.getJSBundleFile()
|
|
|
|
-// } else {
|
|
|
|
-// FileHelper.getFilePath("common.android.bundle", this@MainApplication, "bundles")
|
|
|
|
-// }
|
|
|
|
- override fun getJSBundleFile(): String? = if (getUseDeveloperSupport()) {
|
|
|
|
- null
|
|
|
|
- } else {
|
|
|
|
- FileHelper.getFilePath("common.android.bundle", this@MainApplication, "bundles")
|
|
|
|
- }
|
|
|
|
|
|
+ override fun getJSBundleFile(): String? = if (getUseDeveloperSupport()) {
|
|
|
|
+ null
|
|
|
|
+ } else {
|
|
|
|
+ FileHelper.getFilePath("common.android.bundle", this@MainApplication, "bundles")
|
|
|
|
+ }
|
|
|
|
|
|
- override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
|
|
|
|
+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
|
|
|
|
- override val isNewArchEnabled: Boolean = true
|
|
|
|
- override val isHermesEnabled: Boolean = true
|
|
|
|
- }
|
|
|
|
|
|
+ override val isNewArchEnabled: Boolean = true
|
|
|
|
+ override val isHermesEnabled: Boolean = true
|
|
|
|
+ }
|
|
|
|
|
|
override val reactHost: ReactHost
|
|
override val reactHost: ReactHost
|
|
get() = getDefaultReactHost(applicationContext, reactNativeHost)
|
|
get() = getDefaultReactHost(applicationContext, reactNativeHost)
|