0

enter image description here

I want to draw arc on canvas with progress percentage on circle and need to perform click on both the color (blue and green).

How to make click listener for the same.

Dhruvil
  • 49
  • 2
  • 8
  • have tried using canvas but if i use two different custom view then get click listener only for 2nd view – Dhruvil Jan 31 '18 at 13:59

1 Answers1

1

You have two circle for grean line
Two circle makes green area(difference of inner and outer circle) say circles G1(inner), G2(outer)
first find circles sector area of G1 and G2 say GS1 and GS2.
Now find touch point form on touch event say p1. If p1 lie in GS2 but not in GS1 than you have touched on green line

Similarly you have two circle for Blue line and you can find touch point

See this link also - Efficiently find points inside a circle sector

Sanjay Kumar
  • 1,135
  • 14
  • 27