title: Why floating action button is not displaying any src image and backgroud?
body: <p>I am trying to add image and background to a floating action button in the coordinator layout but I am not getting any image preview and background-color</p>
  <p>fragment_task.xml</p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;
  
      &lt;androidx.recyclerview.widget.RecyclerView
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:id=&quot;@+id/recycler_view_tasks&quot;
          /&gt;
  
      &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_gravity=&quot;bottom|end&quot;
          android:layout_margin=&quot;16dp&quot;
          app:srcCompat=&quot;@drawable/ic_add&quot;
          app:tint=&quot;@color/teal_200&quot;
  
          android:contentDescription=&quot;@string/todo&quot; /&gt;
  
  &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  </code></pre>
  <p>Here is my build.gradle maybe this can help identify the problem</p>
  <p>build.gradle</p>
  <pre><code>plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id 'kotlin-android-extensions'
      id 'kotlin-kapt'
      id 'dagger.hilt.android.plugin'
      id 'androidx.navigation.safeargs.kotlin'
  }
  
  android {
      compileSdkVersion rootProject.compileSdkVersion
      buildToolsVersion &quot;29.0.3&quot;
  
      defaultConfig {
          applicationId &quot;com.codinginflow.mvvmtodo&quot;
          minSdkVersion rootProject.minSdkVersion
          targetSdkVersion rootProject.targetSdkVersion
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
  
      buildFeatures {
          viewBinding true
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      kotlinOptions {
          jvmTarget = '1.8'
          freeCompilerArgs += &quot;-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi&quot;
      }
  }
  
  dependencies {
      // Default dependencies
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion&quot;
      implementation &quot;androidx.core:core-ktx:$ktxVersion&quot;
      implementation &quot;androidx.appcompat:appcompat:$appCompatVersion&quot;
      implementation &quot;com.google.android.material:material:$materialVersion&quot;
      implementation &quot;androidx.constraintlayout:constraintlayout:$constraintLayoutVersion&quot;
      testImplementation &quot;junit:junit:$junitVersion&quot;
      androidTestImplementation &quot;androidx.test.ext:junit:$testExtJunitVersion&quot;
      androidTestImplementation &quot;androidx.test.espresso:espresso-core:$espressoVersion&quot;
  
      // Fragment
      implementation &quot;androidx.fragment:fragment-ktx:$fragmentVersion&quot;
  
      // Lifecycle + ViewModel &amp; LiveData
      implementation &quot;androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion&quot;
      implementation &quot;androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion&quot;
      implementation &quot;android.arch.lifecycle:common-java8:$lifecycleVersion&quot;
  
      // Navigation Component
      implementation &quot;androidx.navigation:navigation-fragment-ktx:$navigationVersion&quot;
      implementation &quot;androidx.navigation:navigation-ui-ktx:$navigationVersion&quot;
  
      // Room
      implementation &quot;androidx.room:room-runtime:$roomVersion&quot;
      kapt &quot;androidx.room:room-compiler:$roomVersion&quot;
      implementation &quot;androidx.room:room-ktx:$roomVersion&quot;
  
      // Coroutines
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion&quot;
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion&quot;
  
      // Dagger Hilt
      implementation &quot;com.google.dagger:hilt-android:$hiltVersion&quot;
      kapt &quot;com.google.dagger:hilt-android-compiler:$hiltVersion&quot;
      implementation &quot;androidx.hilt:hilt-lifecycle-viewmodel:$hiltAndroidXVersion&quot;
      kapt &quot;androidx.hilt:hilt-compiler:$hiltAndroidXVersion&quot;
  
      // DataStore
      implementation &quot;androidx.datastore:datastore-preferences:$dataStoreVersion&quot;
  
      implementation 'com.android.support:appcompat-v7:27.1.1'
      implementation 'com.android.support:design:27.1.1'
  }
  
  kapt {
      correctErrorTypes true
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/AULWO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AULWO.png" alt="XML preview" /></a></p>
  <p>Floating button is at the bottom end</p>
  <p>Tell me which other files do you need and I will edit the question.</p>