2019-12-13 02:12:19 +01:00
|
|
|
package info.nightscout.androidaps.dependencyInjection
|
|
|
|
|
2019-12-21 20:17:08 +01:00
|
|
|
import dagger.BindsInstance
|
2019-12-13 02:12:19 +01:00
|
|
|
import dagger.Component
|
|
|
|
import dagger.android.AndroidInjectionModule
|
2019-12-21 20:17:08 +01:00
|
|
|
import dagger.android.AndroidInjector
|
2019-12-13 02:12:19 +01:00
|
|
|
import info.nightscout.androidaps.MainApp
|
2019-12-27 04:17:49 +01:00
|
|
|
import info.nightscout.androidaps.plugins.general.automation.actions.ActionSendSMS
|
|
|
|
import info.nightscout.androidaps.queue.commands.CommandSetProfile
|
|
|
|
import info.nightscout.androidaps.services.DataService
|
2019-12-21 20:17:08 +01:00
|
|
|
import javax.inject.Singleton
|
2019-12-13 02:12:19 +01:00
|
|
|
|
2019-12-21 20:17:08 +01:00
|
|
|
@Singleton
|
2019-12-13 02:12:19 +01:00
|
|
|
@Component(
|
2019-12-21 20:17:08 +01:00
|
|
|
modules = [
|
|
|
|
AndroidInjectionModule::class,
|
|
|
|
ActivitiesModule::class,
|
2019-12-23 13:27:15 +01:00
|
|
|
FragmentsModule::class,
|
2019-12-21 20:17:08 +01:00
|
|
|
AppModule::class
|
|
|
|
]
|
2019-12-13 02:12:19 +01:00
|
|
|
)
|
2019-12-21 20:17:08 +01:00
|
|
|
interface AppComponent : AndroidInjector<MainApp> {
|
|
|
|
|
2019-12-27 04:17:49 +01:00
|
|
|
fun injectDataService(service: DataService)
|
|
|
|
|
|
|
|
fun injectCommandSetProfile(commandSetProfile: CommandSetProfile)
|
|
|
|
|
|
|
|
fun injectActionSendSMS(actionSendSMS: ActionSendSMS)
|
|
|
|
|
2019-12-21 20:17:08 +01:00
|
|
|
@Component.Builder
|
|
|
|
interface Builder {
|
|
|
|
|
|
|
|
@BindsInstance
|
2019-12-26 17:50:16 +01:00
|
|
|
fun application(mainApp: MainApp): Builder
|
2019-12-13 02:12:19 +01:00
|
|
|
|
2019-12-21 20:17:08 +01:00
|
|
|
fun build(): AppComponent
|
|
|
|
}
|
2019-12-13 02:12:19 +01:00
|
|
|
}
|