HoloCircleSeekBar
HoloCircleSeekBar copied to clipboard
set value calculation wrong
Try to set value 1
of 100
will cause the view to show value 2
.
or set max value 900, and the calculation of setValue is always wrong.
Any clue to fix this issue?
I'll investigate this as soon as possible. PRs are more than welcome btw ;)
Works fine when I comment few lines in calculateRadiansFromAngle
method .
private int calculateRadiansFromAngle(float angle) {
float unit = (float) (angle / (2 * Math.PI));
// if (unit < 0f) {
// unit += 1;
// }
int radians = (int) ((unit * 360) - ((360 / 4) * 3));
// if (radians < 0)
// radians += 360;
return radians;
}