Android Question circle finger counter

sultan87

Active Member
Licensed User
Longtime User
Hello,
I have a circle. I would go with the finger the perimeter of the circle and increase a counter.
how can we do?
best regards
 

JordiCP

Expert
Licensed User
Longtime User
Suppose this circle is inside an imageview,

When you declare this view you also declare its touch event Sub

Each time there is a touch (on each Activity.ACTION_MOVE, starting from activity.ACTION_DOWN, until Activity.ACTION_UP) you can keep track of the touch coordinates

You will need to give the user a reasonable "tolerance" since the touch coordinates will never be on the same perimeter.

If the moves complete the perimeter, do whatever action you want (increase counter, ....)
 
Upvote 0

sultan87

Active Member
Licensed User
Longtime User
Suppose this circle is inside an imageview,

When you declare this view you also declare its touch event Sub

Each time there is a touch (on each Activity.ACTION_MOVE, starting from activity.ACTION_DOWN, until Activity.ACTION_UP) you can keep track of the touch coordinates

You will need to give the user a reasonable "tolerance" since the touch coordinates will never be on the same perimeter.

If the moves complete the perimeter, do whatever action you want (increase counter, ....)
Thank's
I'm going to try
best regards
 
Upvote 0
Top