DanaRS: remove core dependency
This commit is contained in:
parent
7fae8335a6
commit
ea8b817e53
220 changed files with 883 additions and 710 deletions
|
@ -193,6 +193,7 @@ dependencies {
|
|||
implementation project(':core:ns-sdk')
|
||||
implementation project(':core:utils')
|
||||
implementation project(':core:ui')
|
||||
implementation project(':core:validators')
|
||||
implementation project(':ui')
|
||||
implementation project(':plugins:aps')
|
||||
implementation project(':plugins:automation')
|
||||
|
|
|
@ -20,7 +20,6 @@ import info.nightscout.androidaps.R
|
|||
import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin
|
||||
import info.nightscout.androidaps.danaRv2.DanaRv2Plugin
|
||||
import info.nightscout.androidaps.danar.DanaRPlugin
|
||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
|
||||
import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploaderPlugin
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
||||
|
@ -88,7 +87,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
|||
@Inject lateinit var danaRPlugin: DanaRPlugin
|
||||
@Inject lateinit var danaRKoreanPlugin: DanaRKoreanPlugin
|
||||
@Inject lateinit var danaRv2Plugin: DanaRv2Plugin
|
||||
@Inject lateinit var danaRSPlugin: DanaRSPlugin
|
||||
@Inject lateinit var danaRSPlugin: info.nightscout.pump.danars.DanaRSPlugin
|
||||
@Inject lateinit var comboPlugin: ComboPlugin
|
||||
@Inject lateinit var combov2Plugin: ComboV2Plugin
|
||||
@Inject lateinit var insulinOrefFreePeakPlugin: InsulinOrefFreePeakPlugin
|
||||
|
|
|
@ -6,7 +6,6 @@ import dagger.android.AndroidInjectionModule
|
|||
import dagger.android.AndroidInjector
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.danar.di.DanaRModule
|
||||
import info.nightscout.androidaps.danars.di.DanaRSModule
|
||||
import info.nightscout.androidaps.diaconn.di.DiaconnG8Module
|
||||
import info.nightscout.androidaps.insight.di.InsightDatabaseModule
|
||||
import info.nightscout.androidaps.insight.di.InsightModule
|
||||
|
@ -19,6 +18,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.di.OmnipodErosModule
|
|||
import info.nightscout.automation.di.AutomationModule
|
||||
import info.nightscout.configuration.di.ConfigurationModule
|
||||
import info.nightscout.core.di.CoreModule
|
||||
import info.nightscout.core.validators.di.ValidatorsModule
|
||||
import info.nightscout.database.impl.DatabaseModule
|
||||
import info.nightscout.implementation.di.ImplementationModule
|
||||
import info.nightscout.plugins.aps.di.ApsModule
|
||||
|
@ -28,6 +28,7 @@ import info.nightscout.pump.combov2.di.ComboV2Module
|
|||
import info.nightscout.pump.common.di.PumpCommonModule
|
||||
import info.nightscout.pump.dana.di.DanaHistoryModule
|
||||
import info.nightscout.pump.dana.di.DanaModule
|
||||
import info.nightscout.pump.danars.di.DanaRSModule
|
||||
import info.nightscout.rx.di.RxModule
|
||||
import info.nightscout.shared.di.SharedModule
|
||||
import info.nightscout.shared.impl.di.SharedImplModule
|
||||
|
@ -62,6 +63,7 @@ import javax.inject.Singleton
|
|||
SharedModule::class,
|
||||
SharedImplModule::class,
|
||||
UiModule::class,
|
||||
ValidatorsModule::class,
|
||||
|
||||
// pumps
|
||||
ComboModule::class,
|
||||
|
|
|
@ -7,7 +7,6 @@ import dagger.multibindings.IntoMap
|
|||
import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin
|
||||
import info.nightscout.androidaps.danaRv2.DanaRv2Plugin
|
||||
import info.nightscout.androidaps.danar.DanaRPlugin
|
||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.diaconn.DiaconnG8Plugin
|
||||
import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploaderPlugin
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||
|
@ -160,7 +159,7 @@ abstract class PluginsListModule {
|
|||
@PumpDriver
|
||||
@IntoMap
|
||||
@IntKey(120)
|
||||
abstract fun bindDanaRSPlugin(plugin: DanaRSPlugin): PluginBase
|
||||
abstract fun bindDanaRSPlugin(plugin: info.nightscout.pump.danars.DanaRSPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@PumpDriver
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:key="@string/key_enable_missed_bg_readings_alert"
|
||||
android:title="@string/enable_missed_bg_readings_alert" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="30"
|
||||
android:dependency="@string/key_enable_missed_bg_readings_alert"
|
||||
android:inputType="number"
|
||||
|
@ -28,7 +28,7 @@
|
|||
android:key="@string/key_enable_pump_unreachable_alert"
|
||||
android:title="@string/enable_pump_unreachable_alert" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="30"
|
||||
android:dependency="@string/key_enable_pump_unreachable_alert"
|
||||
android:inputType="number"
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
android:key="@string/key_bolus_pin"
|
||||
android:title="@string/bolus_pin" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/maintenance_settings"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="logs@aaps.app"
|
||||
android:dialogMessage="@string/maintenance_email"
|
||||
android:inputType="textEmailAddress"
|
||||
|
@ -17,7 +17,7 @@
|
|||
android:title="@string/maintenance_email"
|
||||
validate:testType="email"/>
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="2"
|
||||
android:inputType="number"
|
||||
android:key="@string/key_maintenance_logs_amount"
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
android:key="@string/key_show_insulin_button"
|
||||
android:title="@string/configbuilder_insulin" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0.5"
|
||||
android:dependency="@string/key_show_insulin_button"
|
||||
android:dialogMessage="@string/insulin_increment_button_message"
|
||||
|
@ -47,7 +47,7 @@
|
|||
validate:floatminNumber="-5.0"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1.0"
|
||||
android:dependency="@string/key_show_insulin_button"
|
||||
android:dialogMessage="@string/insulin_increment_button_message"
|
||||
|
@ -61,7 +61,7 @@
|
|||
validate:floatminNumber="-5.0"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="2.0"
|
||||
android:dependency="@string/key_show_insulin_button"
|
||||
android:dialogMessage="@string/insulin_increment_button_message"
|
||||
|
@ -80,7 +80,7 @@
|
|||
android:key="@string/key_show_carbs_button"
|
||||
android:title="@string/carbs" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="5"
|
||||
android:dependency="@string/key_show_carbs_button"
|
||||
android:dialogMessage="@string/carb_increment_button_message"
|
||||
|
@ -94,7 +94,7 @@
|
|||
validate:minNumber="-50"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="10"
|
||||
android:dependency="@string/key_show_carbs_button"
|
||||
android:dialogMessage="@string/carb_increment_button_message"
|
||||
|
@ -108,7 +108,7 @@
|
|||
validate:minNumber="-50"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="20"
|
||||
android:dependency="@string/key_show_carbs_button"
|
||||
android:dialogMessage="@string/carb_increment_button_message"
|
||||
|
@ -146,7 +146,7 @@
|
|||
android:key="@string/default_temptargets"
|
||||
android:title="@string/default_temptargets">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="number"
|
||||
android:key="@string/key_eatingsoon_duration"
|
||||
|
@ -155,7 +155,7 @@
|
|||
validate:minNumber="15"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="@string/key_eatingsoon_target"
|
||||
|
@ -164,7 +164,7 @@
|
|||
validate:floatminNumber="4.0"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="number"
|
||||
android:key="@string/key_activity_duration"
|
||||
|
@ -173,7 +173,7 @@
|
|||
validate:minNumber="15"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="@string/key_activity_target"
|
||||
|
@ -182,7 +182,7 @@
|
|||
validate:floatminNumber="6.0"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="number"
|
||||
android:key="@string/key_hypo_duration"
|
||||
|
@ -191,7 +191,7 @@
|
|||
validate:minNumber="15"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="@string/key_hypo_target"
|
||||
|
@ -206,7 +206,7 @@
|
|||
android:key="@string/fill_bolus_title"
|
||||
android:title="@string/fill_bolus_title">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0.3"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="fill_button1"
|
||||
|
@ -215,7 +215,7 @@
|
|||
validate:floatminNumber="0.05"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="fill_button2"
|
||||
|
@ -224,7 +224,7 @@
|
|||
validate:floatminNumber="0.05"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="fill_button3"
|
||||
|
@ -240,7 +240,7 @@
|
|||
android:summary="@string/prefs_range_summary"
|
||||
android:title="@string/prefs_range_title">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="@string/key_low_mark"
|
||||
|
@ -249,7 +249,7 @@
|
|||
validate:floatminNumber="3"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="@string/key_high_mark"
|
||||
|
@ -279,7 +279,7 @@
|
|||
android:key="@string/key_show_statuslights"
|
||||
android:title="@string/show_statuslights" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="48"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -292,7 +292,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="72"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -305,7 +305,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="72"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -318,7 +318,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="144"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -331,7 +331,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="216"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -344,7 +344,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="240"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -357,7 +357,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="25"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -370,7 +370,7 @@
|
|||
validate:minNumber="0"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="5"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -383,7 +383,7 @@
|
|||
validate:minNumber="0"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="216"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -396,7 +396,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="240"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -409,7 +409,7 @@
|
|||
validate:minNumber="24"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="80"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -422,7 +422,7 @@
|
|||
validate:minNumber="0"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="10"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -435,7 +435,7 @@
|
|||
validate:minNumber="0"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="25"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -448,7 +448,7 @@
|
|||
validate:minNumber="0"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="5"
|
||||
android:dependency="@string/key_show_statuslights"
|
||||
android:inputType="numberSigned"
|
||||
|
@ -473,7 +473,7 @@
|
|||
android:key="overview_advanced"
|
||||
android:title="@string/advancedsettings_title">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="100"
|
||||
android:dialogMessage="@string/deliverpartofboluswizard"
|
||||
android:inputType="number"
|
||||
|
|
|
@ -6,7 +6,6 @@ import info.nightscout.androidaps.HardLimitsMock
|
|||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
import info.nightscout.androidaps.danar.DanaRPlugin
|
||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.implementations.ConfigImpl
|
||||
import info.nightscout.androidaps.insight.database.InsightDatabaseDao
|
||||
import info.nightscout.androidaps.insight.database.InsightDbHelper
|
||||
|
@ -78,7 +77,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
private lateinit var objectivesPlugin: ObjectivesPlugin
|
||||
private lateinit var comboPlugin: ComboPlugin
|
||||
private lateinit var danaRPlugin: DanaRPlugin
|
||||
private lateinit var danaRSPlugin: DanaRSPlugin
|
||||
private lateinit var danaRSPlugin: info.nightscout.pump.danars.DanaRSPlugin
|
||||
private lateinit var insightPlugin: LocalInsightPlugin
|
||||
private lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin
|
||||
private lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin
|
||||
|
@ -142,7 +141,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
comboPlugin = ComboPlugin(injector, aapsLogger, rxBus, rh, profileFunction, sp, commandQueue, pumpSync, dateUtil, ruffyScripter, activityNames)
|
||||
danaRPlugin = DanaRPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, rh, constraintChecker, activePlugin, sp, commandQueue, danaPump, dateUtil, fabricPrivacy, pumpSync, activityNames)
|
||||
danaRSPlugin =
|
||||
DanaRSPlugin(
|
||||
info.nightscout.pump.danars.DanaRSPlugin(
|
||||
injector,
|
||||
aapsLogger,
|
||||
aapsSchedulers,
|
||||
|
@ -158,11 +157,12 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
detailedBolusInfoStorage,
|
||||
temporaryBasalStorage,
|
||||
fabricPrivacy,
|
||||
dateUtil
|
||||
dateUtil,
|
||||
activityNames
|
||||
)
|
||||
insightPlugin = LocalInsightPlugin(injector, aapsLogger, rxBus, rh, sp, commandQueue, profileFunction, context, config, dateUtil, insightDbHelper, pumpSync)
|
||||
openAPSSMBPlugin =
|
||||
info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin(
|
||||
OpenAPSSMBPlugin(
|
||||
injector,
|
||||
aapsLogger,
|
||||
rxBus,
|
||||
|
@ -180,7 +180,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
glucoseStatusProvider
|
||||
)
|
||||
openAPSSMBDynamicISFPlugin =
|
||||
info.nightscout.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin(
|
||||
OpenAPSSMBDynamicISFPlugin(
|
||||
injector,
|
||||
aapsLogger,
|
||||
rxBus,
|
||||
|
@ -199,7 +199,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
config
|
||||
)
|
||||
openAPSAMAPlugin =
|
||||
info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin(
|
||||
OpenAPSAMAPlugin(
|
||||
injector,
|
||||
aapsLogger,
|
||||
rxBus,
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
|
||||
class AlphaNumericValidator(message: String?) : RegexpValidator(message, "[a-zA-Z0-9\u00C0-\u00FF \\./-\\?]*")
|
|
@ -11,7 +11,6 @@ import dagger.Provides
|
|||
CoreReceiversModule::class,
|
||||
CoreFragmentsModule::class,
|
||||
CoreDataClassesModule::class,
|
||||
ValidatorsModule::class,
|
||||
PreferencesModule::class
|
||||
]
|
||||
)
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
<string name="pin_not_set">PIN not set</string>
|
||||
<string name="password_not_changed">Password not changed</string>
|
||||
<string name="pin_not_changed">PIN not changed</string>
|
||||
<string name="password_cleared">Password cleared!</string>
|
||||
<string name="pin_cleared">PIN cleared!</string>
|
||||
<string name="password_hint">Enter password here</string>
|
||||
<string name="pin_hint">Enter PIN here</string>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<resources>
|
||||
<!-- General-->
|
||||
<string name="save">Save</string>
|
||||
<string name="not_set_short">Not set</string>
|
||||
<string name="goingtodeliver">Going to deliver %1$.2f U</string>
|
||||
<string name="waitingforpump">Waiting for pump</string>
|
||||
<string name="androidaps_start">AAPS started</string>
|
||||
|
@ -10,8 +9,6 @@
|
|||
<string name="format_carbs">%1$d g</string>
|
||||
<string name="format_hours">%1$.2f h</string>
|
||||
<string name="format_mins">%1$d mins</string>
|
||||
<string name="pumpbusy">Pump is busy</string>
|
||||
<string name="connectionerror">Pump connection error</string>
|
||||
<string name="objectives">Objectives</string>
|
||||
<string name="please_wait">Please wait…</string>
|
||||
<string name="mute">Mute</string>
|
||||
|
@ -39,7 +36,6 @@
|
|||
<string name="bluetooth">Bluetooth</string>
|
||||
<string name="btwatchdog_title">BT Watchdog</string>
|
||||
<string name="btwatchdog_summary">Switches off the phone\'s bluetooth for one second if no connection to the pump is possible. This may help on some phones where the bluetooth stack freezes.</string>
|
||||
<string name="pairing">Pairing</string>
|
||||
<string name="virtualpump_resultok">OK</string>
|
||||
<string name="extended_bolus">Extended bolus</string>
|
||||
<string name="pump_time_updated">Pump time updated</string>
|
||||
|
@ -127,13 +123,6 @@
|
|||
<string name="ic_short">IC</string>
|
||||
<string name="isf_short">ISF</string>
|
||||
|
||||
<!-- BlePreCheck-->
|
||||
<string name="ble_not_supported">Bluetooth Low Energy not supported.</string>
|
||||
<string name="ble_not_supported_or_not_paired">Bluetooth Low Energy not supported or device not paired.</string>
|
||||
<string name="ble_not_enabled">Bluetooth not enabled.</string>
|
||||
<string name="location_not_found_title">Location Is Not Enabled</string>
|
||||
<string name="location_not_found_message">For Bluetooth discovery to work on newer devices, location must be enabled. AAPS does not track your location and it can be disabled after pairing is successful.</string>
|
||||
|
||||
<!-- Protection-->
|
||||
<string name="wrongpassword">Wrong password</string>
|
||||
<string name="wrongpin">Wrong PIN</string>
|
||||
|
@ -211,7 +200,6 @@
|
|||
<string name="loop">Loop</string>
|
||||
<string name="ns">NS</string>
|
||||
<string name="record">Record</string>
|
||||
<string name="reading_pump_history">Reading pump history</string>
|
||||
|
||||
<!-- Command-->
|
||||
<string name="connectiontimedout">Connection timed out</string>
|
||||
|
|
|
@ -45,6 +45,12 @@
|
|||
<string name="device_changed" comment="26 characters max for translation">Device changed</string>
|
||||
<string name="bolus_ok" comment="26 characters max for translation">Bolus OK</string>
|
||||
<string name="temp_basal_delivery_error">Tempbasal delivery error</string>
|
||||
<string name="not_set_short">Not set</string>
|
||||
<string name="pump_busy">Pump is busy</string>
|
||||
<string name="connection_error">Pump connection error</string>
|
||||
<string name="reading_pump_history">Reading pump history</string>
|
||||
<string name="password_cleared">Password cleared!</string>
|
||||
<string name="pairing">Pairing</string>
|
||||
|
||||
<!-- Constraints-->
|
||||
<string name="limitingbasalratio">Limiting max basal rate to %1$.2f U/h because of %2$s</string>
|
||||
|
@ -85,4 +91,11 @@
|
|||
<string name="user_request" comment="26 characters max for translation">User request</string>
|
||||
<string name="pump_paired" comment="26 characters max for translation">Pump paired</string>
|
||||
|
||||
<!-- BlePreCheck-->
|
||||
<string name="ble_not_supported">Bluetooth Low Energy not supported.</string>
|
||||
<string name="ble_not_supported_or_not_paired">Bluetooth Low Energy not supported or device not paired.</string>
|
||||
<string name="ble_not_enabled">Bluetooth not enabled.</string>
|
||||
<string name="location_not_found_title">Location Is Not Enabled</string>
|
||||
<string name="location_not_found_message">For Bluetooth discovery to work on newer devices, location must be enabled. AAPS does not track your location and it can be disabled after pairing is successful.</string>
|
||||
|
||||
</resources>
|
1
core/validators/.gitignore
vendored
Normal file
1
core/validators/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/build
|
24
core/validators/build.gradle
Normal file
24
core/validators/build.gradle
Normal file
|
@ -0,0 +1,24 @@
|
|||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-allopen'
|
||||
id 'com.hiya.jacoco-android'
|
||||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
||||
android {
|
||||
namespace 'info.nightscout.core.validators'
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation project(':app-wear-shared:shared')
|
||||
implementation project(':core:interfaces')
|
||||
implementation project(':core:ui')
|
||||
api "com.google.android.material:material:$material_version"
|
||||
}
|
0
core/validators/consumer-rules.pro
Normal file
0
core/validators/consumer-rules.pro
Normal file
21
core/validators/proguard-rules.pro
vendored
Normal file
21
core/validators/proguard-rules.pro
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
|
@ -0,0 +1,23 @@
|
|||
package info.nightscout.core.validators
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("info.nightscout.core.validators.test", appContext.packageName)
|
||||
}
|
||||
}
|
4
core/validators/src/main/AndroidManifest.xml
Normal file
4
core/validators/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest>
|
||||
|
||||
</manifest>
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator
|
||||
package info.nightscout.core.validators
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
|
@ -7,34 +7,33 @@ import android.text.TextWatcher
|
|||
import android.widget.EditText
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.AlphaNumericValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.AlphaValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.AndValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.BgRangeValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.CreditCardValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.DateValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.DomainValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.DummyValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.EmailValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.EmptyValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.FloatNumericRangeValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.HttpsUrlValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.IpAddressValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.MinDigitLengthValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.MultiPhoneValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.MultiValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.NotValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.NumericRangeValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.NumericValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.OrValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.PersonFullNameValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.PersonNameValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.PhoneValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.PinStrengthValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.RegexpValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.Validator
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.WebUrlValidator
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.core.validators.validators.AlphaNumericValidator
|
||||
import info.nightscout.core.validators.validators.AlphaValidator
|
||||
import info.nightscout.core.validators.validators.AndValidator
|
||||
import info.nightscout.core.validators.validators.BgRangeValidator
|
||||
import info.nightscout.core.validators.validators.CreditCardValidator
|
||||
import info.nightscout.core.validators.validators.DateValidator
|
||||
import info.nightscout.core.validators.validators.DomainValidator
|
||||
import info.nightscout.core.validators.validators.DummyValidator
|
||||
import info.nightscout.core.validators.validators.EmailValidator
|
||||
import info.nightscout.core.validators.validators.EmptyValidator
|
||||
import info.nightscout.core.validators.validators.FloatNumericRangeValidator
|
||||
import info.nightscout.core.validators.validators.HttpsUrlValidator
|
||||
import info.nightscout.core.validators.validators.IpAddressValidator
|
||||
import info.nightscout.core.validators.validators.MinDigitLengthValidator
|
||||
import info.nightscout.core.validators.validators.MultiPhoneValidator
|
||||
import info.nightscout.core.validators.validators.MultiValidator
|
||||
import info.nightscout.core.validators.validators.NotValidator
|
||||
import info.nightscout.core.validators.validators.NumericRangeValidator
|
||||
import info.nightscout.core.validators.validators.NumericValidator
|
||||
import info.nightscout.core.validators.validators.OrValidator
|
||||
import info.nightscout.core.validators.validators.PersonFullNameValidator
|
||||
import info.nightscout.core.validators.validators.PersonNameValidator
|
||||
import info.nightscout.core.validators.validators.PhoneValidator
|
||||
import info.nightscout.core.validators.validators.PinStrengthValidator
|
||||
import info.nightscout.core.validators.validators.RegexpValidator
|
||||
import info.nightscout.core.validators.validators.Validator
|
||||
import info.nightscout.core.validators.validators.WebUrlValidator
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import javax.inject.Inject
|
||||
|
@ -158,7 +157,7 @@ class DefaultEditTextValidator : EditTextValidator {
|
|||
EditTextValidator.TEST_PERSONFULLNAME -> PersonFullNameValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_notvalid_personfullname) else testErrorString)
|
||||
EditTextValidator.TEST_MIN_LENGTH -> MinDigitLengthValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_not_a_minimum_length) else testErrorString, minLength)
|
||||
EditTextValidator.TEST_BG_RANGE -> BgRangeValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_numeric_digits_range_allowed,
|
||||
Profile.fromMgdlToUnits(minMgdl.toDouble(), profileFunction
|
||||
Profile.fromMgdlToUnits(minMgdl.toDouble(), profileFunction
|
||||
.getUnits()).toString(), Profile.fromMgdlToUnits(maxMgdl.toDouble(), profileFunction.getUnits()).toString()) else
|
||||
testErrorString, minMgdl, maxMgdl, profileFunction)
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package info.nightscout.androidaps.utils.textValidator
|
||||
package info.nightscout.core.validators
|
||||
|
||||
import android.content.Context
|
||||
import kotlin.Throws
|
||||
import android.text.TextWatcher
|
||||
import info.nightscout.androidaps.utils.textValidator.validators.Validator
|
||||
import java.lang.IllegalArgumentException
|
||||
import info.nightscout.core.validators.validators.Validator
|
||||
|
||||
/**
|
||||
* Interface for encapsulating validation of an EditText control
|
|
@ -1,11 +1,10 @@
|
|||
package info.nightscout.androidaps.utils.textValidator
|
||||
package info.nightscout.core.validators
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.preference.EditTextPreference
|
||||
import androidx.preference.PreferenceViewHolder
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
import info.nightscout.interfaces.profile.ProfileFunction
|
||||
import info.nightscout.shared.SafeParse
|
|
@ -1,10 +1,10 @@
|
|||
package info.nightscout.core.di
|
||||
package info.nightscout.core.validators.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.utils.textValidator.DefaultEditTextValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.EditTextValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
import info.nightscout.core.validators.DefaultEditTextValidator
|
||||
import info.nightscout.core.validators.EditTextValidator
|
||||
import info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
|
@ -0,0 +1,3 @@
|
|||
package info.nightscout.core.validators.validators
|
||||
|
||||
class AlphaNumericValidator(message: String?) : RegexpValidator(message, "[a-zA-Z0-9\u00C0-\u00FF \\./-\\?]*")
|
|
@ -1,3 +1,3 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
class AlphaValidator(message: String?) : RegexpValidator(message, "[A-z\u00C0-\u00ff \\./-\\?]*")
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
import info.nightscout.interfaces.profile.Profile
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.text.TextUtils
|
||||
|
@ -6,7 +6,7 @@ import android.widget.EditText
|
|||
import java.text.DateFormat
|
||||
import java.text.ParseException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.Date
|
||||
|
||||
class DateValidator(_customErrorMessage: String?, _format: String?) : Validator(_customErrorMessage) {
|
||||
private val formats: Array<String> = if (_format == null || TextUtils.isEmpty(_format))
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.util.Patterns
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.util.Patterns
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.text.TextUtils
|
||||
import android.widget.EditText
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
import info.nightscout.shared.SafeParse
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.util.Patterns
|
||||
|
||||
|
@ -8,4 +8,4 @@ import android.util.Patterns
|
|||
* @author Andrea Baccega <me></me>@andreabaccega.com>
|
||||
*/
|
||||
@Suppress("deprecation")
|
||||
class IpAddressValidator(_customErrorMessage: String?) : PatternValidator(_customErrorMessage, Patterns.IP_ADDRESS)
|
||||
class IpAddressValidator(_customErrorMessage: String?) : PatternValidator(_customErrorMessage, Patterns.IP_ADDRESS)
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.util.Patterns
|
||||
import android.widget.EditText
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import java.util.*
|
||||
import java.util.Arrays
|
||||
|
||||
/**
|
||||
* Abstract class for a multivalidator.
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.text.TextUtils
|
||||
import android.widget.EditText
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
import java.util.regex.Pattern
|
|
@ -1,3 +1,3 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
class PersonFullNameValidator(message: String?) : RegexpValidator(message, "[\\p{L}- ]+")
|
|
@ -1,3 +1,3 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
class PersonNameValidator(message: String?) : RegexpValidator(message, "[\\p{L}-]+")
|
|
@ -1,8 +1,6 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.os.Build
|
||||
import android.util.Patterns
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
* It validates phone numbers.
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import java.util.regex.Pattern
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.text.TextUtils
|
||||
import android.widget.EditText
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.widget.EditText
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.utils.textValidator.validators
|
||||
package info.nightscout.core.validators.validators
|
||||
|
||||
import android.util.Patterns
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package info.nightscout.core.validators
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
|
@ -23,6 +23,7 @@ dependencies {
|
|||
implementation project(':core:interfaces')
|
||||
implementation project(':core:utils')
|
||||
implementation project(':core:ui')
|
||||
implementation project(':core:validators')
|
||||
|
||||
api "androidx.appcompat:appcompat:$appcompat_version"
|
||||
api "androidx.swiperefreshlayout:swiperefreshlayout:$swipe_version"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
android:title="@string/autotune_tune_insulin_curve_title" />
|
||||
-->
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="5"
|
||||
android:key="@string/key_autotune_default_tune_days"
|
||||
android:title="@string/autotune_default_tune_days_title"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/openapsama"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1"
|
||||
android:dialogMessage="@string/openapsma_max_basal_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -18,7 +18,7 @@
|
|||
validate:floatminNumber="0.1"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1.5"
|
||||
android:dialogMessage="@string/openapsma_max_iob_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -39,7 +39,7 @@
|
|||
android:summary="@string/openapsama_autosens_adjust_targets_summary"
|
||||
android:title="@string/openapsama_autosens_adjust_targets" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3.0"
|
||||
android:dialogMessage="@string/openapsama_min_5m_carb_impact_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -66,7 +66,7 @@
|
|||
android:summary="@string/always_use_short_avg_summary"
|
||||
android:title="@string/always_use_short_avg" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:dialogMessage="@string/openapsama_max_daily_safety_multiplier_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -79,7 +79,7 @@
|
|||
validate:minNumber="1"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="4"
|
||||
android:dialogMessage="@string/openapsama_current_basal_safety_multiplier_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -93,7 +93,7 @@
|
|||
validate:floatminNumber="1"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="2"
|
||||
android:dialogMessage="@string/openapsama_bolus_snooze_dia_divisor_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/openapssmb"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1"
|
||||
android:dialogMessage="@string/openapsma_max_basal_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -18,7 +18,7 @@
|
|||
validate:floatminNumber="0.1"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:dialogMessage="@string/openapssmb_max_iob_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -74,7 +74,7 @@
|
|||
android:summary="@string/enable_smb_after_carbs_summary"
|
||||
android:title="@string/enable_smb_after_carbs" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
|
@ -87,7 +87,7 @@
|
|||
validate:minNumber="1"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="30"
|
||||
android:digits="0123456789"
|
||||
android:entries="@array/smbMaxMinutes"
|
||||
|
@ -99,7 +99,7 @@
|
|||
validate:minNumber="15"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="30"
|
||||
android:dialogMessage="@string/uam_smb_max_minutes"
|
||||
android:digits="0123456789"
|
||||
|
@ -145,7 +145,7 @@
|
|||
android:summary="@string/low_temptarget_lowers_sensitivity_summary"
|
||||
android:title="@string/low_temptarget_lowers_sensitivity_title" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1"
|
||||
android:dialogMessage="@string/carbs_req_threshold_summary"
|
||||
android:digits="0123456789"
|
||||
|
@ -176,7 +176,7 @@
|
|||
android:summary="@string/always_use_short_avg_summary"
|
||||
android:title="@string/always_use_short_avg" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:dialogMessage="@string/openapsama_max_daily_safety_multiplier_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -189,7 +189,7 @@
|
|||
validate:minNumber="1"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="4"
|
||||
android:dialogMessage="@string/openapsama_current_basal_safety_multiplier_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/openapssmb"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1"
|
||||
android:dialogMessage="@string/openapsma_max_basal_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -18,7 +18,7 @@
|
|||
validate:floatminNumber="0.1"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:dialogMessage="@string/openapssmb_max_iob_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -28,7 +28,7 @@
|
|||
validate:floatminNumber="0"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="100"
|
||||
android:enabled="true"
|
||||
android:dialogMessage="@string/DynISFAdjust_summary"
|
||||
|
@ -39,7 +39,7 @@
|
|||
validate:floatminNumber="1"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="65"
|
||||
android:inputType="numberDecimal"
|
||||
android:dialogMessage="@string/lgs_threshold_summary"
|
||||
|
@ -95,7 +95,7 @@
|
|||
android:summary="@string/enable_smb_after_carbs_summary"
|
||||
android:title="@string/enable_smb_after_carbs" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
|
@ -108,7 +108,7 @@
|
|||
validate:minNumber="1"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="30"
|
||||
android:digits="0123456789"
|
||||
android:entries="@array/smbMaxMinutes"
|
||||
|
@ -120,7 +120,7 @@
|
|||
validate:minNumber="15"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="30"
|
||||
android:dialogMessage="@string/uam_smb_max_minutes"
|
||||
android:digits="0123456789"
|
||||
|
@ -166,7 +166,7 @@
|
|||
android:summary="@string/low_temptarget_lowers_sensitivity_summary"
|
||||
android:title="@string/low_temptarget_lowers_sensitivity_title" />-->
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1"
|
||||
android:dialogMessage="@string/carbs_req_threshold_summary"
|
||||
android:digits="0123456789"
|
||||
|
@ -197,7 +197,7 @@
|
|||
android:summary="@string/always_use_short_avg_summary"
|
||||
android:title="@string/always_use_short_avg" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:dialogMessage="@string/openapsama_max_daily_safety_multiplier_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -210,7 +210,7 @@
|
|||
validate:minNumber="1"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="4"
|
||||
android:dialogMessage="@string/openapsama_current_basal_safety_multiplier_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:summary="@string/allow_automated_crash_reporting"
|
||||
android:title="@string/fabric_upload" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:dialogMessage="@string/summary_email_for_crash_report"
|
||||
android:inputType="text"
|
||||
android:key="@string/key_email_for_crash_report"
|
||||
|
|
|
@ -26,6 +26,7 @@ dependencies {
|
|||
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"
|
||||
|
|
|
@ -256,8 +256,8 @@ class LoopPlugin @Inject constructor(
|
|||
}
|
||||
|
||||
if (!isEmptyQueue()) {
|
||||
aapsLogger.debug(LTag.APS, rh.gs(R.string.pumpbusy))
|
||||
rxBus.send(EventLoopSetLastRunGui(rh.gs(R.string.pumpbusy)))
|
||||
aapsLogger.debug(LTag.APS, rh.gs(R.string.pump_busy))
|
||||
rxBus.send(EventLoopSetLastRunGui(rh.gs(R.string.pump_busy)))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -13,14 +13,13 @@ import androidx.work.workDataOf
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import info.nightscout.androidaps.extensions.valueToUnitsString
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.iob.generateCOBString
|
||||
import info.nightscout.core.iob.round
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.utils.receivers.DataWorkerStorage
|
||||
import info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
import info.nightscout.database.entities.OfflineEvent
|
||||
import info.nightscout.database.entities.TemporaryTarget
|
||||
import info.nightscout.database.entities.UserEntry.Action
|
||||
|
@ -39,6 +38,7 @@ import info.nightscout.interfaces.aps.Loop
|
|||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.constraints.Constraints
|
||||
import info.nightscout.interfaces.iob.IobCobCalculator
|
||||
import info.nightscout.interfaces.logging.UserEntryLogger
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.interfaces.plugin.ActivePlugin
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
|
|
|
@ -314,7 +314,7 @@ class DataHandlerMobile @Inject constructor(
|
|||
message = "OLD DATA - "
|
||||
//if pump is not busy: try to fetch data
|
||||
if (activePump.isBusy()) {
|
||||
message += rh.gs(R.string.pumpbusy)
|
||||
message += rh.gs(R.string.pump_busy)
|
||||
} else {
|
||||
message += "trying to fetch data from pump."
|
||||
commandQueue.loadTDDs(object : Callback() {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/insulin_oref_peak"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="75"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
android:key="@string/key_aps_mode"
|
||||
android:title="@string/apsmode_title" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="20"
|
||||
android:dialogMessage="@string/loop_open_mode_min_change_summary"
|
||||
android:digits="0123456789"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/ns_client_internal_title"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="https://{YOUR-SITE}.azurewebsites.net/"
|
||||
android:dialogMessage="@string/ns_client_url_dialog_message"
|
||||
android:inputType="textUri"
|
||||
|
@ -17,7 +17,7 @@
|
|||
android:title="@string/ns_client_url_title"
|
||||
validate:testType="httpsUrl" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:dialogMessage="@string/ns_client_secret_dialog_message"
|
||||
android:dialogTitle="@string/ns_client_secret_dialog_title"
|
||||
android:inputType="textPassword"
|
||||
|
@ -26,7 +26,7 @@
|
|||
validate:minLength="12"
|
||||
validate:testType="minLength"/>
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:dialogMessage="@string/nsclient_token_dialog_message"
|
||||
android:dialogTitle="@string/nsclient_token_dialog_title"
|
||||
android:inputType="textPassword"
|
||||
|
@ -118,7 +118,7 @@
|
|||
android:key="@string/key_ns_announcements"
|
||||
android:title="@string/ns_announcements" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="16"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
|
@ -131,7 +131,7 @@
|
|||
validate:minNumber="15"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="31"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
android:summary="@string/patient_age_summary"
|
||||
android:title="@string/patient_type" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="3"
|
||||
android:inputType="numberDecimal"
|
||||
android:key="@string/key_treatmentssafety_maxbolus"
|
||||
|
@ -25,7 +25,7 @@
|
|||
validate:floatminNumber="0.1"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="48"
|
||||
android:inputType="number"
|
||||
android:key="@string/key_treatmentssafety_maxcarbs"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/smscommunicator"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:key="@string/key_smscommunicator_allowednumbers"
|
||||
android:summary="@string/smscommunicator_allowednumbers_summary"
|
||||
android:title="@string/smscommunicator_allowednumbers"
|
||||
|
@ -19,7 +19,7 @@
|
|||
android:key="@string/key_smscommunicator_remote_commands_allowed"
|
||||
android:title="@string/smscommunicator_remote_commands_allowed" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="15"
|
||||
android:key="@string/key_smscommunicator_remote_bolus_min_distance"
|
||||
android:summary="@string/smscommunicator_remote_bolus_min_distance_summary"
|
||||
|
@ -28,7 +28,7 @@
|
|||
validate:minNumber="3"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:dependency="@string/key_smscommunicator_remote_commands_allowed"
|
||||
android:key="@string/key_smscommunicator_otp_password"
|
||||
android:summary="@string/smscommunicator_otp_pin_summary"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:title="@string/tidepool"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:key="@string/key_tidepool_username"
|
||||
android:summary="@string/summary_tidepool_username"
|
||||
android:title="@string/title_tidepool_username"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:title="@string/absorption_settings_title"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="6"
|
||||
android:dialogMessage="@string/absorption_max_time_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -22,7 +22,7 @@
|
|||
validate:minNumber="4"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="24"
|
||||
android:dialogMessage="@string/openapsama_autosens_period_summary"
|
||||
android:digits="0123456789"
|
||||
|
@ -40,7 +40,7 @@
|
|||
android:key="absorption_aaps_advanced"
|
||||
android:title="@string/advancedsettings_title">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1.2"
|
||||
android:dialogMessage="@string/openapsama_autosens_max_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -54,7 +54,7 @@
|
|||
validate:floatminNumber="0.5"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0.7"
|
||||
android:dialogMessage="@string/openapsama_autosens_min_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:title="@string/absorption_settings_title"
|
||||
app:initialExpandedChildrenCount="0">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="8.0"
|
||||
android:dialogMessage="@string/openapsama_min_5m_carb_impact_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
@ -22,7 +22,7 @@
|
|||
validate:floatminNumber="0.1"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="6"
|
||||
android:dialogMessage="@string/absorption_cutoff_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -39,7 +39,7 @@
|
|||
android:key="absorption_oref1_advanced"
|
||||
android:title="@string/advancedsettings_title">
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="1.2"
|
||||
android:dialogMessage="@string/openapsama_autosens_max_summary"
|
||||
android:digits="0123456789.,"
|
||||
|
@ -53,7 +53,7 @@
|
|||
validate:floatminNumber="0.5"
|
||||
validate:testType="floatNumericRange" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:defaultValue="0.7"
|
||||
android:dialogMessage="@string/openapsama_autosens_min_summary"
|
||||
android:inputType="numberDecimal"
|
||||
|
|
|
@ -1140,7 +1140,7 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints {
|
|||
* Reads the pump's history and updates the DB accordingly.
|
||||
*/
|
||||
private boolean readHistory(@Nullable PumpHistoryRequest request) {
|
||||
CommandResult historyResult = runCommand(getRh().gs(R.string.combo_activity_reading_pump_history), 3, () -> ruffyScripter.readHistory(request));
|
||||
CommandResult historyResult = runCommand(getRh().gs(R.string.reading_pump_history), 3, () -> ruffyScripter.readHistory(request));
|
||||
PumpHistory history = historyResult.history;
|
||||
if (!historyResult.success || history == null) {
|
||||
return false;
|
||||
|
@ -1226,7 +1226,7 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints {
|
|||
|
||||
// fetch new records
|
||||
long lastKnownPumpRecordTimestamp = recentBoluses.isEmpty() ? 0 : recentBoluses.get(0).timestamp;
|
||||
CommandResult historyResult = runCommand(getRh().gs(R.string.combo_activity_reading_pump_history), 3, () ->
|
||||
CommandResult historyResult = runCommand(getRh().gs(R.string.reading_pump_history), 3, () ->
|
||||
ruffyScripter.readHistory(new PumpHistoryRequest().bolusHistory(lastKnownPumpRecordTimestamp)));
|
||||
if (!historyResult.success) {
|
||||
pumpHistoryChanged = true;
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
<string name="combo_force_disabled_notification">Unsafe usage: the pump uses a different basal rate profile than the first. The loop has been disabled. Select the first profile on the pump and refresh.</string>
|
||||
<string name="bolus_frequency_exceeded">A bolus with the same amount was requested within the last two minutes. To prevent accidental double boluses and to guard against bugs this is disallowed.</string>
|
||||
<string name="combo_pump_connected_now">Now</string>
|
||||
<string name="combo_activity_reading_pump_history">Reading pump history</string>
|
||||
<string name="combo_activity_setting_basal_profile">Setting basal profile</string>
|
||||
<string name="combo_pump_cartridge_low_warrning">Pump cartridge level is low</string>
|
||||
<string name="combo_pump_battery_low_warrning">Pump battery is low</string>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<string name="key_danar_bt_name" translatable="false">danar_bt_name</string>
|
||||
|
||||
<string name="danars_pairing">Pairing</string>
|
||||
<string name="danars_nodeviceavailable">No device found so far</string>
|
||||
<string name="danars_no_device_available">No device found so far</string>
|
||||
<string name="danars_pairingok">Pairing OK</string>
|
||||
<string name="danars_pairingtimedout">Pairing timed out</string>
|
||||
<string name="danars_waitingforpairing">Waiting for pairing on pump</string>
|
||||
|
|
|
@ -17,7 +17,6 @@ android {
|
|||
|
||||
dependencies {
|
||||
implementation project(':app-wear-shared:shared')
|
||||
//implementation project(':core:core-main')
|
||||
implementation project(':core:interfaces')
|
||||
implementation project(':core:utils')
|
||||
implementation project(':core:ui')
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:key="@string/key_danar_bt_name"
|
||||
android:title="@string/danar_bt_name_title" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:inputType="numberPassword"
|
||||
android:key="@string/key_danar_password"
|
||||
android:title="@string/danar_password_title"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:key="@string/key_danar_bt_name"
|
||||
android:title="@string/danar_bt_name_title" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:inputType="numberPassword"
|
||||
android:key="@string/key_danar_password"
|
||||
android:title="@string/danar_password_title"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:key="@string/key_danar_bt_name"
|
||||
android:title="@string/danar_bt_name_title" />
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
<info.nightscout.core.validators.ValidatingEditTextPreference
|
||||
android:inputType="numberPassword"
|
||||
android:key="@string/key_danar_password"
|
||||
android:title="@string/danar_password_title"
|
||||
|
|
|
@ -14,7 +14,7 @@ apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle"
|
|||
|
||||
android {
|
||||
ndkVersion "21.1.6352462"
|
||||
namespace 'info.nightscout.androidaps.danars'
|
||||
namespace 'info.nightscout.pump.danars'
|
||||
|
||||
defaultConfig {
|
||||
|
||||
|
@ -31,10 +31,12 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':core:core-main')
|
||||
implementation project(':core:interfaces')
|
||||
implementation project(':core:utils')
|
||||
implementation project(':core:ui')
|
||||
implementation project(':core:validators')
|
||||
implementation project(':pump:dana')
|
||||
implementation project(':app-wear-shared:shared')
|
||||
|
||||
testImplementation project(':core:core-main')
|
||||
}
|
|
@ -2,31 +2,32 @@
|
|||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name="info.nightscout.androidaps.danars.activities.BLEScanActivity"
|
||||
android:exported="false">
|
||||
android:name=".activities.BLEScanActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="info.nightscout.androidaps.plugins.PumpDanaRS.activities.BLEScanActivity" />
|
||||
<action android:name="info.nightscout.pump.danars.activities.BLEScanActivity" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="info.nightscout.androidaps.danars.activities.PairingHelperActivity"
|
||||
android:name=".activities.PairingHelperActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name="info.nightscout.androidaps.danars.activities.EnterPinActivity"
|
||||
android:name=".activities.EnterPinActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:launchMode="singleTask" />
|
||||
|
||||
<service
|
||||
android:name="info.nightscout.androidaps.danars.services.DanaRSService"
|
||||
android:name=".services.DanaRSService"
|
||||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
|
|
@ -1,165 +0,0 @@
|
|||
package info.nightscout.androidaps.danars.dialogs;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.android.support.DaggerDialogFragment;
|
||||
import info.nightscout.androidaps.danars.R;
|
||||
import info.nightscout.androidaps.danars.activities.PairingHelperActivity;
|
||||
import info.nightscout.androidaps.danars.databinding.DanarsPairingProgressDialogBinding;
|
||||
import info.nightscout.androidaps.danars.events.EventDanaRSPairingSuccess;
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy;
|
||||
import info.nightscout.rx.AapsSchedulers;
|
||||
import info.nightscout.rx.bus.RxBus;
|
||||
import info.nightscout.shared.interfaces.ResourceHelper;
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable;
|
||||
|
||||
|
||||
public class PairingProgressDialog extends DaggerDialogFragment {
|
||||
|
||||
@Inject AapsSchedulers aapsSchedulers;
|
||||
@Inject ResourceHelper rh;
|
||||
@Inject RxBus rxBus;
|
||||
@Inject FabricPrivacy fabricPrivacy;
|
||||
|
||||
private final CompositeDisposable disposable = new CompositeDisposable();
|
||||
|
||||
private PairingHelperActivity helperActivity;
|
||||
|
||||
private static boolean pairingEnded = false;
|
||||
|
||||
private static Handler handler;
|
||||
private static HandlerThread handlerThread;
|
||||
|
||||
private static Runnable runnable;
|
||||
|
||||
private DanarsPairingProgressDialogBinding binding;
|
||||
|
||||
public PairingProgressDialog() {
|
||||
super();
|
||||
// Required empty public constructor
|
||||
if (handlerThread == null) {
|
||||
handlerThread = new HandlerThread(PairingProgressDialog.class.getSimpleName());
|
||||
handlerThread.start();
|
||||
handler = new Handler(handlerThread.getLooper());
|
||||
}
|
||||
|
||||
runnable = () -> {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (pairingEnded) {
|
||||
FragmentActivity activity = getActivity();
|
||||
if (activity != null) {
|
||||
activity.runOnUiThread(() -> {
|
||||
if (binding != null) {
|
||||
binding.danarsPairingprogressProgressbar.setProgress(100);
|
||||
binding.danarsPairingprogressStatus.setText(R.string.danars_pairingok);
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
} else
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
if (binding != null) binding.danarsPairingprogressProgressbar.setProgress(i * 5);
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
FragmentActivity activity = getActivity();
|
||||
if (activity != null) {
|
||||
activity.runOnUiThread(() -> {
|
||||
if (binding != null) {
|
||||
binding.danarsPairingprogressProgressbar.setProgress(100);
|
||||
binding.danarsPairingprogressStatus.setText(R.string.danars_pairingtimedout);
|
||||
binding.ok.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
binding = DanarsPairingProgressDialogBinding.inflate(inflater, container, false);
|
||||
|
||||
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
||||
setCancelable(false);
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
|
||||
setViews();
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventDanaRSPairingSuccess.class)
|
||||
.observeOn(aapsSchedulers.getIo())
|
||||
.subscribe(event -> pairingEnded = true, fabricPrivacy::logException)
|
||||
);
|
||||
if (pairingEnded) dismiss();
|
||||
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismissAllowingStateLoss();
|
||||
if (helperActivity != null) {
|
||||
helperActivity.finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
disposable.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
|
||||
private void setViews() {
|
||||
if (binding != null) {
|
||||
binding.danarsPairingprogressProgressbar.setMax(100);
|
||||
binding.danarsPairingprogressProgressbar.setProgress(0);
|
||||
binding.danarsPairingprogressStatus.setText(rh.gs(R.string.danars_waitingforpairing));
|
||||
binding.ok.setVisibility(View.GONE);
|
||||
binding.ok.setOnClickListener(v -> dismiss());
|
||||
}
|
||||
handler.post(runnable);
|
||||
}
|
||||
|
||||
public void resetToNewPairing() {
|
||||
handler.removeCallbacks(runnable);
|
||||
setViews();
|
||||
}
|
||||
|
||||
public PairingProgressDialog setHelperActivity(PairingHelperActivity activity) {
|
||||
this.helperActivity = activity;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -5,6 +5,8 @@ import android.content.Context;
|
|||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import info.nightscout.pump.danars.encryption.EncryptionType;
|
||||
|
||||
@Singleton
|
||||
public class BleEncryption {
|
||||
private final Context context;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.danars
|
||||
package info.nightscout.pump.danars
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
|
@ -8,9 +8,6 @@ import android.os.IBinder
|
|||
import android.text.format.DateFormat
|
||||
import androidx.preference.Preference
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange
|
||||
import info.nightscout.androidaps.danars.services.DanaRSService
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.core.ui.toast.ToastUtils
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
|
@ -32,11 +29,14 @@ import info.nightscout.interfaces.pump.defs.ManufacturerType
|
|||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||
import info.nightscout.interfaces.pump.defs.PumpType
|
||||
import info.nightscout.interfaces.queue.CommandQueue
|
||||
import info.nightscout.interfaces.ui.ActivityNames
|
||||
import info.nightscout.interfaces.utils.DecimalFormatter
|
||||
import info.nightscout.interfaces.utils.Round
|
||||
import info.nightscout.pump.dana.DanaFragment
|
||||
import info.nightscout.pump.dana.DanaPump
|
||||
import info.nightscout.pump.dana.comm.RecordTypes
|
||||
import info.nightscout.pump.danars.events.EventDanaRSDeviceChange
|
||||
import info.nightscout.pump.danars.services.DanaRSService
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventAppExit
|
||||
|
@ -75,7 +75,8 @@ class DanaRSPlugin @Inject constructor(
|
|||
private val detailedBolusInfoStorage: DetailedBolusInfoStorage,
|
||||
private val temporaryBasalStorage: TemporaryBasalStorage,
|
||||
private val fabricPrivacy: FabricPrivacy,
|
||||
private val dateUtil: DateUtil
|
||||
private val dateUtil: DateUtil,
|
||||
private val activityNames: ActivityNames
|
||||
) : PumpPluginBase(
|
||||
PluginDescription()
|
||||
.mainType(PluginType.PUMP)
|
||||
|
@ -229,23 +230,20 @@ class DanaRSPlugin @Inject constructor(
|
|||
val result = PumpEnactResult(injector)
|
||||
if (!isInitialized()) {
|
||||
aapsLogger.error("setNewBasalProfile not initialized")
|
||||
val notification = Notification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED, rh.gs(R.string.pump_not_initialized_profile_not_set), Notification.URGENT)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
activityNames.addNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED, rh.gs(R.string.pump_not_initialized_profile_not_set), Notification.URGENT)
|
||||
result.comment = rh.gs(R.string.pump_not_initialized_profile_not_set)
|
||||
return result
|
||||
} else {
|
||||
rxBus.send(EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED))
|
||||
}
|
||||
return if (danaRSService?.updateBasalsInPump(profile) != true) {
|
||||
val notification = Notification(Notification.FAILED_UPDATE_PROFILE, rh.gs(R.string.failed_update_basal_profile), Notification.URGENT)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
activityNames.addNotification(Notification.FAILED_UPDATE_PROFILE, rh.gs(R.string.failed_update_basal_profile), Notification.URGENT)
|
||||
result.comment = rh.gs(R.string.failed_update_basal_profile)
|
||||
result
|
||||
} else {
|
||||
rxBus.send(EventDismissNotification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED))
|
||||
rxBus.send(EventDismissNotification(Notification.FAILED_UPDATE_PROFILE))
|
||||
val notification = Notification(Notification.PROFILE_SET_OK, rh.gs(R.string.profile_set_ok), Notification.INFO, 60)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
activityNames.addNotificationValidFor(Notification.PROFILE_SET_OK, rh.gs(R.string.profile_set_ok), Notification.INFO, 60)
|
||||
result.success = true
|
||||
result.enacted = true
|
||||
result.comment = "OK"
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.danars.activities
|
||||
package info.nightscout.pump.danars.activities
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
|
@ -20,22 +20,24 @@ import android.view.ViewGroup
|
|||
import android.widget.BaseAdapter
|
||||
import android.widget.TextView
|
||||
import androidx.core.app.ActivityCompat
|
||||
import info.nightscout.androidaps.danars.R
|
||||
import info.nightscout.androidaps.danars.databinding.DanarsBlescannerActivityBinding
|
||||
import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange
|
||||
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
||||
import dagger.android.support.DaggerAppCompatActivity
|
||||
import info.nightscout.core.ui.toast.ToastUtils
|
||||
import info.nightscout.core.utils.extensions.safeEnable
|
||||
import info.nightscout.interfaces.pump.BlePreCheck
|
||||
import info.nightscout.pump.danars.R
|
||||
import info.nightscout.pump.danars.databinding.DanarsBlescannerActivityBinding
|
||||
import info.nightscout.pump.danars.events.EventDanaRSDeviceChange
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import java.util.regex.Pattern
|
||||
import javax.inject.Inject
|
||||
|
||||
class BLEScanActivity : NoSplashAppCompatActivity() {
|
||||
class BLEScanActivity : DaggerAppCompatActivity() {
|
||||
|
||||
@Inject lateinit var sp: SP
|
||||
@Inject lateinit var blePreCheck: BlePreCheck
|
||||
@Inject lateinit var context: Context
|
||||
@Inject lateinit var rxBus: RxBus
|
||||
|
||||
private var listAdapter: ListAdapter? = null
|
||||
private val devices = ArrayList<BluetoothDeviceItem>()
|
||||
|
@ -54,8 +56,8 @@ class BLEScanActivity : NoSplashAppCompatActivity() {
|
|||
blePreCheck.prerequisitesCheck(this)
|
||||
|
||||
listAdapter = ListAdapter()
|
||||
binding.blescannerListview.emptyView = binding.blescannerNodevice
|
||||
binding.blescannerListview.adapter = listAdapter
|
||||
binding.bleScannerListview.emptyView = binding.bleScannerNoDevice
|
||||
binding.bleScannerListview.adapter = listAdapter
|
||||
listAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
@ -66,7 +68,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() {
|
|||
bluetoothAdapter?.safeEnable()
|
||||
startScan()
|
||||
} else {
|
||||
ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.need_connect_permission))
|
||||
ToastUtils.errorToast(context, context.getString(R.string.need_connect_permission))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +84,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() {
|
|||
} catch (ignore: IllegalStateException) {
|
||||
} // ignore BT not on
|
||||
} else {
|
||||
ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.need_connect_permission))
|
||||
ToastUtils.errorToast(context, context.getString(R.string.need_connect_permission))
|
||||
}
|
||||
|
||||
private fun stopScan() =
|
||||
|
@ -92,7 +94,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() {
|
|||
} catch (ignore: IllegalStateException) {
|
||||
} // ignore BT not on
|
||||
} else {
|
||||
ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.need_connect_permission))
|
||||
ToastUtils.errorToast(context, context.getString(R.string.need_connect_permission))
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
|
@ -153,7 +155,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() {
|
|||
item.device.createBond()
|
||||
rxBus.send(EventDanaRSDeviceChange())
|
||||
} else {
|
||||
ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.need_connect_permission))
|
||||
ToastUtils.errorToast(context, context.getString(R.string.need_connect_permission))
|
||||
}
|
||||
finish()
|
||||
}
|
|
@ -1,31 +1,36 @@
|
|||
package info.nightscout.androidaps.danars.activities
|
||||
package info.nightscout.pump.danars.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Base64
|
||||
import info.nightscout.androidaps.danars.DanaRSPlugin
|
||||
import info.nightscout.androidaps.danars.R
|
||||
import info.nightscout.androidaps.danars.databinding.DanarsEnterPinActivityBinding
|
||||
import info.nightscout.androidaps.danars.services.BLEComm
|
||||
import info.nightscout.androidaps.utils.textValidator.DefaultEditTextValidator
|
||||
import info.nightscout.androidaps.utils.textValidator.EditTextValidator
|
||||
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
||||
import dagger.android.support.DaggerAppCompatActivity
|
||||
import info.nightscout.core.ui.dialogs.OKDialog
|
||||
import info.nightscout.core.utils.fabric.FabricPrivacy
|
||||
import info.nightscout.core.utils.hexStringToByteArray
|
||||
import info.nightscout.core.validators.DefaultEditTextValidator
|
||||
import info.nightscout.core.validators.EditTextValidator
|
||||
import info.nightscout.pump.danars.DanaRSPlugin
|
||||
import info.nightscout.pump.danars.R
|
||||
import info.nightscout.pump.danars.databinding.DanarsEnterPinActivityBinding
|
||||
import info.nightscout.pump.danars.services.BLEComm
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventPumpStatusChanged
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
import kotlin.experimental.xor
|
||||
|
||||
class EnterPinActivity : NoSplashAppCompatActivity() {
|
||||
class EnterPinActivity : DaggerAppCompatActivity() {
|
||||
|
||||
@Inject lateinit var fabricPrivacy: FabricPrivacy
|
||||
@Inject lateinit var danaRSPlugin: DanaRSPlugin
|
||||
@Inject lateinit var sp: SP
|
||||
@Inject lateinit var bleComm: BLEComm
|
||||
@Inject lateinit var aapsSchedulers: AapsSchedulers
|
||||
@Inject lateinit var rh: ResourceHelper
|
||||
@Inject lateinit var rxBus: RxBus
|
||||
|
||||
private val disposable = CompositeDisposable()
|
||||
|
||||
|
@ -62,11 +67,10 @@ class EnterPinActivity : NoSplashAppCompatActivity() {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
disposable.add(rxBus
|
||||
disposable += rxBus
|
||||
.toObservable(EventPumpStatusChanged::class.java)
|
||||
.observeOn(aapsSchedulers.main)
|
||||
.subscribe({ if (it.status == EventPumpStatusChanged.Status.DISCONNECTED) finish() }, fabricPrivacy::logException)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
|
@ -1,20 +1,20 @@
|
|||
package info.nightscout.androidaps.danars.activities
|
||||
package info.nightscout.pump.danars.activities
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.os.Bundle
|
||||
import info.nightscout.androidaps.danars.dialogs.PairingProgressDialog
|
||||
import info.nightscout.core.activities.NoSplashAppCompatActivity
|
||||
import dagger.android.support.DaggerAppCompatActivity
|
||||
import info.nightscout.pump.danars.dialogs.PairingProgressDialog
|
||||
|
||||
class PairingHelperActivity : DaggerAppCompatActivity() {
|
||||
|
||||
class PairingHelperActivity : NoSplashAppCompatActivity() {
|
||||
var dialog: PairingProgressDialog? = null
|
||||
|
||||
@SuppressLint("SourceLockedOrientationActivity")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
dialog = PairingProgressDialog()
|
||||
.setHelperActivity(this)
|
||||
dialog = PairingProgressDialog().setHelperActivity(this)
|
||||
dialog?.show(supportFragmentManager, "PairingProgress")
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.interfaces.ui.ActivityNames
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import org.joda.time.DateTime
|
||||
import org.joda.time.IllegalInstantException
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
@ -13,6 +14,7 @@ open class DanaRSPacket(protected var injector: HasAndroidInjector) {
|
|||
|
||||
@Inject lateinit var aapsLogger: AAPSLogger
|
||||
@Inject lateinit var dateUtil: DateUtil
|
||||
@Inject lateinit var activityNames: ActivityNames
|
||||
|
||||
var isReceived = false
|
||||
private set
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
|
@ -1,13 +1,13 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.R
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||
import info.nightscout.interfaces.pump.DetailedBolusInfo
|
||||
import info.nightscout.interfaces.pump.DetailedBolusInfoStorage
|
||||
import info.nightscout.interfaces.pump.PumpSync
|
||||
import info.nightscout.interfaces.pump.TemporaryBasalStorage
|
||||
import info.nightscout.pump.dana.DanaPump
|
||||
import info.nightscout.pump.danars.R
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventPumpStatusChanged
|
||||
import info.nightscout.rx.logging.LTag
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
|
@ -1,11 +1,10 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.R
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||
import info.nightscout.core.events.EventNewNotification
|
||||
import info.nightscout.interfaces.notifications.Notification
|
||||
import info.nightscout.pump.dana.DanaPump
|
||||
import info.nightscout.pump.danars.R
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventDismissNotification
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
@ -48,8 +47,7 @@ class DanaRSPacketBasalGetBasalRate(
|
|||
aapsLogger.debug(LTag.PUMPCOMM, "Basal " + String.format(Locale.ENGLISH, "%02d", index) + "h: " + danaPump.pumpProfiles!![danaPump.activeProfile][index])
|
||||
if (danaPump.basalStep != 0.01) {
|
||||
failed = true
|
||||
val notification = Notification(Notification.WRONG_BASAL_STEP, rh.gs(R.string.danar_setbasalstep001), Notification.URGENT)
|
||||
rxBus.send(EventNewNotification(notification))
|
||||
activityNames.addNotification(Notification.WRONG_BASAL_STEP, rh.gs(R.string.danar_setbasalstep001), Notification.URGENT)
|
||||
} else {
|
||||
rxBus.send(EventDismissNotification(Notification.WRONG_BASAL_STEP))
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
|
@ -1,10 +1,9 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
||||
|
||||
class DanaRSPacketBasalSetCancelTemporaryBasal(
|
||||
injector: HasAndroidInjector
|
||||
) : DanaRSPacket(injector) {
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
|
@ -1,10 +1,9 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||
import info.nightscout.rx.logging.LTag
|
||||
|
||||
|
||||
class DanaRSPacketBasalSetProfileNumber(
|
||||
injector: HasAndroidInjector,
|
||||
private var profileNumber: Int = 0
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.danars.comm
|
||||
package info.nightscout.pump.danars.comm
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue