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,
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -2356,6 +2356,7 @@ class SettingsFragmentPresenter(
|
|||
ceil(setting.getDoubleMin()).toFloat(),
|
||||
floor(setting.getDoubleMax()).toFloat(),
|
||||
setting.getUiSuffix(),
|
||||
1.0f,
|
||||
false
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue