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

SetAngle value and onSliderMoved Position values are different for same position.. #8

Closed
gowrav opened this issue Aug 18, 2016 · 3 comments

Comments

@gowrav
Copy link

gowrav commented Aug 18, 2016

I am trying to use it as a control for volume, but the values are not continuous they vary widely from 0.25 to -0.75..

I also need to limit the slider progress to a specific arc and not allow it to complete the whole circle..

@milosmns
Copy link
Owner

Limiting is not supported at the moment. I will mark this as "Help Wanted" so that other people can vote and/or apply the patches. Otherwise, you can fork the repository and try to manually add the functionality.

@mikronesia
Copy link

mikronesia commented Oct 25, 2016

Hi @gowrav I noticed the same thing. I'm using mine for a moveable clock face from 0-12 hours. I wrote this function which converts the position (not sure if they're radians) (from 0-9:00 or 0 to -0.75) and then handles when things go off from 9:00-12:00 (or 0.25 back down to 0)

public static String convertAngleToTimeString(double angle) {
        double result;
        result = angle * -12;
        if (result < 0) {
            //Handles 9:00-12:00 where values go negative
            result = result + 12;
        }
        return String.format("%.2f", result);
}

@milosmns
Copy link
Owner

Okay so I've answered to #9 with a solution to a similar problem. Closing this as it is answered there.

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

No branches or pull requests

3 participants