From 0787829223934385a8687b043086b4571607ee9a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 22 Nov 2022 12:37:56 +0100 Subject: [PATCH] ErrorDialog -> ui --- .../main/java/info/nightscout/core/di/CoreFragmentsModule.kt | 2 -- .../info/nightscout/ui/activities/ErrorHelperActivity.kt | 5 +---- .../java/info/nightscout/ui/alertDialogs}/ErrorDialog.kt | 4 ++-- ui/src/main/java/info/nightscout/ui/di/UiModule.kt | 2 ++ {core/core-main => ui}/src/main/res/layout/dialog_error.xml | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) rename {core/core-main/src/main/java/info/nightscout/androidaps/dialogs => ui/src/main/java/info/nightscout/ui/alertDialogs}/ErrorDialog.kt (97%) rename {core/core-main => ui}/src/main/res/layout/dialog_error.xml (97%) diff --git a/core/core-main/src/main/java/info/nightscout/core/di/CoreFragmentsModule.kt b/core/core-main/src/main/java/info/nightscout/core/di/CoreFragmentsModule.kt index fdc55b8080..659912b7b5 100644 --- a/core/core-main/src/main/java/info/nightscout/core/di/CoreFragmentsModule.kt +++ b/core/core-main/src/main/java/info/nightscout/core/di/CoreFragmentsModule.kt @@ -2,7 +2,6 @@ package info.nightscout.core.di import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.dialogs.ErrorDialog import info.nightscout.androidaps.plugins.general.maintenance.activities.PrefImportListActivity import info.nightscout.core.ui.elements.SingleClickButton @@ -11,7 +10,6 @@ import info.nightscout.core.ui.elements.SingleClickButton abstract class CoreFragmentsModule { @ContributesAndroidInjector abstract fun contributesPrefImportListActivity(): PrefImportListActivity - @ContributesAndroidInjector abstract fun contributesErrorDialog(): ErrorDialog @ContributesAndroidInjector abstract fun contributesSingleClickButton(): SingleClickButton } diff --git a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt index 968b2c13fe..de2d9c044f 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt @@ -1,14 +1,11 @@ package info.nightscout.ui.activities -import android.content.Context -import android.content.Intent import android.os.Bundle -import androidx.annotation.RawRes import info.nightscout.androidaps.activities.DialogAppCompatActivity import info.nightscout.core.main.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.androidaps.dialogs.ErrorDialog +import info.nightscout.ui.alertDialogs.ErrorDialog import info.nightscout.androidaps.services.AlarmSoundService import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt similarity index 97% rename from core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt rename to ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt index 23e5067f88..2f4fa91603 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.dialogs +package info.nightscout.ui.alertDialogs import android.content.Context import android.content.res.Resources @@ -15,11 +15,11 @@ import info.nightscout.androidaps.activities.DialogAppCompatActivity import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.core.main.R -import info.nightscout.core.main.databinding.DialogErrorBinding import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.utils.T +import info.nightscout.ui.databinding.DialogErrorBinding import javax.inject.Inject class ErrorDialog : DaggerDialogFragment() { diff --git a/ui/src/main/java/info/nightscout/ui/di/UiModule.kt b/ui/src/main/java/info/nightscout/ui/di/UiModule.kt index 2719a916fc..7cc9ab99d0 100644 --- a/ui/src/main/java/info/nightscout/ui/di/UiModule.kt +++ b/ui/src/main/java/info/nightscout/ui/di/UiModule.kt @@ -16,6 +16,7 @@ import info.nightscout.ui.activities.fragments.TreatmentsProfileSwitchFragment import info.nightscout.ui.activities.fragments.TreatmentsTempTargetFragment import info.nightscout.ui.activities.fragments.TreatmentsTemporaryBasalsFragment import info.nightscout.ui.activities.fragments.TreatmentsUserEntryFragment +import info.nightscout.ui.alertDialogs.ErrorDialog import info.nightscout.ui.dialogs.BolusProgressDialog import info.nightscout.ui.dialogs.CalibrationDialog import info.nightscout.ui.dialogs.CarbsDialog @@ -56,6 +57,7 @@ abstract class UiModule { @ContributesAndroidInjector abstract fun contributesTempTargetDialog(): TempTargetDialog @ContributesAndroidInjector abstract fun contributesLoopDialog(): LoopDialog @ContributesAndroidInjector abstract fun contributesBolusProgressDialog(): BolusProgressDialog + @ContributesAndroidInjector abstract fun contributesErrorDialog(): ErrorDialog @ContributesAndroidInjector abstract fun contributesTDDStatsActivity(): TDDStatsActivity @ContributesAndroidInjector abstract fun contributeBolusProgressHelperActivity(): BolusProgressHelperActivity diff --git a/core/core-main/src/main/res/layout/dialog_error.xml b/ui/src/main/res/layout/dialog_error.xml similarity index 97% rename from core/core-main/src/main/res/layout/dialog_error.xml rename to ui/src/main/res/layout/dialog_error.xml index 23f9f6c08f..4345b51beb 100644 --- a/core/core-main/src/main/res/layout/dialog_error.xml +++ b/ui/src/main/res/layout/dialog_error.xml @@ -4,7 +4,7 @@ style="@style/StyleDialog" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="info.nightscout.androidaps.dialogs.ErrorDialog"> + tools:context=".alertDialogs.ErrorDialog">