This commit is contained in:
Milos Kozak 2022-11-27 14:05:38 +01:00
parent 3892a174ea
commit beb739d9e6
9 changed files with 37 additions and 30 deletions

View file

@ -6,7 +6,6 @@ import info.nightscout.androidaps.MainActivity
import info.nightscout.androidaps.activities.HistoryBrowseActivity import info.nightscout.androidaps.activities.HistoryBrowseActivity
import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.activities.PreferencesActivity
import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity
import info.nightscout.plugins.general.overview.activities.QuickWizardListActivity
import info.nightscout.ui.activities.SingleFragmentActivity import info.nightscout.ui.activities.SingleFragmentActivity
@Module @Module
@ -17,7 +16,6 @@ abstract class ActivitiesModule {
@ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity @ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity
@ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity @ContributesAndroidInjector abstract fun contributeMainActivity(): MainActivity
@ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity @ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity
@ContributesAndroidInjector abstract fun contributesQuickWizardListActivity(): QuickWizardListActivity
@ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity @ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity
} }

View file

@ -47,7 +47,6 @@ import javax.inject.Singleton
ReceiversModule::class, ReceiversModule::class,
ServicesModule::class, ServicesModule::class,
WorkflowModule::class, WorkflowModule::class,
OverviewModule::class,
WorkersModule::class, WorkersModule::class,
// Gradle modules // Gradle modules

View file

@ -4,10 +4,6 @@ import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.activities.MyPreferenceFragment import info.nightscout.androidaps.activities.MyPreferenceFragment
import info.nightscout.androidaps.plugins.general.maintenance.MaintenanceFragment 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 @Module
@Suppress("unused") @Suppress("unused")
@ -15,10 +11,6 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesPreferencesFragment(): MyPreferenceFragment @ContributesAndroidInjector abstract fun contributesPreferencesFragment(): MyPreferenceFragment
@ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment
@ContributesAndroidInjector abstract fun contributesOverviewFragment(): OverviewFragment
@ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment
@ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment
@ContributesAndroidInjector abstract fun contributesEditQuickWizardDialog(): EditQuickWizardDialog
} }

View file

@ -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
}

View file

@ -5,14 +5,12 @@ import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService
import info.nightscout.androidaps.services.AlarmSoundService import info.nightscout.androidaps.services.AlarmSoundService
import info.nightscout.automation.services.LocationService import info.nightscout.automation.services.LocationService
import info.nightscout.plugins.general.overview.notifications.DismissNotificationService
@Module @Module
@Suppress("unused") @Suppress("unused")
abstract class ServicesModule { abstract class ServicesModule {
@ContributesAndroidInjector abstract fun contributesAlarmSoundService(): AlarmSoundService @ContributesAndroidInjector abstract fun contributesAlarmSoundService(): AlarmSoundService
@ContributesAndroidInjector abstract fun contributesDismissNotificationService(): DismissNotificationService
@ContributesAndroidInjector abstract fun contributesDummyService(): DummyService @ContributesAndroidInjector abstract fun contributesDummyService(): DummyService
@ContributesAndroidInjector abstract fun contributesLocationService(): LocationService @ContributesAndroidInjector abstract fun contributesLocationService(): LocationService
} }

View file

@ -2,6 +2,8 @@ package info.nightscout.configuration.di
import dagger.Binds import dagger.Binds
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.configuration.configBuilder.ConfigBuilderFragment
import info.nightscout.configuration.configBuilder.ConfigBuilderPlugin import info.nightscout.configuration.configBuilder.ConfigBuilderPlugin
import info.nightscout.configuration.configBuilder.RunningConfigurationImpl import info.nightscout.configuration.configBuilder.RunningConfigurationImpl
import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.ConfigBuilder
@ -12,7 +14,9 @@ import info.nightscout.interfaces.configBuilder.RunningConfiguration
SetupWizardModule::class SetupWizardModule::class
] ]
) )
open class ConfigurationModule { abstract class ConfigurationModule {
@ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment
@Module @Module
interface Bindings { interface Bindings {

View file

@ -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
}

View file

@ -2,6 +2,7 @@ package info.nightscout.plugins.di
import dagger.Binds import dagger.Binds
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.aps.Loop
import info.nightscout.interfaces.iob.IobCobCalculator import info.nightscout.interfaces.iob.IobCobCalculator
import info.nightscout.interfaces.nsclient.NSSettingsStatus 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.interfaces.sync.DataSyncSelector
import info.nightscout.plugins.aps.loop.LoopPlugin import info.nightscout.plugins.aps.loop.LoopPlugin
import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin 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.iob.iobCobCalculator.IobCobCalculatorPlugin
import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatusImpl import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatusImpl
@ -29,13 +31,16 @@ import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl
SkinsUiModule::class, SkinsUiModule::class,
LoopModule::class, LoopModule::class,
ActionsModule::class, ActionsModule::class,
WearModule::class WearModule::class,
OverviewModule::class
] ]
) )
@Suppress("unused") @Suppress("unused")
abstract class PluginsModule { abstract class PluginsModule {
@ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment
@Module @Module
interface Bindings { interface Bindings {

View file

@ -14,7 +14,7 @@ import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView 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.ui.dialogs.OKDialog
import info.nightscout.core.utils.ActionModeHelper import info.nightscout.core.utils.ActionModeHelper
import info.nightscout.core.utils.fabric.FabricPrivacy 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.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.shared.extensions.toVisibility import info.nightscout.shared.extensions.toVisibility
import info.nightscout.shared.interfaces.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP
import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.DateUtil
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign
import javax.inject.Inject import javax.inject.Inject
class QuickWizardListActivity : DaggerAppCompatActivityWithResult(), OnStartDragListener { class QuickWizardListActivity : DaggerAppCompatActivity(), OnStartDragListener {
@Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var rxBus: RxBus @Inject lateinit var rxBus: RxBus
@ -45,6 +46,7 @@ class QuickWizardListActivity : DaggerAppCompatActivityWithResult(), OnStartDrag
@Inject lateinit var quickWizard: QuickWizard @Inject lateinit var quickWizard: QuickWizard
@Inject lateinit var dateUtil: DateUtil @Inject lateinit var dateUtil: DateUtil
@Inject lateinit var sp: SP @Inject lateinit var sp: SP
@Inject lateinit var rh: ResourceHelper
private var disposable: CompositeDisposable = CompositeDisposable() private var disposable: CompositeDisposable = CompositeDisposable()
private lateinit var actionHelper: ActionModeHelper<QuickWizardEntry> private lateinit var actionHelper: ActionModeHelper<QuickWizardEntry>