Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump from endDot to startDot when holding touch #2

Open
BoilingLime opened this issue Oct 22, 2014 · 6 comments
Open

Jump from endDot to startDot when holding touch #2

BoilingLime opened this issue Oct 22, 2014 · 6 comments

Comments

@BoilingLime
Copy link

I guess this is not a real issue, but is there any way to avoid this comportment. It would be great to have a BOOL property to set in the CircleSelector to avoid to jump from endpoint to startpoint when user hold finger pressed and go from end to start.

If you have any tricks, let me know.

@natalia-osa
Copy link
Owner

Sure ^^ Will add this feature in next version (this or next weekend).

@BoilingLime
Copy link
Author

Thanks, great work any way, this is awesome. And one more thing. Is there a simple way to move programatically a dot ? I'm actually using it as a slider at the same time as a progress bar for audio duration. So I would like to move dot while the audio is playing in an updating methods.
I'm trying to directly set the NOCircleDot angle property, but does't seem to refresh the UI.

@natalia-osa
Copy link
Owner

Thank you so much^^. To move a dot via code you need to find the correct dot and setAngle:. You can calculate the angle with method: angleForValue:maxAngle:maxValue:minAngle:minValue:. Then you need to redraw NOCircleSelector.

Still, such use of the method is not animated ;). If you want animations I can add them too, that's a good idea. Will also add it in next version.

@BoilingLime
Copy link
Author

This is what I'm doing, for the first part.

    NOCircleDot *dot = ((NOCircleDot *)[[circleSelector dots] objectAtIndex:1]);

    dot.angle =
    [NOCircleDot angleForValue:audioPlayer.progress maxAngle:dot.maxAngle
                      maxValue:audioPlayer.duration minAngle:kbigMinAngle minValue:0.0];
    [dot.textLabel setText:[NSString stringWithFormat:@"%@", [Utils convertSecond:
                                                              [NOCircleDot valueForAngle:dot.angle maxAngle:kbigMaxAngle maxValue:audioPlayer.duration minAngle:kbigMinAngle minValue:0.f]]]];

But I'm not sure how to redraw the NOCircleSelector properly, since there is not public methods to do it.

@natalia-osa
Copy link
Owner

Very well, then you only need to call this after your code:

[cicleSelector setNeedsDisplay];

This will call delegate method circleSelector:updatedDot:, so if you have your text handler there it will change the text and you can delete it here.

@BoilingLime
Copy link
Author

Oh my bad I was calling setNeedsDisplay on NOCircleDot -_- !
Great it works, as you said, the animation would be a nice enhancement. I'll wait for it :).
Thanks for your help, and for your work.

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

No branches or pull requests

2 participants