title: Android: Gradient FAB background
body: <p>Can someone share how to implement a gradient background to a floating action button ?</p>
  
  <p>I want to achieve something like that:</p>
  
  <p><a href="https://i.stack.imgur.com/ahlVk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ahlVk.jpg" alt="Gradient FAB"></a></p>
  
  <p>I tried to use the drawable below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;item&gt;
      &lt;shape android:shape="oval"&gt;
          &lt;gradient
              android:type="linear"
              android:angle="0"
              android:startColor="#f6ee19"
              android:endColor="#115ede" /&gt;
      &lt;/shape&gt;
  
  &lt;/item&gt;
  &lt;item android:gravity="center"
      &gt;
      &lt;bitmap android:src="@drawable/ic_close_accent"
          android:gravity="fill_horizontal" /&gt;
  
  &lt;/item&gt;
  </code></pre>
  
  <p></p>
  
  <p>Then in my activity i set android:src to this drawable but it didn't work</p>
  
  <p>I also tried to set android:backgroundTint and android:background but these didn't work too.</p>
  
  <p>Can someone please help?</p>