Merge pull request #1969 from Philoul/Fix/AutotuneKeyboad
Autotune Fix Keyboard input for TuneDays
This commit is contained in:
commit
e635978c1a
|
@ -115,6 +115,7 @@ class AutotuneFragment : DaggerFragment() {
|
|||
}
|
||||
autotunePlugin.selectedProfile = profileName
|
||||
resetParam()
|
||||
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
|
||||
}
|
||||
updateGui()
|
||||
}
|
||||
|
@ -275,6 +276,7 @@ class AutotuneFragment : DaggerFragment() {
|
|||
.observeOn(aapsSchedulers.main)
|
||||
.subscribe({ updateGui() }, fabricPrivacy::logException)
|
||||
checkNewDay()
|
||||
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
|
||||
updateGui()
|
||||
}
|
||||
|
||||
|
@ -287,7 +289,6 @@ class AutotuneFragment : DaggerFragment() {
|
|||
@Synchronized
|
||||
private fun updateGui() {
|
||||
_binding ?: return
|
||||
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
|
||||
profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil)
|
||||
profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString()
|
||||
profileFunction.getProfile()?.let { currentProfile ->
|
||||
|
@ -387,7 +388,7 @@ class AutotuneFragment : DaggerFragment() {
|
|||
try {
|
||||
if (autotunePlugin.calculationRunning)
|
||||
binding.tuneDays.value = autotunePlugin.lastNbDays.toDouble()
|
||||
if (binding.tuneDays.value != autotunePlugin.lastNbDays.toDouble()) {
|
||||
if (binding.tuneDays.text != autotunePlugin.lastNbDays) {
|
||||
autotunePlugin.lastNbDays = binding.tuneDays.text
|
||||
resetParam(false)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:validate="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="@string/key_autotune_plugin"
|
||||
android:title="@string/autotune_settings"
|
||||
|
@ -24,12 +26,19 @@
|
|||
android:summary="@string/autotune_tune_insulin_curve_summary"
|
||||
android:title="@string/autotune_tune_insulin_curve_title" />
|
||||
-->
|
||||
<EditTextPreference
|
||||
|
||||
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
|
||||
android:defaultValue="5"
|
||||
android:inputType="number"
|
||||
android:key="@string/key_autotune_default_tune_days"
|
||||
android:summary="@string/autotune_default_tune_days_summary"
|
||||
android:title="@string/autotune_default_tune_days_title" />
|
||||
android:title="@string/autotune_default_tune_days_title"
|
||||
android:dialogMessage="@string/autotune_default_tune_days_summary"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
validate:maxNumber="30"
|
||||
validate:minNumber="1"
|
||||
validate:testType="numericRange" />
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
|
|
Loading…
Reference in a new issue