Make database instance injectable
This commit is contained in:
parent
8be19a1309
commit
2ee50459a9
@ -146,6 +146,7 @@ dependencies {
|
||||
implementation(project(":websites"))
|
||||
implementation(project(":widgets"))
|
||||
implementation(project(":wikipedia"))
|
||||
implementation(project(":database"))
|
||||
|
||||
// Uncomment this if you want annoying notifications in your debug builds yelling at you how terrible your code is
|
||||
//debugImplementation(libs.leakcanary)
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package de.mm20.launcher2
|
||||
|
||||
import android.app.Application
|
||||
import android.content.IntentFilter
|
||||
import android.graphics.Bitmap
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import de.mm20.launcher2.applications.applicationsModule
|
||||
import de.mm20.launcher2.badges.badgesModule
|
||||
@ -22,6 +20,7 @@ import de.mm20.launcher2.unitconverter.unitConverterModule
|
||||
import de.mm20.launcher2.websites.websitesModule
|
||||
import de.mm20.launcher2.widgets.widgetsModule
|
||||
import de.mm20.launcher2.wikipedia.wikipediaModule
|
||||
import de.mm20.launcher2.database.databaseModule
|
||||
import kotlinx.coroutines.*
|
||||
import org.koin.android.ext.koin.androidContext
|
||||
import org.koin.android.ext.koin.androidLogger
|
||||
@ -60,6 +59,7 @@ class LauncherApplication : Application(), CoroutineScope {
|
||||
badgesModule,
|
||||
calendarModule,
|
||||
contactsModule,
|
||||
databaseModule,
|
||||
favoritesModule,
|
||||
filesModule,
|
||||
hiddenItemsModule,
|
||||
|
||||
@ -49,6 +49,7 @@ dependencies {
|
||||
api(libs.androidx.roomruntime)
|
||||
kapt(libs.androidx.roomcompiler)
|
||||
implementation(libs.androidx.room)
|
||||
implementation(libs.koin.android)
|
||||
|
||||
implementation(project(":i18n"))
|
||||
implementation(project(":ktx"))
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
package de.mm20.launcher2.database
|
||||
import org.koin.dsl.module
|
||||
|
||||
val databaseModule = module {
|
||||
single { AppDatabase.getInstance(get()) }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user