Android Lollipop floating button

I have a style like this:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

      <item>
        <shape android:shape="oval"
            android:dither="true">

            <solid 
                android:color="#CCFF0000" />

        </shape>
    </item>

    <item android:bottom="2dp">
        <shape android:shape="oval"
            android:dither="true">

            <solid android:color="#F44336" />
        </shape>
    </item>

</layer-list>

      

I would try to draw this -> enter image description here

But I can draw a shadow. I cannot use android: elevation because I would keep backward compatibility with android. How can I simulate a shadow like in the picture?

+3


source to share


1 answer


If you don't want to use the height, I suggest you use the Shadow image like: [ https://github.com/futuresimple/android-floating-action-button/blob/master/library/src/main/res/drawable-hdpi/ fab_bg_mini.png] [1]



+2


source







All Articles