diff --git a/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt b/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt index ea6261b95e..c0cc0dffe0 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt @@ -6,7 +6,6 @@ import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.activities.HistoryBrowseActivity import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity -import info.nightscout.plugins.general.overview.activities.QuickWizardListActivity import info.nightscout.ui.activities.SingleFragmentActivity @Module @@ -17,7 +16,6 @@ abstract class ActivitiesModule { @ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity @ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity @ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity - @ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity @ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt index 50dcc8af36..d352da9521 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt @@ -47,7 +47,6 @@ import javax.inject.Singleton ReceiversModule::class, ServicesModule::class, WorkflowModule::class, - OverviewModule::class, WorkersModule::class, // Gradle modules diff --git a/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt b/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt index f3241a03c6..3216f2e6c2 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt @@ -4,10 +4,6 @@ import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.activities.MyPreferenceFragment import info.nightscout.androidaps.plugins.general.maintenance.MaintenanceFragment -import info.nightscout.configuration.configBuilder.ConfigBuilderFragment -import info.nightscout.plugins.general.overview.OverviewFragment -import info.nightscout.plugins.general.overview.dialogs.EditQuickWizardDialog -import info.nightscout.plugins.general.wear.WearFragment @Module @Suppress("unused") @@ -15,10 +11,6 @@ abstract class FragmentsModule { @ContributesAndroidInjector abstract fun contributesPreferencesFragment(): MyPreferenceFragment - @ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment - @ContributesAndroidInjector abstract fun contributesOverviewFragment(): OverviewFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment - @ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment - @ContributesAndroidInjector abstract fun contributesEditQuickWizardDialog(): EditQuickWizardDialog } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/di/OverviewModule.kt b/app/src/main/java/info/nightscout/androidaps/di/OverviewModule.kt deleted file mode 100644 index c6afc2f1ba..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/di/OverviewModule.kt +++ /dev/null @@ -1,13 +0,0 @@ -package info.nightscout.androidaps.di - -import dagger.Module -import dagger.android.ContributesAndroidInjector -import info.nightscout.plugins.general.overview.graphData.GraphData -import info.nightscout.plugins.general.overview.notifications.NotificationWithAction - -@Module -@Suppress("unused") -abstract class OverviewModule { - @ContributesAndroidInjector abstract fun notificationWithActionInjector(): NotificationWithAction - @ContributesAndroidInjector abstract fun graphDataInjector(): GraphData -} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt b/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt index 61eac2f206..0ad46c2538 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt @@ -5,14 +5,12 @@ import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService import info.nightscout.androidaps.services.AlarmSoundService import info.nightscout.automation.services.LocationService -import info.nightscout.plugins.general.overview.notifications.DismissNotificationService @Module @Suppress("unused") abstract class ServicesModule { @ContributesAndroidInjector abstract fun contributesAlarmSoundService(): AlarmSoundService - @ContributesAndroidInjector abstract fun contributesDismissNotificationService(): DismissNotificationService @ContributesAndroidInjector abstract fun contributesDummyService(): DummyService @ContributesAndroidInjector abstract fun contributesLocationService(): LocationService } \ No newline at end of file diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt index cab927638c..62e4aae6d5 100644 --- a/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt +++ b/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt @@ -2,6 +2,8 @@ package info.nightscout.configuration.di import dagger.Binds import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.configuration.configBuilder.ConfigBuilderFragment import info.nightscout.configuration.configBuilder.ConfigBuilderPlugin import info.nightscout.configuration.configBuilder.RunningConfigurationImpl import info.nightscout.interfaces.ConfigBuilder @@ -12,7 +14,9 @@ import info.nightscout.interfaces.configBuilder.RunningConfiguration SetupWizardModule::class ] ) -open class ConfigurationModule { +abstract class ConfigurationModule { + + @ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment @Module interface Bindings { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/di/OverviewModule.kt b/plugins/main/src/main/java/info/nightscout/plugins/di/OverviewModule.kt new file mode 100644 index 0000000000..b7f7337cca --- /dev/null +++ b/plugins/main/src/main/java/info/nightscout/plugins/di/OverviewModule.kt @@ -0,0 +1,22 @@ +package info.nightscout.plugins.di + +import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.plugins.general.overview.OverviewFragment +import info.nightscout.plugins.general.overview.activities.QuickWizardListActivity +import info.nightscout.plugins.general.overview.dialogs.EditQuickWizardDialog +import info.nightscout.plugins.general.overview.graphData.GraphData +import info.nightscout.plugins.general.overview.notifications.DismissNotificationService +import info.nightscout.plugins.general.overview.notifications.NotificationWithAction + +@Module +@Suppress("unused") +abstract class OverviewModule { + + @ContributesAndroidInjector abstract fun contributesDismissNotificationService(): DismissNotificationService + @ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity + @ContributesAndroidInjector abstract fun contributesEditQuickWizardDialog(): EditQuickWizardDialog + @ContributesAndroidInjector abstract fun contributesOverviewFragment(): OverviewFragment + @ContributesAndroidInjector abstract fun notificationWithActionInjector(): NotificationWithAction + @ContributesAndroidInjector abstract fun graphDataInjector(): GraphData +} \ No newline at end of file diff --git a/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt b/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt index 6deeb185d0..8a6fc62e8d 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt @@ -2,6 +2,7 @@ package info.nightscout.plugins.di import dagger.Binds import dagger.Module +import dagger.android.ContributesAndroidInjector import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.iob.IobCobCalculator import info.nightscout.interfaces.nsclient.NSSettingsStatus @@ -10,6 +11,7 @@ import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.interfaces.sync.DataSyncSelector import info.nightscout.plugins.aps.loop.LoopPlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin +import info.nightscout.plugins.general.wear.WearFragment import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatusImpl @@ -29,13 +31,16 @@ import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl SkinsUiModule::class, LoopModule::class, ActionsModule::class, - WearModule::class + WearModule::class, + OverviewModule::class ] ) @Suppress("unused") abstract class PluginsModule { + @ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment + @Module interface Bindings { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/activities/QuickWizardListActivity.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/activities/QuickWizardListActivity.kt index f84ff6f44d..781c6381bc 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/activities/QuickWizardListActivity.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/activities/QuickWizardListActivity.kt @@ -14,7 +14,7 @@ import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import info.nightscout.core.activities.DaggerAppCompatActivityWithResult +import dagger.android.support.DaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.ActionModeHelper import info.nightscout.core.utils.fabric.FabricPrivacy @@ -31,13 +31,14 @@ import info.nightscout.plugins.general.overview.events.EventQuickWizardChange import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class QuickWizardListActivity : DaggerAppCompatActivityWithResult(), OnStartDragListener { +class QuickWizardListActivity : DaggerAppCompatActivity(), OnStartDragListener { @Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var rxBus: RxBus @@ -45,6 +46,7 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult(), OnStartDrag @Inject lateinit var quickWizard: QuickWizard @Inject lateinit var dateUtil: DateUtil @Inject lateinit var sp: SP + @Inject lateinit var rh: ResourceHelper private var disposable: CompositeDisposable = CompositeDisposable() private lateinit var actionHelper: ActionModeHelper