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:
parent
5e5887a378
commit
e6138d7683
|
@ -36,8 +36,9 @@ open class FloatSliderSetting : SliderSetting {
|
||||||
min: Float,
|
min: Float,
|
||||||
max: Float,
|
max: Float,
|
||||||
units: String?,
|
units: String?,
|
||||||
|
stepSize: Float,
|
||||||
showDecimal: Boolean
|
showDecimal: Boolean
|
||||||
) : super(name, description, min, max, units, showDecimal) {
|
) : super(name, description, min, max, units, stepSize, showDecimal) {
|
||||||
floatSetting = setting
|
floatSetting = setting
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,11 +41,13 @@ sealed class SliderSetting : SettingsItem {
|
||||||
min: Any,
|
min: Any,
|
||||||
max: Any,
|
max: Any,
|
||||||
units: String?,
|
units: String?,
|
||||||
|
stepSize: Any,
|
||||||
showDecimal: Boolean
|
showDecimal: Boolean
|
||||||
) : super(name, description) {
|
) : super(name, description) {
|
||||||
this.min = min
|
this.min = min
|
||||||
this.max = max
|
this.max = max
|
||||||
this.units = units
|
this.units = units
|
||||||
|
this.stepSize = stepSize
|
||||||
this.showDecimal = showDecimal
|
this.showDecimal = showDecimal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2356,6 +2356,7 @@ class SettingsFragmentPresenter(
|
||||||
ceil(setting.getDoubleMin()).toFloat(),
|
ceil(setting.getDoubleMin()).toFloat(),
|
||||||
floor(setting.getDoubleMax()).toFloat(),
|
floor(setting.getDoubleMax()).toFloat(),
|
||||||
setting.getUiSuffix(),
|
setting.getUiSuffix(),
|
||||||
|
1.0f,
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue