title: Change RecyclerView CardView background to transparent
body: <p><strong><em>Problem Short Version:</em></strong></p>
  
  <blockquote>
    <p>I want to make my CardView and RecyclerView background transparent, so
    the fragment/activity background should become visible.</p>
  </blockquote>
  
  <p><strong><em>Explained:</em></strong></p>
  
  <p>I have an activity <strong>A</strong> with background image and fragment <strong>B</strong> is replaced on its <strong>Framelayout</strong>  , in Fragment <strong>B</strong> i have <strong>recyclerView</strong> which with <strong>CardView</strong> now problem is i want to make <strong>every background transparent</strong> so only CardView will be visible with actual background of activity </p>
  
  <p><strong><em>RecyclerView look like this(These white background should be transparent) :</em></strong>
  <a href="https://i.stack.imgur.com/3O31i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3O31i.png" alt="recyclerView_Card"></a></p>
  
  <h1>Code</h1>
  
  <p><em>Activity(A)</em></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
          android:id="@+id/fl"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@android:color/transparent"
          android:backgroundTint="@android:color/transparent"/&gt;
  </code></pre>
  
  <p><em>Fragment(B) RecyclerView</em></p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:backgroundTint="@android:color/transparent"
      android:background="@android:color/transparent"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/rv"
          tools:listitem="@layout/layout_video_item"
          android:backgroundTint="@android:color/transparent"
          android:background="@android:color/transparent"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/&gt;
  
      &lt;TextView
          android:id="@+id/tv_not_found"
          android:text="No Media Found Yet"
          android:layout_gravity="center"
          android:gravity="center"
          android:visibility="gone"
          android:textAppearance="@style/TextAppearance.AppCompat.Large"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p><em>CardView / Item layout</em></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginEnd="3dp"
      android:layout_marginStart="3dp"
      android:layout_marginTop="3dp"
      android:background="@android:color/transparent"&gt;
  
      &lt;android.support.v7.widget.CardView
          style="@style/CardView.Light"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:cardUseCompatPadding="true"
          android:background="@android:color/transparent"
          android:backgroundTint="@android:color/transparent"
          app:cardCornerRadius="5dp"
          android:padding="0dp"
          app:cardElevation="0dp"
          tools:ignore="ContentDescription"&gt;
  
          &lt;android.support.constraint.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="0dp"
              android:background="@color/colorAccent"&gt;
  
              &lt;ImageView
                  android:id="@+id/media_image"
                  android:layout_width="100dp"
                  android:layout_height="0dp"
                  android:scaleType="centerCrop"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toTopOf="parent"
                  app:srcCompat="@android:color/darker_gray" /&gt;
  
              &lt;ImageButton
                  android:id="@+id/ib_delete"
                  android:layout_width="30dp"
                  android:layout_height="40dp"
                  android:background="#00FFFFFF"
                  android:padding="12dp"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:srcCompat="@drawable/ic_delete_white_24dp" /&gt;
  
              &lt;ImageButton
                  android:id="@+id/share_button"
                  android:layout_width="30dp"
                  android:layout_height="40dp"
                  android:background="#00FFFFFF"
                  android:padding="12dp"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintEnd_toStartOf="@+id/ib_delete"
                  app:srcCompat="@drawable/ic_share_white_24dp" /&gt;
  
              &lt;TextView
                  android:id="@+id/tv_video_name"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="5dp"
                  android:ellipsize="marquee"
                  android:singleLine="true"
                  android:text="Title Test"
                  android:textAppearance="@style/TextAppearance.AppCompat.Large.Inverse"
                  android:textColor="@color/colorPrimaryText"
                  app:layout_constraintEnd_toStartOf="@+id/tv_ribbon"
                  app:layout_constraintStart_toEndOf="@+id/media_image"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
              &lt;TextView
                  android:id="@+id/tv_ribbon"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:background="@android:color/holo_red_light"
                  android:ellipsize="marquee"
                  android:fontFamily="monospace"
                  android:padding="3dp"
                  android:singleLine="true"
                  android:text="New"
                  android:textColor="@color/colorIcons"
                  android:textSize="14sp"
                  android:visibility="gone"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
              &lt;TextView
                  android:id="@+id/tv_path"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginEnd="8dp"
                  android:layout_marginStart="5dp"
                  android:ellipsize="marquee"
                  android:singleLine="true"
                  android:text="subtitle test"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toEndOf="@+id/media_image"
                  app:layout_constraintTop_toBottomOf="@+id/tv_video_name" /&gt;
  
              &lt;ImageView
                  android:id="@+id/iv_is_audio"
                  android:layout_width="25dp"
                  android:layout_height="25dp"
                  android:layout_marginBottom="8dp"
                  android:layout_marginStart="5dp"
                  android:layout_marginTop="8dp"
                  android:visibility="invisible"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintStart_toEndOf="@+id/media_image"
                  app:layout_constraintTop_toBottomOf="@+id/tv_duration"
                  app:srcCompat="@drawable/ic_settings_voice_black_24dp" /&gt;
  
              &lt;ImageView
                  android:id="@+id/iv_is_video"
                  android:layout_width="25dp"
                  android:layout_height="25dp"
                  android:layout_marginStart="5dp"
                  android:visibility="invisible"
                  app:layout_constraintBottom_toBottomOf="@+id/iv_is_audio"
                  app:layout_constraintStart_toEndOf="@+id/iv_is_audio"
                  app:layout_constraintTop_toTopOf="@+id/iv_is_audio"
                  app:srcCompat="@drawable/ic_theaters" /&gt;
  
              &lt;ImageView
                  android:id="@+id/iv_is_gif"
                  android:layout_width="35dp"
                  android:layout_height="30dp"
                  android:layout_marginStart="5dp"
                  android:visibility="invisible"
                  app:layout_constraintBottom_toBottomOf="@+id/iv_is_video"
                  app:layout_constraintStart_toEndOf="@+id/iv_is_video"
                  app:layout_constraintTop_toTopOf="@+id/iv_is_video"
                  app:srcCompat="@drawable/ic_gif" /&gt;
  
              &lt;TextView
                  android:id="@+id/tv_duration"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="5dp"
                  android:layout_marginTop="8dp"
                  android:text="0:00"
                  app:layout_constraintStart_toEndOf="@+id/media_image"
                  app:layout_constraintTop_toBottomOf="@+id/tv_path" /&gt;
  
              &lt;TextView
                  android:id="@+id/tv_size"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginStart="8dp"
                  android:text="0 MB"
                  app:layout_constraintBottom_toBottomOf="@+id/tv_duration"
                  app:layout_constraintStart_toEndOf="@+id/tv_duration"
                  app:layout_constraintTop_toTopOf="@+id/tv_duration" /&gt;
  
  
          &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><em>Reason for asking question:</em></p>
  
  <p>I know there are lots of SO question out there to get this same task done but my requirements are little different and reason for asking this question is nothing is working for me.</p>
  
  <p><em>Expectation</em></p>