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

Touch inaccuracy #1

Closed
vbbartlett opened this issue Apr 8, 2020 · 4 comments
Closed

Touch inaccuracy #1

vbbartlett opened this issue Apr 8, 2020 · 4 comments

Comments

@vbbartlett
Copy link
Contributor

I added this ring and when I touch inside the ring, it jumps back to the beginning. If I touch on the inside of the ring it works.

<org.ithot.android.view.RingView
    android:id="@+id/speed"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_marginTop="20dp"
    app:animateDuration="200"
    app:animateType="decelerate"
    app:backgroundColor="#DADADE"
    app:foregroundColor="#00BCD3"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@id/spin"
    app:startAngle="25"
    app:strokeCap="butt"
    app:strokeWidth="30dp"
    app:sweepAngle="310"
    app:touchable="true" />

There is also another problem, when I scroll the ring, when I get near horizontal location it appears to go in the opposite direction for a few degrees.

I would bet there is some error with determining which side of the horizontal line the touch is on.

@vbbartlett
Copy link
Contributor Author

The problem is supply which calculates the width/height incorrectly. if you add the strokewidth to the width and height and then remove that from the distance calculations it fixes all the problems.

@dtboy1995
Copy link
Owner

dtboy1995 commented Apr 9, 2020

@vbbartlett I'm sorry to reply you so late (I don't have a good solution to the problems you mentioned)

You can submit pull request to fix the problem you found. or I found some similar projects for you

I hope this can help you

or

@dtboy1995
Copy link
Owner

@vbbartlett Hi bro
https://github.com/ithot-all/android-ui#sweep
this is a more accurate version of percentage calculation (using float calculation) (but touch support was removed)

@dtboy1995
Copy link
Owner

#2

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

No branches or pull requests

2 participants