From 32bf2e592a860648c2a88c512a8e1c3b2f1ff2e9 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 23 Nov 2022 16:13:39 +0100 Subject: [PATCH] move DialogAppCompatActivity --- app/src/main/java/info/nightscout/androidaps/MainActivity.kt | 2 +- app/src/main/java/info/nightscout/androidaps/MainApp.kt | 2 +- .../nightscout/androidaps/activities/PreferencesActivity.kt | 2 +- .../androidaps/activities/SingleFragmentActivity.kt | 2 +- .../general/maintenance/activities/PrefImportListActivity.kt | 2 +- .../nightscout/core/activities/NoSplashAppCompatActivity.kt | 2 +- core/ui/build.gradle | 3 +++ .../nightscout/core/ui}/activities/DialogAppCompatActivity.kt | 4 ++-- .../main/java/info/nightscout/core/ui}/locale/LocaleHelper.kt | 4 ++-- core/ui/src/main/res/values/strings.xml | 3 +++ interfaces/src/main/res/values/strings.xml | 3 --- .../configuration/setupwizard/SetupWizardActivity.kt | 2 +- .../source/activities/RequestDexcomPermissionActivity.kt | 2 +- .../androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt | 2 +- .../plugins/pump/eopatch/ui/DialogHelperActivity.kt | 2 +- .../nightscout/ui/activities/BolusProgressHelperActivity.kt | 2 +- .../java/info/nightscout/ui/activities/ErrorHelperActivity.kt | 2 +- .../main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt | 2 +- .../java/info/nightscout/ui/dialogs/BolusProgressDialog.kt | 2 +- 19 files changed, 24 insertions(+), 21 deletions(-) rename core/{core-main/src/main/java/info/nightscout/core => ui/src/main/java/info/nightscout/core/ui}/activities/DialogAppCompatActivity.kt (74%) rename {interfaces/src/main/java/info/nightscout/interfaces => core/ui/src/main/java/info/nightscout/core/ui}/locale/LocaleHelper.kt (96%) diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index 8828960e34..43f8c9383c 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -50,7 +50,7 @@ import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.Config import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.constraints.Constraints -import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.core.ui.locale.LocaleHelper import info.nightscout.interfaces.maintenance.PrefFileListProvider import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.PluginBase diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index ef521207aa..68c17ce3b6 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -35,7 +35,7 @@ import info.nightscout.implementation.db.CompatDBHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.core.ui.locale.LocaleHelper import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.general.overview.notifications.NotificationStore diff --git a/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt index ab4bc5684f..096181061f 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt @@ -10,7 +10,7 @@ import androidx.preference.PreferenceScreen import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityPreferencesBinding import info.nightscout.core.activities.NoSplashAppCompatActivity -import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.core.ui.locale.LocaleHelper class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompat.OnPreferenceStartScreenCallback { diff --git a/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt index 07ea6e5101..3723e14b88 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt @@ -8,7 +8,7 @@ import android.view.MenuItem import info.nightscout.androidaps.R import info.nightscout.androidaps.plugins.configBuilder.PluginStore import info.nightscout.core.activities.DaggerAppCompatActivityWithResult -import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.core.ui.locale.LocaleHelper import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.protection.ProtectionCheck import javax.inject.Inject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt index 0b910055bc..370ac37d06 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.core.main.R import info.nightscout.core.main.databinding.MaintenanceImportListActivityBinding import info.nightscout.core.main.databinding.MaintenanceImportListItemBinding -import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.core.ui.locale.LocaleHelper import info.nightscout.interfaces.maintenance.PrefFileListProvider import info.nightscout.interfaces.maintenance.PrefsFile import info.nightscout.interfaces.maintenance.PrefsMetadataKey diff --git a/core/core-main/src/main/java/info/nightscout/core/activities/NoSplashAppCompatActivity.kt b/core/core-main/src/main/java/info/nightscout/core/activities/NoSplashAppCompatActivity.kt index f823dcace5..b8fa30c201 100644 --- a/core/core-main/src/main/java/info/nightscout/core/activities/NoSplashAppCompatActivity.kt +++ b/core/core-main/src/main/java/info/nightscout/core/activities/NoSplashAppCompatActivity.kt @@ -2,7 +2,7 @@ package info.nightscout.core.activities import android.content.Context import android.os.Bundle import info.nightscout.core.main.R -import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.core.ui.locale.LocaleHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventThemeSwitch import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/core/ui/build.gradle b/core/ui/build.gradle index 8a2f568bb2..52a0cd105a 100644 --- a/core/ui/build.gradle +++ b/core/ui/build.gradle @@ -20,4 +20,7 @@ dependencies { api "androidx.preference:preference-ktx:$preferencektx_version" api "com.google.android.material:material:$material_version" + + api "com.google.dagger:dagger-android:$dagger_version" + api "com.google.dagger:dagger-android-support:$dagger_version" } \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/core/activities/DialogAppCompatActivity.kt b/core/ui/src/main/java/info/nightscout/core/ui/activities/DialogAppCompatActivity.kt similarity index 74% rename from core/core-main/src/main/java/info/nightscout/core/activities/DialogAppCompatActivity.kt rename to core/ui/src/main/java/info/nightscout/core/ui/activities/DialogAppCompatActivity.kt index f64e426a5a..1d52f7663c 100644 --- a/core/core-main/src/main/java/info/nightscout/core/activities/DialogAppCompatActivity.kt +++ b/core/ui/src/main/java/info/nightscout/core/ui/activities/DialogAppCompatActivity.kt @@ -1,8 +1,8 @@ -package info.nightscout.core.activities +package info.nightscout.core.ui.activities import android.content.Context import dagger.android.support.DaggerAppCompatActivity -import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.core.ui.locale.LocaleHelper open class DialogAppCompatActivity : DaggerAppCompatActivity() { override fun attachBaseContext(newBase: Context) { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/locale/LocaleHelper.kt b/core/ui/src/main/java/info/nightscout/core/ui/locale/LocaleHelper.kt similarity index 96% rename from interfaces/src/main/java/info/nightscout/interfaces/locale/LocaleHelper.kt rename to core/ui/src/main/java/info/nightscout/core/ui/locale/LocaleHelper.kt index 61520f1411..68c94a9d17 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/locale/LocaleHelper.kt +++ b/core/ui/src/main/java/info/nightscout/core/ui/locale/LocaleHelper.kt @@ -1,10 +1,10 @@ -package info.nightscout.interfaces.locale +package info.nightscout.core.ui.locale import android.content.Context import android.content.ContextWrapper import android.os.LocaleList import androidx.preference.PreferenceManager -import info.nightscout.interfaces.R +import info.nightscout.core.ui.R import java.util.Locale object LocaleHelper { diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml index 2869bdac52..f306028101 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/main/res/values/strings.xml @@ -6,6 +6,9 @@ Invalid input data Delivering %1$.2f U + + language + Confirmation Message diff --git a/interfaces/src/main/res/values/strings.xml b/interfaces/src/main/res/values/strings.xml index fa237576b1..306c12f87d 100644 --- a/interfaces/src/main/res/values/strings.xml +++ b/interfaces/src/main/res/values/strings.xml @@ -12,9 +12,6 @@ New debug format (unencrypted) Unknown export format - - language - * Only discrete values no ranges are supported as granularity for basal/bolus in virtual pump. diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/setupwizard/SetupWizardActivity.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/setupwizard/SetupWizardActivity.kt index 7ec9b23fc0..f2473f438c 100644 --- a/plugins/configuration/src/main/java/info/nightscout/configuration/setupwizard/SetupWizardActivity.kt +++ b/plugins/configuration/src/main/java/info/nightscout/configuration/setupwizard/SetupWizardActivity.kt @@ -11,7 +11,7 @@ import info.nightscout.configuration.setupwizard.elements.SWItem import info.nightscout.core.activities.NoSplashAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.locale.LocaleHelper.update +import info.nightscout.core.ui.locale.LocaleHelper.update import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventProfileStoreChanged diff --git a/plugins/main/src/main/java/info/nightscout/plugins/source/activities/RequestDexcomPermissionActivity.kt b/plugins/main/src/main/java/info/nightscout/plugins/source/activities/RequestDexcomPermissionActivity.kt index 53b2667bd2..97d2ecba8c 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/source/activities/RequestDexcomPermissionActivity.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/source/activities/RequestDexcomPermissionActivity.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.source.activities import android.os.Bundle -import info.nightscout.core.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.DialogAppCompatActivity import info.nightscout.plugins.source.DexcomPlugin class RequestDexcomPermissionActivity : DialogAppCompatActivity() { diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt index babb35674c..90ecdf5151 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.event.EventDialog import info.nightscout.androidaps.plugins.pump.eopatch.event.EventProgressDialog import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.AlarmDialog import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ProgressDialogHelper -import info.nightscout.core.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.DialogAppCompatActivity import info.nightscout.core.main.R import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt index 68113618cf..7a57c27f78 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui import android.os.Bundle import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ActivationNotCompleteDialog -import info.nightscout.core.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.DialogAppCompatActivity import info.nightscout.core.main.R class DialogHelperActivity : DialogAppCompatActivity() { diff --git a/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt index ab4d7d0f04..bc717782e5 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt @@ -1,7 +1,7 @@ package info.nightscout.ui.activities import android.os.Bundle -import info.nightscout.core.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.DialogAppCompatActivity import info.nightscout.ui.dialogs.BolusProgressDialog class BolusProgressHelperActivity : DialogAppCompatActivity() { 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 057c68c914..8da313a32c 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt @@ -2,7 +2,7 @@ package info.nightscout.ui.activities import android.os.Bundle import info.nightscout.androidaps.services.AlarmSoundService -import info.nightscout.core.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.DialogAppCompatActivity import info.nightscout.core.main.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction diff --git a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt index f5843c7229..d76e5b0343 100644 --- a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt @@ -13,7 +13,7 @@ import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.interfaces.logging.UserEntryLogger import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.core.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.DialogAppCompatActivity import info.nightscout.core.main.R import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt index 9c5924dc6a..99fd7237f0 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt @@ -9,7 +9,7 @@ import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.core.activities.DialogAppCompatActivity +import info.nightscout.core.ui.activities.DialogAppCompatActivity import info.nightscout.core.main.R import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources