di cleanup

This commit is contained in:
Milos Kozak 2022-11-21 10:46:56 +01:00
parent c2fb7811dd
commit 1cbfae2dc1
17 changed files with 72 additions and 55 deletions

View file

@ -21,6 +21,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.di.MedtronicModule
import info.nightscout.androidaps.plugins.pump.omnipod.dash.di.OmnipodDashModule
import info.nightscout.androidaps.plugins.pump.omnipod.eros.di.OmnipodErosModule
import info.nightscout.automation.di.AutomationModule
import info.nightscout.core.di.CoreModule
import info.nightscout.database.impl.DatabaseModule
import info.nightscout.implementation.di.ImplementationModule
import info.nightscout.plugins.aps.di.ApsModule
@ -44,11 +45,8 @@ import javax.inject.Singleton
WizardModule::class,
ApsModule::class,
WorkflowModule::class,
PreferencesModule::class,
OverviewModule::class,
DataClassesModule::class,
WorkersModule::class,
UiModule::class,
// Gradle modules
AutomationModule::class,
@ -60,7 +58,7 @@ import javax.inject.Singleton
SharedModule::class,
SharedImplModule::class,
OpenHumansModule::class,
UIModule::class,
UiModule::class,
// pumps
ComboModule::class,

View file

@ -1,14 +0,0 @@
package info.nightscout.androidaps.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.core.wizard.BolusWizard
import info.nightscout.core.wizard.QuickWizardEntry
@Module
@Suppress("unused")
abstract class DataClassesModule {
@ContributesAndroidInjector abstract fun bolusWizardInjector(): BolusWizard
@ContributesAndroidInjector abstract fun quickWizardEntryInjector(): QuickWizardEntry
}

View file

@ -1,2 +0,0 @@
package info.nightscout.androidaps.di

View file

@ -2,9 +2,6 @@ package info.nightscout.androidaps.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.plugins.aps.loop.CarbSuggestionReceiver
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBluetoothStateReceiver
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBroadcastReceiver
import info.nightscout.androidaps.receivers.AutoStartReceiver
import info.nightscout.androidaps.receivers.BTReceiver
import info.nightscout.androidaps.receivers.ChargingStateReceiver
@ -22,9 +19,6 @@ abstract class ReceiversModule {
@ContributesAndroidInjector abstract fun contributesChargingStateReceiver(): ChargingStateReceiver
@ContributesAndroidInjector abstract fun contributesDataReceiver(): DataReceiver
@ContributesAndroidInjector abstract fun contributesKeepAliveWorker(): KeepAliveWorker
@ContributesAndroidInjector abstract fun contributesRileyLinkBluetoothStateReceiver(): RileyLinkBluetoothStateReceiver
@ContributesAndroidInjector abstract fun contributesSmsReceiver(): SmsReceiver
@ContributesAndroidInjector abstract fun contributesTimeDateOrTZChangeReceiver(): TimeDateOrTZChangeReceiver
@ContributesAndroidInjector abstract fun contributesCarbSuggestionReceiver(): CarbSuggestionReceiver
@ContributesAndroidInjector abstract fun contributesRileyLinkBroadcastReceiver(): RileyLinkBroadcastReceiver
}

View file

@ -1,17 +0,0 @@
package info.nightscout.androidaps.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.ui.widget.WidgetConfigureActivity
import info.nightscout.plugins.skins.SkinListPreference
import info.nightscout.ui.widget.Widget
@Module
@Suppress("unused")
abstract class UIModule {
@ContributesAndroidInjector abstract fun skinListPreferenceInjector(): SkinListPreference
@ContributesAndroidInjector abstract fun contributesWidget(): Widget
@ContributesAndroidInjector abstract fun contributesWidgetConfigureActivity(): WidgetConfigureActivity
}

View file

@ -4,7 +4,21 @@ import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.setupwizard.SWEventListener
import info.nightscout.androidaps.setupwizard.SWScreen
import info.nightscout.androidaps.setupwizard.elements.*
import info.nightscout.androidaps.setupwizard.elements.SWBreak
import info.nightscout.androidaps.setupwizard.elements.SWButton
import info.nightscout.androidaps.setupwizard.elements.SWEditEncryptedPassword
import info.nightscout.androidaps.setupwizard.elements.SWEditIntNumber
import info.nightscout.androidaps.setupwizard.elements.SWEditNumber
import info.nightscout.androidaps.setupwizard.elements.SWEditNumberWithUnits
import info.nightscout.androidaps.setupwizard.elements.SWEditString
import info.nightscout.androidaps.setupwizard.elements.SWEditUrl
import info.nightscout.androidaps.setupwizard.elements.SWFragment
import info.nightscout.androidaps.setupwizard.elements.SWHtmlLink
import info.nightscout.androidaps.setupwizard.elements.SWInfoText
import info.nightscout.androidaps.setupwizard.elements.SWItem
import info.nightscout.androidaps.setupwizard.elements.SWPlugin
import info.nightscout.androidaps.setupwizard.elements.SWPreference
import info.nightscout.androidaps.setupwizard.elements.SWRadioButton
@Module
@Suppress("unused")
@ -21,7 +35,7 @@ abstract class WizardModule {
@ContributesAndroidInjector abstract fun swFragmentInjector(): SWFragment
@ContributesAndroidInjector abstract fun swPreferenceInjector(): SWPreference
@ContributesAndroidInjector abstract fun swHtmlLinkInjector(): SWHtmlLink
@ContributesAndroidInjector abstract fun swInfotextInjector(): SWInfoText
@ContributesAndroidInjector abstract fun swInfoTextInjector(): SWInfoText
@ContributesAndroidInjector abstract fun swItemInjector(): SWItem
@ContributesAndroidInjector abstract fun swPluginInjector(): SWPlugin
@ContributesAndroidInjector abstract fun swRadioButtonInjector(): SWRadioButton

View file

@ -1,10 +1,12 @@
package info.nightscout.androidaps.di
package info.nightscout.core.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.aps.loop.APSResultObject
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensDataObject
import info.nightscout.core.profile.ProfileStoreObject
import info.nightscout.core.wizard.BolusWizard
import info.nightscout.core.wizard.QuickWizardEntry
import info.nightscout.interfaces.pump.PumpEnactResult
@Module
@ -14,6 +16,7 @@ abstract class CoreDataClassesModule {
@ContributesAndroidInjector abstract fun pumpEnactResultInjector(): PumpEnactResult
@ContributesAndroidInjector abstract fun apsResultInjector(): APSResultObject
@ContributesAndroidInjector abstract fun autosensDataInjector(): AutosensDataObject
@ContributesAndroidInjector abstract fun profileStoreInjector(): ProfileStoreObject
@ContributesAndroidInjector abstract fun bolusWizardInjector(): BolusWizard
@ContributesAndroidInjector abstract fun quickWizardEntryInjector(): QuickWizardEntry
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.di
package info.nightscout.core.di
import dagger.Module
import dagger.android.ContributesAndroidInjector

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.di
package info.nightscout.core.di
import android.content.Context
import android.os.Build
@ -11,7 +11,8 @@ import dagger.Provides
CoreReceiversModule::class,
CoreFragmentsModule::class,
CoreDataClassesModule::class,
ValidatorsModule::class
ValidatorsModule::class,
PreferencesModule::class
]
)
open class CoreModule {

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.di
package info.nightscout.core.di
import dagger.Module
import dagger.android.ContributesAndroidInjector

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.di
package info.nightscout.core.di
import dagger.Module
import dagger.android.ContributesAndroidInjector

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.di
package info.nightscout.core.di
import dagger.Module
import dagger.android.ContributesAndroidInjector

View file

@ -0,0 +1,12 @@
package info.nightscout.plugins.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.plugins.aps.loop.CarbSuggestionReceiver
@Module
@Suppress("unused")
abstract class LoopModule {
@ContributesAndroidInjector abstract fun contributesCarbSuggestionReceiver(): CarbSuggestionReceiver
}

View file

@ -12,7 +12,9 @@ import dagger.Module
SourceModule::class,
VirtualPumpModule::class,
ObjectivesModule::class,
SkinsModule::class
SkinsModule::class,
SkinsUiModule::class,
LoopModule::class
]
)

View file

@ -0,0 +1,12 @@
package info.nightscout.plugins.di
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.plugins.skins.SkinListPreference
@Module
@Suppress("unused")
abstract class SkinsUiModule {
@ContributesAndroidInjector abstract fun skinListPreferenceInjector(): SkinListPreference
}

View file

@ -13,8 +13,15 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.device.Or
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusGeneralFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusHistoryFragment
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBluetoothStateReceiver
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkBroadcastReceiver
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.*
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.DiscoverGattServicesTask
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.InitializePumpManagerTask
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.PumpTask
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTask
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask
@Module
@Suppress("unused")
@ -40,4 +47,6 @@ abstract class RileyLinkModule {
@ContributesAndroidInjector abstract fun contributesRileyLinkBLEConfigActivity(): RileyLinkBLEConfigActivity
@ContributesAndroidInjector abstract fun contributesRileyLinkService(): RileyLinkService
@ContributesAndroidInjector abstract fun contributesRileyLinkBroadcastReceiver(): RileyLinkBroadcastReceiver
@ContributesAndroidInjector abstract fun contributesRileyLinkBluetoothStateReceiver(): RileyLinkBluetoothStateReceiver
}

View file

@ -29,11 +29,16 @@ import info.nightscout.ui.dialogs.TempBasalDialog
import info.nightscout.ui.dialogs.TempTargetDialog
import info.nightscout.ui.dialogs.TreatmentDialog
import info.nightscout.ui.dialogs.WizardInfoDialog
import info.nightscout.ui.widget.Widget
import info.nightscout.ui.widget.WidgetConfigureActivity
@Module
@Suppress("unused")
abstract class UiModule {
@ContributesAndroidInjector abstract fun contributesWidget(): Widget
@ContributesAndroidInjector abstract fun contributesWidgetConfigureActivity(): WidgetConfigureActivity
@ContributesAndroidInjector abstract fun contributesCalibrationDialog(): CalibrationDialog
@ContributesAndroidInjector abstract fun contributesCarbsDialog(): CarbsDialog
@ContributesAndroidInjector abstract fun contributesCareDialog(): CareDialog