Skip to content

Commit

Permalink
Fix Kotlin files.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsegura committed Feb 24, 2024
1 parent 0f7887f commit 74c6155
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions android/app/src/main/java/fr/coopcycle/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class MainActivity : ReactActivity() {
// @see https://developer.android.com/training/notify-user/channels
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

NotificationChannel notificationChannel = new NotificationChannel(
val notificationChannel = NotificationChannel(
"coopcycle_important",
"Service Updates",
NotificationManager.IMPORTANCE_HIGH
)
notificationChannel.setDescription("CoopCycle Service Updates")
notificationChannel.description = "CoopCycle Service Updates"

NotificationManager notificationManager = (NotificationManager) getSystemService(NotificationManager.class)
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(notificationChannel)
}
}
Expand Down
25 changes: 10 additions & 15 deletions android/app/src/main/java/fr/coopcycle/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ import android.content.Intent

import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint
import com.facebook.react.config.ReactFeatureFlags
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader

import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.gms.security.ProviderInstaller
import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener

import java.util.List
import java.util.Arrays

import androidx.multidex.MultiDexApplication

// To enable multidex on API Level < 21,
Expand Down Expand Up @@ -53,16 +54,11 @@ class MainApplication : MultiDexApplication(), ReactApplication {
super.onCreate()
upgradeSecurityProvider()
SoLoader.init(this, false)
if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = 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()
}
if (BuildConfig.DEBUG) {
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
ApplicationLifecycleDispatcher.onApplicationCreate(this)
}

Expand All @@ -72,11 +68,10 @@ class MainApplication : MultiDexApplication(), ReactApplication {
}

private fun upgradeSecurityProvider() {
ProviderInstaller.installIfNeededAsync(this, new ProviderInstallListener() {
public fun onProviderInstalled() {}

public fun onProviderInstallFailed(errorCode: int, recoveryIntent: Intent) {
GoogleApiAvailability.getInstance().showErrorNotification(MainApplication.this, errorCode);
ProviderInstaller.installIfNeededAsync(this, object : ProviderInstallListener {
override fun onProviderInstalled() {}
override fun onProviderInstallFailed(errorCode: Int, recoveryIntent: Intent?) {
GoogleApiAvailability.getInstance().showErrorNotification(this@MainApplication, errorCode);
}
});
}
Expand Down

0 comments on commit 74c6155

Please sign in to comment.