Android: Fix controller float sliders crashing

By not setting a stepSize, stepSize was getting set to the default
value of 0, which is an Int. This later caused a crash when trying to
cast it to Float.
This commit is contained in:
JosJuice 2023-09-02 09:12:42 +02:00
parent 5e5887a378
commit e6138d7683
3 changed files with 5 additions and 1 deletions

View File

@ -36,8 +36,9 @@ open class FloatSliderSetting : SliderSetting {
min: Float,
max: Float,
units: String?,
stepSize: Float,
showDecimal: Boolean
) : super(name, description, min, max, units, showDecimal) {
) : super(name, description, min, max, units, stepSize, showDecimal) {
floatSetting = setting
}

View File

@ -41,11 +41,13 @@ sealed class SliderSetting : SettingsItem {
min: Any,
max: Any,
units: String?,
stepSize: Any,
showDecimal: Boolean
) : super(name, description) {
this.min = min
this.max = max
this.units = units
this.stepSize = stepSize
this.showDecimal = showDecimal
}

View File

@ -2356,6 +2356,7 @@ class SettingsFragmentPresenter(
ceil(setting.getDoubleMin()).toFloat(),
floor(setting.getDoubleMax()).toFloat(),
setting.getUiSuffix(),
1.0f,
false
)
)