dtboy1995 / android-sex-ring

:sailboat: a android ring view that can sweep angle
https://ithot.org
MIT License
9 stars 2 forks source link

Touch inaccuracy #1

Closed vbbartlett closed 4 years ago

vbbartlett commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

https://github.com/dtboy1995/android-sex-ring/pull/2