2016-06-14 16:13:48 +03:00
|
|
|
package eu.kanade.tachiyomi
|
|
|
|
|
|
|
|
import android.app.Application
|
|
|
|
import com.google.gson.Gson
|
|
|
|
import eu.kanade.tachiyomi.data.cache.ChapterCache
|
|
|
|
import eu.kanade.tachiyomi.data.cache.CoverCache
|
|
|
|
import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
|
|
|
import eu.kanade.tachiyomi.data.download.DownloadManager
|
2017-01-20 23:24:31 +03:00
|
|
|
import eu.kanade.tachiyomi.network.NetworkHelper
|
2016-06-14 16:13:48 +03:00
|
|
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
2017-01-20 23:24:31 +03:00
|
|
|
import eu.kanade.tachiyomi.source.SourceManager
|
2017-01-20 23:22:17 +03:00
|
|
|
import eu.kanade.tachiyomi.data.track.TrackManager
|
2016-06-14 16:13:48 +03:00
|
|
|
import uy.kohesive.injekt.api.InjektModule
|
|
|
|
import uy.kohesive.injekt.api.InjektRegistrar
|
|
|
|
import uy.kohesive.injekt.api.addSingletonFactory
|
|
|
|
|
|
|
|
class AppModule(val app: Application) : InjektModule {
|
|
|
|
|
|
|
|
override fun InjektRegistrar.registerInjectables() {
|
|
|
|
|
|
|
|
addSingletonFactory { PreferencesHelper(app) }
|
|
|
|
|
|
|
|
addSingletonFactory { DatabaseHelper(app) }
|
|
|
|
|
|
|
|
addSingletonFactory { ChapterCache(app) }
|
|
|
|
|
|
|
|
addSingletonFactory { CoverCache(app) }
|
|
|
|
|
|
|
|
addSingletonFactory { NetworkHelper(app) }
|
|
|
|
|
|
|
|
addSingletonFactory { SourceManager(app) }
|
|
|
|
|
|
|
|
addSingletonFactory { DownloadManager(app) }
|
|
|
|
|
2016-12-19 00:56:28 +03:00
|
|
|
addSingletonFactory { TrackManager(app) }
|
2016-06-14 16:13:48 +03:00
|
|
|
|
|
|
|
addSingletonFactory { Gson() }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|