diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
3 files changed, 14 insertions, 7 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index 41c6ff4b..0c762b41 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -45,7 +45,9 @@ import com.raizlabs.android.dbflow.config.DatabaseConfig import com.raizlabs.android.dbflow.config.FlowConfig import com.raizlabs.android.dbflow.config.FlowManager import com.raizlabs.android.dbflow.runtime.ContentResolverNotifier -import org.koin.android.ext.android.startKoin +import org.koin.android.ext.koin.androidContext +import org.koin.android.ext.koin.androidLogger +import org.koin.core.context.startKoin import java.util.Random import kotlin.reflect.KClass @@ -134,7 +136,12 @@ class FrostApp : Application() { L.d { "Activity ${activity.localClassName} created" } } }) - startKoin(this, listOf(FrostDatabase.module(this))) + startKoin { + if (BuildConfig.DEBUG) + androidLogger() + androidContext(this@FrostApp) + modules(FrostDatabase.module(this@FrostApp)) + } } private fun initBugsnag() { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt b/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt index 67372e23..cd5fce02 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/db/Database.kt @@ -21,8 +21,8 @@ import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase import com.pitchedapps.frost.BuildConfig -import org.koin.dsl.module.module -import org.koin.standalone.StandAloneContext +import org.koin.core.context.GlobalContext +import org.koin.dsl.module interface FrostPrivateDao { fun cookieDao(): CookieDao @@ -101,6 +101,6 @@ class FrostDatabase(private val privateDb: FrostPrivateDatabase, private val pub * Get from koin * For the most part, you can retrieve directly from other koin components */ - fun get(): FrostDatabase = StandAloneContext.getKoin().koinContext.get() + fun get(): FrostDatabase = GlobalContext.get().koin.get() } } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt index 594da00a..66176aba 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt @@ -47,8 +47,8 @@ import com.pitchedapps.frost.services.NotificationContent import com.pitchedapps.frost.services.NotificationType import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.toReadableTime -import org.koin.standalone.KoinComponent -import org.koin.standalone.inject +import org.koin.core.KoinComponent +import org.koin.core.inject class NotificationWidget : AppWidgetProvider() { |