mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
29 lines
1 KiB
Kotlin
29 lines
1 KiB
Kotlin
package eu.kanade.tachiyomi.di
|
|
|
|
import android.app.Application
|
|
import dev.yokai.domain.source.SourcePreferences
|
|
import eu.kanade.tachiyomi.core.preference.AndroidPreferenceStore
|
|
import eu.kanade.tachiyomi.core.preference.PreferenceStore
|
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
|
import eu.kanade.tachiyomi.data.track.TrackPreferences
|
|
import uy.kohesive.injekt.api.InjektModule
|
|
import uy.kohesive.injekt.api.InjektRegistrar
|
|
import uy.kohesive.injekt.api.addSingletonFactory
|
|
import uy.kohesive.injekt.api.get
|
|
|
|
class PreferenceModule(val application: Application) : InjektModule {
|
|
override fun InjektRegistrar.registerInjectables() {
|
|
addSingletonFactory<PreferenceStore> { AndroidPreferenceStore(application) }
|
|
|
|
addSingletonFactory { SourcePreferences(get()) }
|
|
|
|
addSingletonFactory { TrackPreferences(get()) }
|
|
|
|
addSingletonFactory {
|
|
PreferencesHelper(
|
|
context = application,
|
|
preferenceStore = get(),
|
|
)
|
|
}
|
|
}
|
|
}
|