title: How to change color of floating action button on theme change?
body: <p>I want to apply different themes to my application. I want to change the color of navigation bar and floating action button.</p>
  
  <p>Now I am able to change color of navigation bar , but floating action button's color dose not get change. How can I change color of fab dynamically when theme is changed?</p>
  
  <p>Style:</p>
  
  <pre><code>    &lt;!-- Base application theme. --&gt;
      &lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
          &lt;!-- Customize your theme here. --&gt;
          &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
          &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
          &lt;item name="colorAccent_500"&gt;@color/accent_500&lt;/item&gt;
          &lt;item name="colorAccent_700"&gt;@color/accent_700&lt;/item&gt;
  
          &lt;item name="windowActionBarOverlay"&gt;false&lt;/item&gt;
  
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
  
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
          &lt;item name="android:windowBackground"&gt;@color/background_material_light&lt;/item&gt;
      &lt;/style&gt;
      &lt;style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
      &lt;style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /&gt;
  
  
      &lt;style name="BlueTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
          &lt;!-- Customize your theme here. --&gt;
          &lt;item name="colorPrimary"&gt;#3F51B5&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;#303F9F&lt;/item&gt;
          &lt;item name="colorAccent"&gt;#03A9F4&lt;/item&gt;
  
          &lt;item name="windowActionBarOverlay"&gt;false&lt;/item&gt;
  
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
  
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
          &lt;item name="android:windowBackground"&gt;@color/background_material_light&lt;/item&gt;
      &lt;/style&gt;
  
  
      &lt;style name="AppTheme.Solarized"&gt;
          &lt;item name="colorPrimary"&gt;@color/orange300&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/orange500&lt;/item&gt;
          &lt;item name="colorAccent"&gt;@color/solarizedOrange&lt;/item&gt;
          &lt;item name="android:textColorPrimary"&gt;@color/solarizedBase01&lt;/item&gt;
          &lt;item name="android:textColorSecondary"&gt;@color/solarizedBase1&lt;/item&gt;
      &lt;/style&gt;
  
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>Fab :</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/main_fab"
      android:layout_width="100dp"
      android:layout_height="100dp"
      android:layout_gravity="bottom|end"&gt;
  
      &lt;View
          android:id="@+id/myfab_shadow"
          android:layout_width="72dp"
          android:layout_height="72dp"
          android:layout_gravity="center"
          android:background="@drawable/fab_shadow"
          android:focusable="false" /&gt;
  
      &lt;ImageButton
          android:id="@+id/imgbtn_fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:background="@drawable/fab_selector"
          android:cropToPadding="true"
          android:padding="10dp"
          android:src="@drawable/ic_add_white_36dp"
          android:stateListAnimator="@animator/fab_elevation_selector" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>Fab selector :</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;item android:state_pressed="true"&gt;
          &lt;shape android:shape="oval"&gt;
              &lt;solid android:color="@color/colorAccent" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  
      &lt;item android:state_focused="true"&gt;
          &lt;shape android:shape="oval"&gt;
              &lt;solid android:color="@color/accent_700" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  
      &lt;item&gt;
          &lt;shape android:shape="oval"&gt;
              &lt;solid android:color="@color/accent_500" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p>Thank you..</p>