title: Android changing Floating Action Button color
body: <p>I have been trying to change Material's Floating Action Button color, but without success.</p>
  
  <pre><code>&lt;android.support.design.widget.FloatingActionButton
      android:id="@+id/profile_edit_fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="end|bottom"
      android:layout_margin="16dp"
      android:clickable="true"
      android:src="@drawable/ic_mode_edit_white_24dp" /&gt;
  </code></pre>
  
  <p>I have tried to add:</p>
  
  <pre><code>android:background="@color/mycolor"
  </code></pre>
  
  <p>or via code:</p>
  
  <pre><code>FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.profile_edit_fab);
  fab.setBackgroundColor(Color.parseColor("#mycolor"));
  </code></pre>
  
  <p>or</p>
  
  <pre><code>fab.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#mycolor")));
  </code></pre>
  
  <p>But none of the above worked. I have also tried the solutions in the proposed duplicate question, but none of them works; the button remained green and also became a square.</p>
  
  <p>P.S. It would be also nice to know how to add ripple effect, couldn't understand that either.</p>