Hadi Samadbin
Hadi Samadbin

Reputation: 237

How Could I implement clockwise and counter clockwise gesture in android

We want to detect user finger gesture clockwise and counterclockwise like below shape.Also we want to trigger an action in clockwise motion in on 4 O'clock,and trigger an action in counterclockwise motion on 8 O'clock.

descriptions in Image

we found some circular detection likeThis link and some other but They didn't helped us. How could we achieve this in android??

Also in rounded Arrow we want to detect user gesture if on it and reaches 1 turn The first arrow on, then when user reaches 2 turn the second arrow on. Rounded Arrow

Upvotes: 1

Views: 333

Answers (1)

Ari
Ari

Reputation: 1316

Create two imaginary arc with the same radius. Position them as you need and maintain them for different device resolution.

Check for the following steps:

  1. Use GestureDetector to detect the touch movement.
  2. Whenever the event is created first check if its within these arc bounds.
  3. If yes then check for the movement if its within the same arc or not(Can create a array for saving all the touch points for a certain time period).
  4. If its within same arc then finally check for the upper limit where you are supposed to increase the value

Upvotes: 1

Related Questions