Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inner shadow on circle Android Canvas

I need to make inner shadow and gradient on Circle which I draw in onDraw() method of my view see this (sorry, because of I'm new to StackOverflow I can't post images yet)

I figure out how to get gradient working but I can't get inner shadow done All I've found so far is this post, but it seems a bit complicated and not exactly what I need

I've tried using setShadowLayer(), but it I probably can't get it working right, because besides inner shadow, I get outer shadow too, and this is not what I need

Any help would be appreciated.

Thanks!

like image 308
romants Avatar asked Dec 13 '12 10:12

romants


1 Answers

You should be able the avoid the outer shadow by setting the clip to the circle as that will restrict the drawing just to inside the circle.

like image 156
Keith Coughtrey Avatar answered Sep 23 '22 19:09

Keith Coughtrey