Merge pull request #2275 from jotomo/pref-smb-minutes-validation

OpenAPS SMB: max SMB minutes: restrict to valid inputs.
This commit is contained in:
Milos Kozak 2019-12-13 02:21:52 +01:00 committed by GitHub
commit d306d85398
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 11 deletions

View file

@ -200,6 +200,16 @@
<item>@string/key_medtronic_pump_battery_nizn</item>
</string-array>
<string-array name="smbMaxMinutes">
<item>15</item>
<item>30</item>
<item>45</item>
<item>60</item>
<item>75</item>
<item>90</item>
<item>105</item>
<item>120</item>
</string-array>
key_medtronic_bolus_debug

View file

@ -65,19 +65,12 @@
android:summary="@string/enablesmbaftercarbs_summary"
android:title="@string/enablesmbaftercarbs" />
<com.andreabaccega.widget.ValidatingEditTextPreference
<ListPreference
android:defaultValue="30"
android:dialogMessage="@string/smbmaxminutes"
android:digits="0123456789"
android:inputType="number"
android:entries="@array/smbMaxMinutes"
android:entryValues="@array/smbMaxMinutes"
android:key="@string/key_smbmaxminutes"
android:maxLines="20"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/smbmaxminutes_summary"
validate:maxNumber="120"
validate:minNumber="15"
validate:testType="numericRange" />
android:title="@string/smbmaxminutes_summary" />
<SwitchPreference
android:defaultValue="false"