Merge pull request #1254 from erobinson/add-percentage-increase-increment-preference

Wizard Dialog -> default percentage increment is 5% rather than 1%
This commit is contained in:
Milos Kozak 2022-02-24 15:35:10 +01:00 committed by GitHub
commit 692c05b5ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,7 @@ class WizardDialog : DaggerDialogFragment() {
if (correctionPercent) { if (correctionPercent) {
calculatedPercentage = sp.getInt(R.string.key_boluswizard_percentage, 100).toDouble() calculatedPercentage = sp.getInt(R.string.key_boluswizard_percentage, 100).toDouble()
binding.correctionInput.setParams(calculatedPercentage, 10.0, 200.0, 1.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher) binding.correctionInput.setParams(calculatedPercentage, 10.0, 200.0, 5.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher)
binding.correctionInput.value = calculatedPercentage binding.correctionInput.value = calculatedPercentage
binding.correctionUnit.text = "%" binding.correctionUnit.text = "%"
} else { } else {
@ -215,7 +215,7 @@ class WizardDialog : DaggerDialogFragment() {
binding.correctionUnit.text = if (isChecked) "%" else rh.gs(R.string.insulin_unit_shortname) binding.correctionUnit.text = if (isChecked) "%" else rh.gs(R.string.insulin_unit_shortname)
correctionPercent = binding.correctionPercent.isChecked correctionPercent = binding.correctionPercent.isChecked
if (correctionPercent) { if (correctionPercent) {
binding.correctionInput.setParams(calculatedPercentage, 10.0, 200.0, 1.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher) binding.correctionInput.setParams(calculatedPercentage, 10.0, 200.0, 5.0, DecimalFormat("0"), false, binding.okcancel.ok, textWatcher)
binding.correctionInput.customContentDescription = rh.gs(R.string.a11_correction_percentage) binding.correctionInput.customContentDescription = rh.gs(R.string.a11_correction_percentage)
} else { } else {
binding.correctionInput.setParams( binding.correctionInput.setParams(