0

I downloaded the code form given link. https://github.com/dlazaro66/WheelIndicatorView

After running the sample application, I get this output:

ouput

Now I want to perform different action on different color click. like :

  1. on yellow click should be display yellow in Toast.
  2. on green click should be display green in Toast.
  3. on white click should be display white in Toast.
Jean Vitor
  • 893
  • 1
  • 18
  • 24
  • 1
    There is no easy solution to this. If you look into source code of this indicator view, you will see that those coloured rings are drawn using canvas. There is no easy way to check, if any particular shape on canvas was clicked or not. You could extend the library and provide methods that will check if clicked spot belongs to any of rings. The other idea is to get colour of clicked pixel and then compare it to predefined ones. – pawelo Aug 24 '16 at 12:33
  • @pawelo hmm, thanks – pankaj gupta Aug 25 '16 at 07:13

1 Answers1

0

The circle object is loaded as image, so there is no way to find the "tapped" color from the object, so you have to find the pixel color of the point you tap. By digging around i saw this, a somewhat similar question "how to get pixel color", i think that;s what you need since the circle is presented as image.

Community
  • 1
  • 1
gvlachakis
  • 474
  • 7
  • 14