title: How to add an outer shadow for a rounded-corners drawable?
body: <p>I'm using <a href="https://github.com/makeramen/RoundedImageView" rel="nofollow">this RoundedCorners</a> library (based on <a href="http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/" rel="nofollow">Romain Guy's post</a>) which allows to set both outline border and a rounded rectangular image to an imageView . </p>
  
  <p>I need to add an outer shadow (meaning it's outside of the image being shown) to the image that is shown (say ,to direction south-east) . I've decided that since the border is the larger part of what is shown, I would add the shadow to it instead of to the image, using the next extra code in RoundedDrawable : </p>
  
  <pre><code>mBorderPaint.setShadowLayer(shadowRadius, shadowDx, shadowDy, shadowColor);
  </code></pre>
  
  <p>Of course, I've also added the fields and populated them with values.</p>
  
  <p>Problem is, the shadow seem to ignore the dx,dy values i've given it, and it's just setting the background to the entire imageView .</p>
  
  <p>I've read here and some people claim that using setShadowLayer on new android API (from 11+) won't work except on texts because it tries to use the GPU , but I've tested it on API10 too and it had the same result.</p>
  
  <p>How could it be? What should I do in order to fix it or use an alternative?</p>
  
  <p>I assume I could add a new paint like the one used for the border, but this would mean I need to change a lot more code that depends on it too (or actually I need to do it anyway? ) . Plus, i might make it a little uglier than what is shown for real shadows.</p>