VideoRangeSlider
VideoRangeSlider copied to clipboard
.setRangeIndex( s, e); not updating UI
Hi,
I am trying to set programmatically the position of start and end index. Calling this method seems to set the values internal but the UI is not updated as the state remains the same. I use the view in XML.
Thanks in advance,
Alex
You need to import VideoRangeSlider as module. And then modify setRangeIndex function like below
public void setRangeIndex(long leftIndex, long rightIndex) {
if (indexOutOfRange(leftIndex, rightIndex)) {
throw new IllegalArgumentException(
"Thumb index left " + leftIndex + ", or right " + rightIndex
+ " is out of bounds. Check that it is greater than the minimum ("
+ mTickStart + ") and less than the maximum value ("
+ mTickEnd + ")");
} else {
if(mLeftThumb.getRangeIndex() != leftIndex) {
mLeftThumb.setTickIndex(leftIndex);
moveThumbByIndex(mLeftThumb, leftIndex);
}
if(mRightThumb.getRangeIndex() != rightIndex) {
mRightThumb.setTickIndex(rightIndex);
moveThumbByIndex(mRightThumb, rightIndex);
}
// invalidate();
}
}