fix pref parsing
This commit is contained in:
parent
bc217438e9
commit
a241a23c99
1 changed files with 3 additions and 5 deletions
|
@ -238,11 +238,9 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
||||||
resourceHelper.gs(R.string.key_high_mark),
|
resourceHelper.gs(R.string.key_high_mark),
|
||||||
resourceHelper.gs(R.string.key_low_mark)
|
resourceHelper.gs(R.string.key_low_mark)
|
||||||
)
|
)
|
||||||
if (listOf(*unitDependent).contains(pref.key)) {
|
if (unitDependent.toList().contains(pref.key) && pref is EditTextPreference) {
|
||||||
val editTextPref = pref as EditTextPreference
|
val converted = Profile.toCurrentUnits(profileFunction, SafeParse.stringToDouble(pref.text))
|
||||||
val converted = Profile.toCurrentUnitsString(profileFunction, SafeParse.stringToDouble(editTextPref.text))
|
pref.summary = converted.toString()
|
||||||
editTextPref.summary = converted
|
|
||||||
editTextPref.text = converted
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue