Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

making the slider continuous. #20

Open
Shreyaskc opened this issue May 8, 2019 · 7 comments
Open

making the slider continuous. #20

Shreyaskc opened this issue May 8, 2019 · 7 comments
Labels

Comments

@Shreyaskc
Copy link

The slider does not seem to have the capability of being a slider which keeps adding value or keeps removing the value. can someone help me with that?

@milosmns
Copy link
Owner

milosmns commented May 8, 2019

Out of the box - no. You have to do it yourself. I can offer you some help though.

--

What you can do is track previous positions to know whether you've moved the full circle.
To get positions in the range of 0..1, you can refer to this: #9 (comment)

So for example, if you track one previous listener position... and let's say you get 0.999, but the next one you get is 0.111, without any other values in-between them... it means that user either looped the circle, or made an incredible jump that would be more than 0.9 long. At this point you can assume that they looped, and increase your counter.

You can also do this with radians but it's a bit more complex.

@deviran01
Copy link

Hi When setting new position value, UI dose not update, I run on runOnUiThread

@milosmns
Copy link
Owner

milosmns commented Jan 16, 2020 via email

@hdwipa
Copy link

hdwipa commented Mar 18, 2020

Dear Milos, thank you for helping my project by this slider. But now i want to ask, how to invoke setPosition ?, i call it from button clickListener event, but nothing change on UI until i touch the slider.. is there any other ways to invoke / reanimate the slider position ?
Thank you -

@milosmns
Copy link
Owner

Try calling View's invalidate function on it (after setting)? Also pasting some code might help in debugging

@hdwipa
Copy link

hdwipa commented Mar 19, 2020

Try calling View's invalidate function on it (after setting)? Also pasting some code might help in debugging

it works !.. there is should be invalidate(); after set the thumb position in order to invoke the changes on UI.
Thanks !

@milosmns
Copy link
Owner

milosmns commented Mar 19, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants