circular-slider-android icon indicating copy to clipboard operation
circular-slider-android copied to clipboard

making the slider continuous.

Open Shreyaskc opened this issue 5 years ago • 7 comments

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?

Shreyaskc avatar May 08 '19 15:05 Shreyaskc

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: https://github.com/milosmns/circular-slider-android/issues/9#issuecomment-261930607

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.

milosmns avatar May 08 '19 16:05 milosmns

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

deviran01 avatar Jan 16 '20 21:01 deviran01

Off the top of my head, I think nobody complained about this before, so I think you might be doing something wrong with that call on your side. Perhaps try not to call it on UI thread? Just to test. Or the UI thread is busy and is not able to process your call?

Or.. include the slider in a sample project where you have no other business logic, and test again.

Or.. your position value is simply the same as the one you had? Value format is in Pi/radians, you can check out other closed tickets and the readme on how to convert from radians to degrees.

Or.. you can debug on your own by opening the slider class (it's just one small class without proguard applied).

Either way I'd need more code to be able to guess what's wrong.

On Thu, Jan 16, 2020, 22:04 Ali Sarkhosh [email protected] wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/milosmns/circular-slider-android/issues/20?email_source=notifications&email_token=AANQTCTAFZXZUMQKHN2IIM3Q6DDWZA5CNFSM4HLTBIKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJFRKWY#issuecomment-575346011, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANQTCTIA7YP25Y2T4EHTITQ6DDWZANCNFSM4HLTBIKA .

milosmns avatar Jan 16 '20 21:01 milosmns

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 -

hdwipa avatar Mar 18 '20 19:03 hdwipa

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

milosmns avatar Mar 18 '20 19:03 milosmns

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 !

hdwipa avatar Mar 19 '20 03:03 hdwipa

If you want you can make a PR with this change to have it integrated :)

On Thu, Mar 19, 2020, 04:00 hadepea16 [email protected] wrote:

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 !

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/milosmns/circular-slider-android/issues/20#issuecomment-600961961, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANQTCQNOWUBG5TOACCRRJDRIGDFBANCNFSM4HLTBIKA .

milosmns avatar Mar 19 '20 09:03 milosmns