Android ImageView drop shadow
<p>I'm trying to add a drop shadow to an ImageView. The other Stackoverflow answer seems to be using canvas and bitmaps etc, way more complicated than it needs to be.</p>

<p>On iOS I would do something like this:</p>

<pre><code>myImageView.layer.shadowColor = [UIColor redColor].CGColor;
myImageView.layer.shadowRadius = 5;
myImageView.layer.shadowOffset = CGRectMake(0, 5);
</code></pre>

<p>and it would render a drop shadow, regardless of whether the shadow is being applied on a view, an image or text.</p>

<p>I've tried to do the same on Android but it just refuses to work:</p>

<pre><code>birdImageView = new ImageView(context);
birdImageView.setImageResource(R.drawable.yellow_bird);

Paint paint = new Paint();
paint.setAntiAlias(true);


birdImageView.setLayerType(LAYER_TYPE_SOFTWARE, null);
paint.setShadowLayer(5, 0, 5, Color.argb(255, 255, 0, 0));
birdImageView.setLayerPaint(paint);
</code></pre>

<p>I don't see any expected red drop shadow on my bird image at all.</p>

<p>Am I doing something wrong?</p>

<h2>Example</h2>

<p>Let's say I want the drop shadow like this:</p>

<p><a href="https://i.stack.imgur.com/QnlAa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QnlAa.png" alt="drop shadow example"></a></p>

<h2>Update</h2>

<p>Do I have to resort to Android 5.0 and the new Elevation api (<a href="http://developer.android.com/training/material/shadows-clipping.html" rel="noreferrer">http://developer.android.com/training/material/shadows-clipping.html</a>) ?</p>

<p>But if one was to use new API, then according to current demographics (<a href="http://www.droid-life.com/2016/02/02/android-distribution-february-2016/" rel="noreferrer">http://www.droid-life.com/2016/02/02/android-distribution-february-2016/</a>) more than 50% of users will not be able to use the app.</p>

<p>T_T</p>