I have the following RangeSlider and I am using DataBinding to provide the minimum / maximum value of the slider, as it may change while the user is on the screen.
layout.xml
<layout ...>
<data>
<variable
name="item"
type="MyDataItem" />
</data>
...
<com.google.android.material.slider.RangeSlider
android:id="@+id/my_slider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stepSize="1"
android:valueFrom="@{item.minimum}"
android:valueTo="@{item.maximum}"
... />
</layout>
MyDataItem
:
data class MyDataItem() {
val minimum = MutableLiveData(Int.MIN_VALUE)
val maximum = MutableLiveData(Int.MAX_VALUE)
}
However, whenever the app tries to inflate the view I get java.lang.IllegalStateException: valueFrom(0.0) must be smaller than valueTo(0.0)