diff --git a/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt b/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt
index 7e3043aa43..7de636b40a 100644
--- a/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt
+++ b/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt
@@ -15,6 +15,7 @@ import info.nightscout.androidaps.activities.PreferencesActivity
import info.nightscout.androidaps.services.AlarmSoundService
import info.nightscout.configuration.activities.SingleFragmentActivity
import info.nightscout.core.events.EventNewNotification
+import info.nightscout.core.ui.toast.ToastUtils
import info.nightscout.interfaces.notifications.Notification
import info.nightscout.interfaces.nsclient.NSAlarm
import info.nightscout.interfaces.ui.ActivityNames
@@ -169,10 +170,16 @@ class ActivityNamesImpl @Inject constructor(
}
override fun addNotificationValidTo(id: Int, date: Long, text: String, level: Int, validTo: Long) {
- rxBus.send(EventNewNotification(Notification(id, System.currentTimeMillis(), text, level,validTo)))
+ rxBus.send(EventNewNotification(Notification(id, System.currentTimeMillis(), text, level, validTo)))
}
override fun addNotificationWithAction(injector: HasAndroidInjector, nsAlarm: NSAlarm) {
rxBus.send(EventNewNotification(NotificationWithAction(injector, nsAlarm)))
}
+
+ override fun showToastAndNotification(ctx: Context?, string: String?, soundID: Int) {
+ ToastUtils.showToastInUiThread(ctx, string)
+ ToastUtils.playSound(ctx, soundID)
+ addNotification(Notification.TOAST_ALARM, string!!, Notification.URGENT)
+ }
}
\ No newline at end of file
diff --git a/core/core-main/src/main/java/info/nightscout/core/toast/ToastUtilsExtension.kt b/core/core-main/src/main/java/info/nightscout/core/toast/ToastUtilsExtension.kt
deleted file mode 100644
index a3e3a31af7..0000000000
--- a/core/core-main/src/main/java/info/nightscout/core/toast/ToastUtilsExtension.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package info.nightscout.core.toast
-
-import android.content.Context
-import info.nightscout.core.events.EventNewNotification
-import info.nightscout.core.ui.toast.ToastUtils
-import info.nightscout.interfaces.notifications.Notification
-import info.nightscout.rx.bus.RxBus
-
-fun ToastUtils.showToastAdNotification(
- ctx: Context?, rxBus: RxBus,
- string: String?, soundID: Int
-) {
- showToastInUiThread(ctx, string)
- playSound(ctx, soundID)
- val notification = Notification(Notification.TOAST_ALARM, string!!, Notification.URGENT)
- rxBus.send(EventNewNotification(notification))
-}
-
diff --git a/core/core-main/src/main/res/drawable/alert_border_error.xml b/core/core-main/src/main/res/drawable/alert_border_error.xml
deleted file mode 100644
index 310604bdea..0000000000
--- a/core/core-main/src/main/res/drawable/alert_border_error.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/core/core-main/src/main/res/drawable/alert_border_warning.xml b/core/core-main/src/main/res/drawable/alert_border_warning.xml
deleted file mode 100644
index 6c6feeafe2..0000000000
--- a/core/core-main/src/main/res/drawable/alert_border_warning.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/core/core-main/src/main/res/drawable/ic_cogs.xml b/core/core-main/src/main/res/drawable/ic_cogs.xml
deleted file mode 100644
index 9dea939197..0000000000
--- a/core/core-main/src/main/res/drawable/ic_cogs.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
diff --git a/core/core-main/src/main/res/drawable/ic_home_profile.xml b/core/core-main/src/main/res/drawable/ic_home_profile.xml
deleted file mode 100644
index 6caef133fe..0000000000
--- a/core/core-main/src/main/res/drawable/ic_home_profile.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/core/core-main/src/main/res/drawable/ic_intelligo.xml b/core/core-main/src/main/res/drawable/ic_intelligo.xml
deleted file mode 100644
index 6fe7de817b..0000000000
--- a/core/core-main/src/main/res/drawable/ic_intelligo.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/core/core-main/src/main/res/drawable/ic_maintenance.xml b/core/core-main/src/main/res/drawable/ic_maintenance.xml
deleted file mode 100644
index e04758af2a..0000000000
--- a/core/core-main/src/main/res/drawable/ic_maintenance.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
diff --git a/core/core-main/src/main/res/values/protection.xml b/core/core-main/src/main/res/values/protection.xml
index 210f286feb..db02248c4d 100644
--- a/core/core-main/src/main/res/values/protection.xml
+++ b/core/core-main/src/main/res/values/protection.xml
@@ -5,7 +5,6 @@
Settings protection
Application protection
Bolus protection
- Master password
Settings password
Settings PIN
Application password
@@ -14,13 +13,10 @@
Bolus PIN
Password and PIN retention [s]
Time before the password or PIN should be entered
- Unlock settings
Biometric
Custom password
Custom PIN
No protection
- Protection
- Master password is not set!\n\nPlease set your Master password in Preferences (%1$s → %2$s)
Unsecure Fallback
In order to be effective, biometric protection needs a master password set for fallback.\n\nPlease set a master password!
@@ -34,15 +30,4 @@
Enter password here
Enter PIN here
- master_password
- settings_password
- settings_pin
- application_password
- application_pin
- bolus_password
- bolus_pin
- settings_protection
- application_protection
- bolus_protection
- protection_timeout
diff --git a/core/core-main/src/main/res/values/strings.xml b/core/core-main/src/main/res/values/strings.xml
index c5153e33ff..2bd8da13da 100644
--- a/core/core-main/src/main/res/values/strings.xml
+++ b/core/core-main/src/main/res/values/strings.xml
@@ -74,7 +74,6 @@
Loop suspended
Trend arrow
Auto sens
- n/a
req
falling rapidly
falling
@@ -116,7 +115,6 @@
Closed Loop
Open Loop
Low Glucose Suspend
- Confirm
DIA
IC
ISF
@@ -194,7 +192,6 @@
Wear
Automation
Custom
- Pump
Loop
NS
Record
@@ -208,7 +205,6 @@
Success
Percent
Absolute
- Insulin
Waiting for result
SMB
@@ -234,34 +230,6 @@
Mute for 5 minutes
-
- exported %1$s ago
- exported at %1$s
- exported less than hour ago
- in directory: %1$s
- Select file to import
- Preferences were created with different variant of AAPS (%1$s) while you have: %2$s.\n\nSome settings may be missing or invalid - after importing please check and update your preferences.
- Preferences were created on a different device. It is OK if you are importing from older/different phone, but make sure imported preferences are correct!
- You are using the outdated legacy format from old versions of AAPS, which is not secure! Only use it as a last resort, if you do not have an export in current, JSON format.
- Imported preferences are already %1$s days old! Maybe you have more up-to-date preferences or you choose the wrong file? Remember to export preferences regularly!
- Invalid date-time format!
- Preferences from different minor version of application. It is OK if you are importing after upgrade, but check after import if preferences are still correct!
- Preferences from different major version of application. Major versions differ significantly and may have incompatible preferences! Make sure after import that preferences are still correct!
- Settings file tampered
- Settings file is secure
- Using not secure, unencrypted settings format
- JSON format error, missing required field (format, content, metadata or security)
- Decryption error, the given password cannot decrypt the file
- File checksum (hash) missing, cannot verify the authenticity of settings!
- File was modified after export!
- Decryption error, parsing preferences failed!
- Decryption error, the provided password is invalid or settings file was modified! It may happen that the imported file was exported with a different Master password.
- Missing encryption configuration, settings format is invalid!
- Unsupported or not specified encryption algorithm!
-
-
- Please reboot your phone or restart AAPS from the System Settings \notherwise Android APS will not have logging (important to track and verify that the algorithms are working correctly)!
-
BOLUS
BOLUS CALCULATOR
@@ -352,7 +320,6 @@
Action
Timestamp
No Unit
- Export User Entries to Excel (csv)
"%1$s;%2$s;%3$s;%4$s;%5$s;%6$s;%7$s;%8$s;%9$s;%10$s;%11$s;%12$s;%13$s;%14$s;%15$s;%16$s;%17$s"
LOOP CHANGED
LOOP REMOVED
@@ -373,7 +340,6 @@
»%1$s« is out of hard limits
»%1$s« %2$.2f is out of hard limits
Basal value
- AAPSClient version doesn\'t match AAPS version. Please update.
BOLUS %1$.2f U
@@ -467,9 +433,6 @@
Urgent Alarm
INFO
-
- Missing SMS permission
-
use_bolus_advisor
Bolus advisor
@@ -511,17 +474,4 @@
Max allowed carbs [g]
Patient type
-
- - %1$d day
- - %1$d days
-
-
- - %1$d hour
- - %1$d hours
-
-
- - %1$d minute
- - %1$d minutes
-
-
diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/ui/ActivityNames.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/ui/ActivityNames.kt
index d07957ab9c..70978a7979 100644
--- a/core/interfaces/src/main/java/info/nightscout/interfaces/ui/ActivityNames.kt
+++ b/core/interfaces/src/main/java/info/nightscout/interfaces/ui/ActivityNames.kt
@@ -67,4 +67,5 @@ interface ActivityNames {
fun addNotificationWithSound(id: Int, text: String, level: Int, @RawRes soundId: Int)
fun addNotificationValidTo(id: Int, date: Long, text: String, level: Int, validTo: Long)
fun addNotificationWithAction(injector: HasAndroidInjector, nsAlarm: NSAlarm)
+ fun showToastAndNotification(ctx: Context?, string: String?, @RawRes soundID: Int)
}
\ No newline at end of file
diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryPresentationHelper.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryPresentationHelper.kt
new file mode 100644
index 0000000000..720e9d4e8d
--- /dev/null
+++ b/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryPresentationHelper.kt
@@ -0,0 +1,19 @@
+package info.nightscout.interfaces.userEntry
+
+import android.text.Spanned
+import androidx.annotation.ColorRes
+import androidx.annotation.DrawableRes
+import info.nightscout.database.entities.UserEntry
+import info.nightscout.database.entities.UserEntry.Action
+import info.nightscout.database.entities.UserEntry.ColorGroup
+import info.nightscout.database.entities.UserEntry.Sources
+import info.nightscout.database.entities.ValueWithUnit
+
+interface UserEntryPresentationHelper {
+
+ @ColorRes fun colorId(colorGroup: ColorGroup): Int
+ @DrawableRes fun iconId(source: Sources): Int
+ fun actionToColoredString(action: Action): Spanned
+ fun listToPresentationString(list: List): String
+ fun userEntriesToCsv(userEntries: List): String
+}
diff --git a/core/ui/src/main/res/drawable/ic_cogs.xml b/core/ui/src/main/res/drawable/ic_cogs.xml
new file mode 100644
index 0000000000..f1c7c70670
--- /dev/null
+++ b/core/ui/src/main/res/drawable/ic_cogs.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/core/core-main/src/main/res/drawable/ic_home.xml b/core/ui/src/main/res/drawable/ic_home.xml
similarity index 59%
rename from core/core-main/src/main/res/drawable/ic_home.xml
rename to core/ui/src/main/res/drawable/ic_home.xml
index e59b825394..ddfba665b0 100644
--- a/core/core-main/src/main/res/drawable/ic_home.xml
+++ b/core/ui/src/main/res/drawable/ic_home.xml
@@ -3,7 +3,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
-
+
diff --git a/core/ui/src/main/res/drawable/ic_home_profile.xml b/core/ui/src/main/res/drawable/ic_home_profile.xml
new file mode 100644
index 0000000000..f14a824037
--- /dev/null
+++ b/core/ui/src/main/res/drawable/ic_home_profile.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/core/ui/src/main/res/drawable/ic_intelligo.xml b/core/ui/src/main/res/drawable/ic_intelligo.xml
new file mode 100644
index 0000000000..76287a71a0
--- /dev/null
+++ b/core/ui/src/main/res/drawable/ic_intelligo.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core/ui/src/main/res/drawable/ic_maintenance.xml b/core/ui/src/main/res/drawable/ic_maintenance.xml
new file mode 100644
index 0000000000..010fe21d03
--- /dev/null
+++ b/core/ui/src/main/res/drawable/ic_maintenance.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/core/core-main/src/main/res/drawable/ic_nightscout_syncs.xml b/core/ui/src/main/res/drawable/ic_nightscout_syncs.xml
similarity index 100%
rename from core/core-main/src/main/res/drawable/ic_nightscout_syncs.xml
rename to core/ui/src/main/res/drawable/ic_nightscout_syncs.xml
diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml
index f87cd8051e..ce1d1e61b8 100644
--- a/core/ui/src/main/res/values/strings.xml
+++ b/core/ui/src/main/res/values/strings.xml
@@ -34,6 +34,16 @@
Settings
Status lights
Upload BG data to NS
+ Insulin
+ n/a
+ Master password
+ Export User Entries to Excel (csv)
+ Confirm
+ Pump
+
+
+
+ Unlock settings
Battery
@@ -114,4 +124,20 @@
Plugin preferences
+
+ Missing SMS permission
+
+
+ - %1$d day
+ - %1$d days
+
+
+ - %1$d hour
+ - %1$d hours
+
+
+ - %1$d minute
+ - %1$d minutes
+
+
\ No newline at end of file
diff --git a/core/utils/src/main/res/values/keys.xml b/core/utils/src/main/res/values/keys.xml
index 244df0330d..87afbcd37a 100644
--- a/core/utils/src/main/res/values/keys.xml
+++ b/core/utils/src/main/res/values/keys.xml
@@ -132,5 +132,16 @@
ns_receive_cgm
ns_create_announcements_from_carbs_req
dexcomg5_nsupload
+ master_password
+ settings_password
+ settings_pin
+ application_password
+ application_pin
+ bolus_password
+ bolus_pin
+ settings_protection
+ application_protection
+ bolus_protection
+ protection_timeout
\ No newline at end of file
diff --git a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt
index 385dae2c9f..1a8e4c7719 100644
--- a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt
+++ b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt
@@ -3,12 +3,10 @@ package info.nightscout.implementation
import android.content.Context
import info.nightscout.androidaps.annotations.OpenForTesting
import info.nightscout.core.main.R
-import info.nightscout.core.toast.showToastAdNotification
-import info.nightscout.core.ui.toast.ToastUtils
import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction
+import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.interfaces.utils.HardLimits
-import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.shared.interfaces.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP
@@ -23,11 +21,11 @@ import kotlin.math.min
@Singleton
class HardLimitsImpl @Inject constructor(
private val aapsLogger: AAPSLogger,
- private val rxBus: RxBus,
+ private val activityNames: ActivityNames,
private val sp: SP,
private val rh: ResourceHelper,
private val context: Context,
- private val repository: AppRepository
+ private val repository: AppRepository,
) : HardLimits {
private val disposable = CompositeDisposable()
@@ -102,7 +100,7 @@ class HardLimitsImpl @Inject constructor(
msg += rh.gs(R.string.valuelimitedto, value, newValue)
aapsLogger.error(msg)
disposable += repository.runTransaction(InsertTherapyEventAnnouncementTransaction(msg)).subscribe()
- ToastUtils.showToastAdNotification(context, rxBus, msg, R.raw.error)
+ activityNames.showToastAndNotification(context, msg, R.raw.error)
}
return newValue
}
diff --git a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt
index 3bae5556e3..1ede1e97a9 100644
--- a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt
+++ b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt
@@ -39,6 +39,7 @@ import info.nightscout.implementation.stats.DexcomTirCalculatorImpl
import info.nightscout.implementation.stats.TddCalculatorImpl
import info.nightscout.implementation.stats.TirCalculatorImpl
import info.nightscout.implementation.storage.FileStorage
+import info.nightscout.implementation.userEntry.UserEntryPresentationHelperImpl
import info.nightscout.interfaces.BolusTimer
import info.nightscout.interfaces.CarbTimer
import info.nightscout.interfaces.LocalAlertUtils
@@ -68,6 +69,7 @@ import info.nightscout.interfaces.stats.TddCalculator
import info.nightscout.interfaces.stats.TirCalculator
import info.nightscout.interfaces.storage.Storage
import info.nightscout.interfaces.ui.IconsProvider
+import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper
import info.nightscout.interfaces.utils.HardLimits
import info.nightscout.interfaces.utils.TrendCalculator
import info.nightscout.shared.interfaces.ResourceHelper
@@ -121,5 +123,6 @@ abstract class ImplementationModule {
@Binds fun bindsProfileFunction(profileFunctionImpl: ProfileFunctionImpl): ProfileFunction
@Binds fun bindsStorage(fileStorage: FileStorage): Storage
@Binds fun bindsReceiverStatusStore(receiverStatusStoreImpl: ReceiverStatusStoreImpl): ReceiverStatusStore
+ @Binds fun bindsUserEntryPresentationHelper(userEntryPresentationHelperImpl: UserEntryPresentationHelperImpl): UserEntryPresentationHelper
}
}
\ No newline at end of file
diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt
similarity index 87%
rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt
rename to implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt
index 7e50e62764..2330e151b0 100644
--- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt
+++ b/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.utils.userEntry
+package info.nightscout.implementation.userEntry
import android.text.Spanned
import dagger.Reusable
@@ -13,6 +13,7 @@ import info.nightscout.interfaces.GlucoseUnit
import info.nightscout.interfaces.Translator
import info.nightscout.interfaces.profile.Profile
import info.nightscout.interfaces.profile.ProfileFunction
+import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper
import info.nightscout.interfaces.utils.DecimalFormatter
import info.nightscout.interfaces.utils.HtmlHelper
import info.nightscout.shared.interfaces.ResourceHelper
@@ -20,14 +21,14 @@ import info.nightscout.shared.utils.DateUtil
import javax.inject.Inject
@Reusable
-class UserEntryPresentationHelper @Inject constructor(
+class UserEntryPresentationHelperImpl @Inject constructor(
private val translator: Translator,
private val profileFunction: ProfileFunction,
private val rh: ResourceHelper,
private val dateUtil: DateUtil
-) {
+) : UserEntryPresentationHelper {
- fun colorId(colorGroup: ColorGroup): Int = when (colorGroup) {
+ override fun colorId(colorGroup: ColorGroup): Int = when (colorGroup) {
ColorGroup.InsulinTreatment -> R.color.iob
ColorGroup.BasalTreatment -> R.color.basal
ColorGroup.CarbTreatment -> R.color.carbs
@@ -40,7 +41,7 @@ class UserEntryPresentationHelper @Inject constructor(
else -> R.color.defaultText
}
- fun iconId(source: Sources): Int = when (source) {
+ override fun iconId(source: Sources): Int = when (source) {
Sources.TreatmentDialog -> R.drawable.icon_insulin_carbs
Sources.InsulinDialog -> R.drawable.ic_bolus
Sources.CarbDialog -> R.drawable.ic_cp_bolus_carbs
@@ -109,14 +110,14 @@ class UserEntryPresentationHelper @Inject constructor(
Sources.Unknown -> R.drawable.ic_generic_icon
}
- fun actionToColoredString(action: Action): Spanned = when (action) {
+ override fun actionToColoredString(action: Action): Spanned = when (action) {
Action.TREATMENT -> HtmlHelper.fromHtml(coloredAction(Action.BOLUS) + " + " + coloredAction(Action.CARBS))
else -> HtmlHelper.fromHtml(coloredAction(action))
}
private fun coloredAction(action: Action): String = "${translator.translate(action)}"
- fun listToPresentationString(list: List) =
+ override fun listToPresentationString(list: List) =
list.joinToString(separator = " ", transform = this::toPresentationString)
private fun toPresentationString(valueWithUnit: ValueWithUnit?): String = when (valueWithUnit) {
@@ -148,28 +149,29 @@ class UserEntryPresentationHelper @Inject constructor(
null -> ""
}
- fun userEntriesToCsv(userEntries: List): String {
+ override fun userEntriesToCsv(userEntries: List): String {
return getCsvHeader() + userEntries.joinToString("\n") { entry -> getCsvEntry(entry) }
}
- private fun getCsvHeader() = rh.gs(R.string.ue_csv_header,
- csvString(R.string.ue_timestamp),
- csvString(R.string.date),
- csvString(R.string.ue_utc_offset),
- csvString(R.string.ue_action),
- csvString(R.string.event_type),
- csvString(R.string.ue_source),
- csvString(R.string.careportal_note),
- csvString(R.string.ue_string),
- csvString(R.string.event_time_label),
- csvString(if (profileFunction.getUnits() == GlucoseUnit.MGDL) R.string.mgdl else R.string.mmol),
- csvString(R.string.shortgram),
- csvString(R.string.insulin_unit_shortname),
- csvString(R.string.profile_ins_units_per_hour),
- csvString(R.string.shortpercent),
- csvString(R.string.shorthour),
- csvString(R.string.shortminute),
- csvString(R.string.ue_none)
+ private fun getCsvHeader() = rh.gs(
+ R.string.ue_csv_header,
+ csvString(R.string.ue_timestamp),
+ csvString(R.string.date),
+ csvString(R.string.ue_utc_offset),
+ csvString(R.string.ue_action),
+ csvString(R.string.event_type),
+ csvString(R.string.ue_source),
+ csvString(R.string.careportal_note),
+ csvString(R.string.ue_string),
+ csvString(R.string.event_time_label),
+ csvString(if (profileFunction.getUnits() == GlucoseUnit.MGDL) R.string.mgdl else R.string.mmol),
+ csvString(R.string.shortgram),
+ csvString(R.string.insulin_unit_shortname),
+ csvString(R.string.profile_ins_units_per_hour),
+ csvString(R.string.shortpercent),
+ csvString(R.string.shorthour),
+ csvString(R.string.shortminute),
+ csvString(R.string.ue_none)
) + "\n"
private fun getCsvEntry(entry: UserEntry): String {
diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/activities/DaggerAppCompatActivityWithResult.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/activities/DaggerAppCompatActivityWithResult.kt
index 41c07e48ee..3e29e06b2d 100644
--- a/plugins/configuration/src/main/java/info/nightscout/configuration/activities/DaggerAppCompatActivityWithResult.kt
+++ b/plugins/configuration/src/main/java/info/nightscout/configuration/activities/DaggerAppCompatActivityWithResult.kt
@@ -7,8 +7,8 @@ import android.os.Bundle
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.app.ActivityCompat
import dagger.android.support.DaggerAppCompatActivity
+import info.nightscout.configuration.R
import info.nightscout.configuration.maintenance.PrefsFileContract
-import info.nightscout.core.main.R
import info.nightscout.core.ui.dialogs.OKDialog
import info.nightscout.core.ui.locale.LocaleHelper
import info.nightscout.interfaces.maintenance.ImportExportPrefs
diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/configBuilder/RunningConfigurationImpl.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/configBuilder/RunningConfigurationImpl.kt
index 32a54ca971..e300a9b239 100644
--- a/plugins/configuration/src/main/java/info/nightscout/configuration/configBuilder/RunningConfigurationImpl.kt
+++ b/plugins/configuration/src/main/java/info/nightscout/configuration/configBuilder/RunningConfigurationImpl.kt
@@ -1,7 +1,6 @@
package info.nightscout.configuration.configBuilder
-import info.nightscout.core.events.EventNewNotification
-import info.nightscout.core.main.R
+import info.nightscout.configuration.R
import info.nightscout.interfaces.Config
import info.nightscout.interfaces.ConfigBuilder
import info.nightscout.interfaces.aps.Sensitivity
@@ -12,6 +11,7 @@ import info.nightscout.interfaces.plugin.ActivePlugin
import info.nightscout.interfaces.plugin.PluginType
import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.interfaces.pump.defs.PumpType
+import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventNSClientNewLog
import info.nightscout.rx.logging.AAPSLogger
@@ -33,7 +33,8 @@ class RunningConfigurationImpl @Inject constructor(
private val config: Config,
private val rh: ResourceHelper,
private val rxBus: RxBus,
- private val pumpSync: PumpSync
+ private val pumpSync: PumpSync,
+ private val activityNames: ActivityNames
) : RunningConfiguration {
private var counter = 0
@@ -73,7 +74,7 @@ class RunningConfigurationImpl @Inject constructor(
configuration.version?.let {
rxBus.send(EventNSClientNewLog("VERSION", "Received AndroidAPS version $it"))
if (config.VERSION_NAME.startsWith(it).not())
- rxBus.send(EventNewNotification(Notification(Notification.NSCLIENT_VERSION_DOES_NOT_MATCH, rh.gs(R.string.nsclient_version_does_not_match), Notification.NORMAL)))
+ activityNames.addNotification(Notification.NSCLIENT_VERSION_DOES_NOT_MATCH, rh.gs(R.string.nsclient_version_does_not_match), Notification.NORMAL)
}
configuration.insulin?.let {
val insulin = Insulin.InsulinType.fromInt(it)
diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/ImportExportPrefsImpl.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/ImportExportPrefsImpl.kt
index 9c747f00f5..a04d661199 100644
--- a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/ImportExportPrefsImpl.kt
+++ b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/ImportExportPrefsImpl.kt
@@ -20,7 +20,6 @@ import androidx.work.Worker
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import dagger.android.HasAndroidInjector
-import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper
import info.nightscout.configuration.R
import info.nightscout.configuration.activities.DaggerAppCompatActivityWithResult
import info.nightscout.configuration.maintenance.dialogs.PrefImportSummaryDialog
@@ -49,6 +48,7 @@ import info.nightscout.interfaces.maintenance.PrefsStatus
import info.nightscout.interfaces.protection.PasswordCheck
import info.nightscout.interfaces.storage.Storage
import info.nightscout.interfaces.ui.ActivityNames
+import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper
import info.nightscout.interfaces.utils.MidnightTime
import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventAppExit
diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/PrefFileListProviderImpl.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/PrefFileListProviderImpl.kt
index 6394ec32c5..78301a5b26 100644
--- a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/PrefFileListProviderImpl.kt
+++ b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/PrefFileListProviderImpl.kt
@@ -5,8 +5,8 @@ import android.os.Environment
import dagger.Lazy
import dagger.Reusable
import info.nightscout.androidaps.annotations.OpenForTesting
+import info.nightscout.configuration.R
import info.nightscout.configuration.maintenance.formats.EncryptedPrefsFormat
-import info.nightscout.core.main.R
import info.nightscout.interfaces.Config
import info.nightscout.interfaces.maintenance.PrefFileListProvider
import info.nightscout.interfaces.maintenance.PrefMetadata
diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt
index 04dcb54f17..5f98bbe14e 100644
--- a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt
+++ b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/activities/PrefImportListActivity.kt
@@ -11,10 +11,10 @@ import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerAppCompatActivity
+import info.nightscout.configuration.R
import info.nightscout.configuration.databinding.MaintenanceImportListActivityBinding
import info.nightscout.configuration.databinding.MaintenanceImportListItemBinding
import info.nightscout.configuration.maintenance.PrefsFileContract
-import info.nightscout.core.main.R
import info.nightscout.core.ui.locale.LocaleHelper
import info.nightscout.interfaces.maintenance.PrefFileListProvider
import info.nightscout.interfaces.maintenance.PrefsFile
@@ -87,8 +87,8 @@ class PrefImportListActivity : DaggerAppCompatActivity() {
prefFile.metadata[PrefsMetadataKey.AAPS_FLAVOUR]?.let {
metaVariantFormat.text = it.value
- val colorattr = if (it.status == PrefsStatus.OK) R.attr.metadataTextOkColor else R.attr.metadataTextWarningColor
- metaVariantFormat.setTextColor(rh.gac( metaVariantFormat.context, colorattr))
+ val colorAttr = if (it.status == PrefsStatus.OK) R.attr.metadataTextOkColor else R.attr.metadataTextWarningColor
+ metaVariantFormat.setTextColor(rh.gac(metaVariantFormat.context, colorAttr))
}
prefFile.metadata[PrefsMetadataKey.CREATED_AT]?.let {
@@ -97,8 +97,8 @@ class PrefImportListActivity : DaggerAppCompatActivity() {
prefFile.metadata[PrefsMetadataKey.AAPS_VERSION]?.let {
metaAppVersion.text = it.value
- val colorattr = if (it.status == PrefsStatus.OK) R.attr.metadataTextOkColor else R.attr.metadataTextWarningColor
- metaAppVersion.setTextColor(rh.gac( metaVariantFormat.context, colorattr))
+ val colorAttr = if (it.status == PrefsStatus.OK) R.attr.metadataTextOkColor else R.attr.metadataTextWarningColor
+ metaAppVersion.setTextColor(rh.gac(metaVariantFormat.context, colorAttr))
}
prefFile.metadata[PrefsMetadataKey.DEVICE_NAME]?.let {
diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/formats/EncryptedPrefsFormat.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/formats/EncryptedPrefsFormat.kt
index 407b641cce..2ad6d754ce 100644
--- a/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/formats/EncryptedPrefsFormat.kt
+++ b/plugins/configuration/src/main/java/info/nightscout/configuration/maintenance/formats/EncryptedPrefsFormat.kt
@@ -1,6 +1,6 @@
package info.nightscout.configuration.maintenance.formats
-import info.nightscout.core.main.R
+import info.nightscout.configuration.R
import info.nightscout.core.utils.CryptoUtil
import info.nightscout.core.utils.hexStringToByteArray
import info.nightscout.core.utils.toHex
diff --git a/plugins/configuration/src/main/res/values/strings.xml b/plugins/configuration/src/main/res/values/strings.xml
index 2ea650c9c9..ceec78a3e7 100644
--- a/plugins/configuration/src/main/res/values/strings.xml
+++ b/plugins/configuration/src/main/res/values/strings.xml
@@ -83,6 +83,7 @@
Used for configuring the active plugins
Attention: If you activate and connect to a hardware pump, AAPS will copy the basal settings from the profile to the pump, overwriting the existing basal rate stored on the pump. Make sure you have the correct basal setting in AAPS. If you are not sure or don\'t want to overwrite the basal settings on your pump, press cancel and repeat switching to the pump at a later time.
open settings
+ AAPSClient version doesn\'t match AAPS version. Please update.
Preferences
@@ -110,6 +111,8 @@
Please go back to main screen and try again.
Exiting application to apply settings.
User Entries exported
+ Protection
+ Master password is not set!\n\nPlease set your Master password in Preferences (%1$s → %2$s)
@@ -136,4 +139,32 @@
Reset Databases
Reset to defaults
+
+ exported %1$s ago
+ exported at %1$s
+ exported less than hour ago
+ in directory: %1$s
+ Select file to import
+ Preferences were created with different variant of AAPS (%1$s) while you have: %2$s.\n\nSome settings may be missing or invalid - after importing please check and update your preferences.
+ Preferences were created on a different device. It is OK if you are importing from older/different phone, but make sure imported preferences are correct!
+ You are using the outdated legacy format from old versions of AAPS, which is not secure! Only use it as a last resort, if you do not have an export in current, JSON format.
+ Imported preferences are already %1$s days old! Maybe you have more up-to-date preferences or you choose the wrong file? Remember to export preferences regularly!
+ Invalid date-time format!
+ Preferences from different minor version of application. It is OK if you are importing after upgrade, but check after import if preferences are still correct!
+ Preferences from different major version of application. Major versions differ significantly and may have incompatible preferences! Make sure after import that preferences are still correct!
+ Settings file tampered
+ Settings file is secure
+ Using not secure, unencrypted settings format
+ JSON format error, missing required field (format, content, metadata or security)
+ Decryption error, the given password cannot decrypt the file
+ File checksum (hash) missing, cannot verify the authenticity of settings!
+ File was modified after export!
+ Decryption error, parsing preferences failed!
+ Decryption error, the provided password is invalid or settings file was modified! It may happen that the imported file was exported with a different Master password.
+ Missing encryption configuration, settings format is invalid!
+ Unsupported or not specified encryption algorithm!
+
+
+ Please reboot your phone or restart AAPS from the System Settings \notherwise Android APS will not have logging (important to track and verify that the algorithms are working correctly)!
+
\ No newline at end of file
diff --git a/plugins/main/build.gradle b/plugins/main/build.gradle
index 3dd658c912..95d272969e 100644
--- a/plugins/main/build.gradle
+++ b/plugins/main/build.gradle
@@ -34,18 +34,6 @@ dependencies {
// Actions
api "androidx.gridlayout:gridlayout:$gridlayout_version"
- // NSClient, Tidepool
- api("io.socket:socket.io-client:1.0.0") {
- // excluding org.json which is provided by Android
- exclude group: "org.json", module: "json"
- }
- api "com.squareup.okhttp3:okhttp:$okhttp3_version"
- api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version"
- //api "com.squareup.retrofit2:retrofit:$retrofit2_version"
- api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version"
- api "com.squareup.retrofit2:converter-gson:$retrofit2_version"
-
-
//SmsCommunicator
api 'com.eatthepath:java-otp:0.4.0'
api 'com.github.kenglxn.QRGen:android:2.6.0'
diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt
index aae1222ba9..7e98f51af3 100644
--- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt
+++ b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt
@@ -3,7 +3,7 @@ package info.nightscout.plugins.skins
import info.nightscout.plugins.R
import info.nightscout.plugins.di.SkinsModule
import info.nightscout.shared.sharedPreferences.SP
-import okhttp3.internal.toImmutableMap
+import java.util.Collections
import javax.inject.Inject
import javax.inject.Singleton
@@ -19,4 +19,9 @@ class SkinProvider @Inject constructor(
val list: List
get() = allSkins.toImmutableMap().toList().sortedBy { it.first }.map { it.second }
+
+ /** Returns an immutable copy of this. */
+ private fun Map.toImmutableMap(): Map =
+ if (isEmpty()) emptyMap()
+ else Collections.unmodifiableMap(LinkedHashMap(this))
}
diff --git a/core/core-main/src/main/res/drawable/ic_insulin.xml b/plugins/main/src/main/res/drawable/ic_insulin.xml
similarity index 100%
rename from core/core-main/src/main/res/drawable/ic_insulin.xml
rename to plugins/main/src/main/res/drawable/ic_insulin.xml
diff --git a/plugins/sync/build.gradle b/plugins/sync/build.gradle
index e10393fd41..7ca2acc51f 100644
--- a/plugins/sync/build.gradle
+++ b/plugins/sync/build.gradle
@@ -20,16 +20,12 @@ dependencies {
implementation project(':database:entities')
implementation project(':database:impl')
implementation project(':core:core-main')
- implementation project(':core:graph')
- implementation project(':core:graphview')
implementation project(':core:interfaces')
implementation project(':core:ns-sdk')
implementation project(':core:ui')
implementation project(':core:utils')
implementation project(':core:validators')
- api "androidx.appcompat:appcompat:$appcompat_version"
- api "com.google.android.material:material:$material_version"
// NSClient, Tidepool
api("io.socket:socket.io-client:1.0.0") {
@@ -42,17 +38,5 @@ dependencies {
api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version"
api "com.squareup.retrofit2:converter-gson:$retrofit2_version"
-
- //SmsCommunicator
- api 'com.eatthepath:java-otp:0.4.0'
- api 'com.github.kenglxn.QRGen:android:2.6.0'
-
- // Overview
- api 'com.google.android.flexbox:flexbox:3.0.0'
-
- // Food
- api "androidx.work:work-runtime-ktx:$work_version"
-
- // DataLayerListenerService
- api "com.google.android.gms:play-services-wearable:$play_services_wearable_version"
+ api "com.google.code.gson:gson:$gson_version"
}
\ No newline at end of file
diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt
index a84b079e19..03534dbd27 100644
--- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt
+++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt
@@ -5,7 +5,6 @@ import android.os.SystemClock
import androidx.work.Worker
import androidx.work.WorkerParameters
import dagger.android.HasAndroidInjector
-import info.nightscout.core.events.EventNewNotification
import info.nightscout.database.entities.Bolus
import info.nightscout.database.entities.BolusCalculatorResult
import info.nightscout.database.entities.Carbs
@@ -40,6 +39,7 @@ import info.nightscout.interfaces.notifications.Notification
import info.nightscout.interfaces.nsclient.StoreDataForDb
import info.nightscout.interfaces.pump.VirtualPump
import info.nightscout.interfaces.source.NSClientSource
+import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.plugins.sync.R
import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventNSClientNewLog
@@ -72,7 +72,8 @@ class StoreDataForDbImpl @Inject constructor(
private val config: Config,
private val nsClientSource: NSClientSource,
private val xDripBroadcast: XDripBroadcast,
- private val virtualPump: VirtualPump
+ private val virtualPump: VirtualPump,
+ private val activityNames: ActivityNames
) : StoreDataForDb {
override val glucoseValues: MutableList = mutableListOf()
@@ -528,7 +529,7 @@ class StoreDataForDbImpl @Inject constructor(
it.enteredBy != sp.getString("careportal_enteredby", "AndroidAPS")
) {
if (sp.getBoolean(R.string.key_ns_announcements, config.NSCLIENT))
- rxBus.send(EventNewNotification(Notification(Notification.NS_ANNOUNCEMENT, it.note ?: "", Notification.ANNOUNCEMENT, 60)))
+ activityNames.addNotificationValidFor(Notification.NS_ANNOUNCEMENT, it.note ?: "", Notification.ANNOUNCEMENT, 60)
}
}
if (therapyEvents.isNotEmpty())
diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt
index 9330d8ed62..ad6113b846 100644
--- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt
+++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt
@@ -12,17 +12,17 @@ import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceScreen
import androidx.preference.SwitchPreference
import dagger.android.HasAndroidInjector
-import info.nightscout.core.toast.showToastAdNotification
-import info.nightscout.core.ui.toast.ToastUtils
import info.nightscout.core.utils.fabric.FabricPrivacy
import info.nightscout.interfaces.Config
import info.nightscout.interfaces.Constants
+import info.nightscout.interfaces.nsclient.NSAlarm
import info.nightscout.interfaces.plugin.PluginBase
import info.nightscout.interfaces.plugin.PluginDescription
import info.nightscout.interfaces.plugin.PluginType
import info.nightscout.interfaces.sync.DataSyncSelector
import info.nightscout.interfaces.sync.NsClient
import info.nightscout.interfaces.sync.Sync
+import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.interfaces.utils.HtmlHelper.fromHtml
import info.nightscout.plugins.sync.R
import info.nightscout.plugins.sync.nsShared.NSClientFragment
@@ -30,7 +30,6 @@ import info.nightscout.plugins.sync.nsShared.events.EventNSClientResend
import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI
import info.nightscout.plugins.sync.nsclient.data.AlarmAck
-import info.nightscout.interfaces.nsclient.NSAlarm
import info.nightscout.plugins.sync.nsclient.services.NSClientService
import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus
@@ -61,7 +60,8 @@ class NSClientPlugin @Inject constructor(
private val sp: SP,
private val nsClientReceiverDelegate: NsClientReceiverDelegate,
private val config: Config,
- private val dataSyncSelector: DataSyncSelector
+ private val dataSyncSelector: DataSyncSelector,
+ private val activityNames: ActivityNames
) : NsClient, Sync, PluginBase(
PluginDescription()
.mainType(PluginType.SYNC)
@@ -185,7 +185,7 @@ class NSClientPlugin @Inject constructor(
}
return fromHtml(newTextLog.toString())
} catch (e: OutOfMemoryError) {
- ToastUtils.showToastAdNotification(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error)
+ activityNames.showToastAndNotification(context, "Out of memory!\nStop using this phone !!!", R.raw.error)
}
return fromHtml("")
}
diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt
index 199dbc3592..dcb1c5af51 100644
--- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt
+++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt
@@ -2,7 +2,6 @@ package info.nightscout.plugins.sync.nsclient.data
import android.content.Context
import info.nightscout.androidaps.annotations.OpenForTesting
-import info.nightscout.core.events.EventNewNotification
import info.nightscout.core.ui.dialogs.OKDialog
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.UserEntry.Action
@@ -11,6 +10,7 @@ import info.nightscout.interfaces.logging.UserEntryLogger
import info.nightscout.interfaces.notifications.Notification
import info.nightscout.interfaces.nsclient.NSSettingsStatus
import info.nightscout.interfaces.profile.DefaultValueHelper
+import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.interfaces.utils.JsonHelper
import info.nightscout.plugins.sync.R
import info.nightscout.rx.bus.RxBus
@@ -123,7 +123,8 @@ class NSSettingsStatusImpl @Inject constructor(
private val defaultValueHelper: DefaultValueHelper,
private val sp: SP,
private val config: Config,
- private val uel: UserEntryLogger
+ private val uel: UserEntryLogger,
+ private val activityNames: ActivityNames
) : NSSettingsStatus {
// ***** PUMP STATUS ******
@@ -150,8 +151,7 @@ class NSSettingsStatusImpl @Inject constructor(
data = status
aapsLogger.debug(LTag.NSCLIENT, "Got versions: Nightscout: ${getVersion()}")
if (getVersionNum() < config.SUPPORTEDNSVERSION) {
- val notification = Notification(Notification.OLD_NS, rh.gs(R.string.unsupported_ns_version), Notification.NORMAL)
- rxBus.send(EventNewNotification(notification))
+ activityNames.addNotification(Notification.OLD_NS, rh.gs(R.string.unsupported_ns_version), Notification.NORMAL)
} else {
rxBus.send(EventDismissNotification(Notification.OLD_NS))
}
diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt
index 1cbf6b1e70..5a9bfcb074 100644
--- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt
+++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt
@@ -12,16 +12,16 @@ import androidx.work.OneTimeWorkRequest
import androidx.work.WorkInfo
import androidx.work.WorkManager
import dagger.android.HasAndroidInjector
-import info.nightscout.core.toast.showToastAdNotification
-import info.nightscout.core.ui.toast.ToastUtils
import info.nightscout.core.utils.fabric.FabricPrivacy
import info.nightscout.interfaces.Config
import info.nightscout.interfaces.Constants
+import info.nightscout.interfaces.nsclient.NSAlarm
import info.nightscout.interfaces.plugin.PluginBase
import info.nightscout.interfaces.plugin.PluginDescription
import info.nightscout.interfaces.plugin.PluginType
import info.nightscout.interfaces.sync.NsClient
import info.nightscout.interfaces.sync.Sync
+import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.interfaces.utils.HtmlHelper
import info.nightscout.plugins.sync.R
import info.nightscout.plugins.sync.nsShared.NSClientFragment
@@ -29,7 +29,6 @@ import info.nightscout.plugins.sync.nsShared.events.EventNSClientResend
import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI
import info.nightscout.plugins.sync.nsclient.NsClientReceiverDelegate
-import info.nightscout.interfaces.nsclient.NSAlarm
import info.nightscout.plugins.sync.nsclient.data.AlarmAck
import info.nightscout.plugins.sync.nsclient.services.NSClientService
import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker
@@ -71,7 +70,8 @@ class NSClientV3Plugin @Inject constructor(
private val sp: SP,
private val nsClientReceiverDelegate: NsClientReceiverDelegate,
private val config: Config,
- private val dateUtil: DateUtil
+ private val dateUtil: DateUtil,
+ private val activityNames: ActivityNames
) : NsClient, Sync, PluginBase(
PluginDescription()
.mainType(PluginType.SYNC)
@@ -225,7 +225,7 @@ class NSClientV3Plugin @Inject constructor(
}
return HtmlHelper.fromHtml(newTextLog.toString())
} catch (e: OutOfMemoryError) {
- ToastUtils.showToastAdNotification(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error)
+ activityNames.showToastAndNotification(context, "Out of memory!\nStop using this phone !!!", R.raw.error)
}
return HtmlHelper.fromHtml("")
}
diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt
index 8f2fb46e86..da382f6e50 100644
--- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt
+++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt
@@ -5,15 +5,14 @@ import android.text.Spanned
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import dagger.android.HasAndroidInjector
-import info.nightscout.core.toast.showToastAdNotification
-import info.nightscout.core.ui.toast.ToastUtils
import info.nightscout.core.utils.fabric.FabricPrivacy
-import info.nightscout.interfaces.receivers.ReceiverStatusStore
import info.nightscout.interfaces.Constants
import info.nightscout.interfaces.plugin.PluginBase
import info.nightscout.interfaces.plugin.PluginDescription
import info.nightscout.interfaces.plugin.PluginType
+import info.nightscout.interfaces.receivers.ReceiverStatusStore
import info.nightscout.interfaces.sync.Sync
+import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.interfaces.utils.HtmlHelper
import info.nightscout.plugins.sync.R
import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader
@@ -51,7 +50,8 @@ class TidepoolPlugin @Inject constructor(
private val uploadChunk: UploadChunk,
private val sp: SP,
private val rateLimit: RateLimit,
- private val receiverStatusStore: ReceiverStatusStore
+ private val receiverStatusStore: ReceiverStatusStore,
+ private val activityNames: ActivityNames
) : Sync, PluginBase(
PluginDescription()
.mainType(PluginType.SYNC)
@@ -172,7 +172,7 @@ class TidepoolPlugin @Inject constructor(
}
textLog = HtmlHelper.fromHtml(newTextLog.toString())
} catch (e: OutOfMemoryError) {
- ToastUtils.showToastAdNotification(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error)
+ activityNames.showToastAndNotification(context, "Out of memory!\nStop using this phone !!!", R.raw.error)
}
}
diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt
index f3ac31fb53..972c8ee071 100644
--- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt
+++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt
@@ -12,8 +12,6 @@ import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
-import info.nightscout.interfaces.logging.UserEntryLogger
-import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper
import info.nightscout.core.ui.dialogs.OKDialog
import info.nightscout.core.ui.toast.ToastUtils
import info.nightscout.core.utils.fabric.FabricPrivacy
@@ -21,8 +19,10 @@ import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.UserEntry.Action
import info.nightscout.database.entities.UserEntry.Sources
import info.nightscout.database.impl.AppRepository
+import info.nightscout.interfaces.logging.UserEntryLogger
import info.nightscout.interfaces.maintenance.ImportExportPrefs
import info.nightscout.interfaces.profile.ProfileFunction
+import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper
import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPreferenceChange