You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a non-linear data to be selected upon like, 1hours,1 day, 1week, 2 weeks,1 month, 6 months, 1 year, 2 year.
So this library comes as a healthy rescue. I have hit upon a problem which I am not sure is the problem with the library or it is with my code. I have tried quite a few things before thinking to write to you.
By default I set the selection for 1 week (i.e. position = 2). This works, and the circle thumb appears at the correct position. This is more like initializing the position of the slider when it is shown to the user. There after the user slides and sets the position. And we capture the user's selection in
setOnDiscreteSliderChangeListener
We get the position as argument and we perform slider.setPosition(position). This also works.
This time we have defined a red area (starts from 1 month to 2 year selection). If the user slides to any of the values in red area, we want to prompt the user that he is not allowed to select these values as he is not a premium user. I am able to read the position value from the changeListener and bring up the pop-up to the user. However sliding the thumb back to its original or for that matter even hardcoded position of 0 does not work for me (visually). the thumb does not slide back, however the position value of the slider is programatically set.
At one end when we initialize the slider, i do see that setPosition works (but this happens on main UI thread). When I try to set a position in the setOnDiscreteSliderChangeListener , i dont see the thumb moving, but the variable value of position gets set. Not sure how do I address this.
The text was updated successfully, but these errors were encountered:
Just in case you want to visually understand my problem...
When the thumb is moved to the beeds that are positioned with red, and we want that the thumb should slide back to the original position. I know the original position from slider.getPosition() when the setOnDiscreteSliderChangeListener, i check the threshold position and try to set the known position. This does not work. Let me additionally tell you that I am making this all work through an adapter, the slider component is drawn in the recyclerview via an adapter. I am clear that there is no issue with the overall 'position of the item in the adapter.
We have a non-linear data to be selected upon like, 1hours,1 day, 1week, 2 weeks,1 month, 6 months, 1 year, 2 year.
So this library comes as a healthy rescue. I have hit upon a problem which I am not sure is the problem with the library or it is with my code. I have tried quite a few things before thinking to write to you.
By default I set the selection for 1 week (i.e. position = 2). This works, and the circle thumb appears at the correct position. This is more like initializing the position of the slider when it is shown to the user. There after the user slides and sets the position. And we capture the user's selection in
setOnDiscreteSliderChangeListener
We get the position as argument and we perform slider.setPosition(position). This also works.
This time we have defined a red area (starts from 1 month to 2 year selection). If the user slides to any of the values in red area, we want to prompt the user that he is not allowed to select these values as he is not a premium user. I am able to read the position value from the changeListener and bring up the pop-up to the user. However sliding the thumb back to its original or for that matter even hardcoded position of 0 does not work for me (visually). the thumb does not slide back, however the position value of the slider is programatically set.
At one end when we initialize the slider, i do see that setPosition works (but this happens on main UI thread). When I try to set a position in the setOnDiscreteSliderChangeListener , i dont see the thumb moving, but the variable value of position gets set. Not sure how do I address this.
The text was updated successfully, but these errors were encountered: