title: How to greyout a card in a card view?
body: <p>I have a card view that lists a set of cards dynamically. I have used recyclerview for that. Now I want to disable a card(based on value)by greying out the card or something like that. This is the layout that contains the card view</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 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="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical"&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="112dp"
          android:layout_height="140dp"
          android:layout_margin="10dp"
          android:clickable="true"
          android:focusable="true"
          android:scaleType="fitXY"&gt;
  
          &lt;RelativeLayout
              android:layout_width="100dp"
              android:layout_height="150dp"
              android:padding="8dp"&gt;
  
              &lt;ImageView
                  android:id="@+id/appIcon"
                  android:layout_width="match_parent"
                  android:layout_height="62dp"
                  android:padding="5dp"
                  tools:ignore="VectorDrawableCompat" /&gt;
  
              &lt;TextView
                  android:id="@+id/name"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_below="@+id/appIcon"
                  android:layout_centerInParent="true"
                  android:gravity="center"
                  android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
                  android:textColor="@drawable/selector"
                  android:textSize="10dp"
                  android:textStyle="bold" /&gt;
  
              &lt;TextView
                  android:id="@+id/appVersion"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignParentBottom="true"
                  android:layout_alignParentEnd="true"
                  android:layout_marginBottom="5dp"
                  android:layout_marginEnd="1dp"
                  android:text="version 0.0"
                  android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
                  android:textSize="8dp" /&gt;
  
          &lt;/RelativeLayout&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
  
  &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p>I have found some related queries and have tried out using selectors and greying out each field instead of the entire card.</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:state_enabled="true" android:color="@color/colorAppName" /&gt;
      &lt;item android:state_enabled="false" android:color="@color/colorPrimary" /&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p><strong>and in my class(Adapter.kt)</strong></p>
  
  <pre><code>name = itemView.findViewById(R.id.name) as TextView
  if(value==true)
  {
    name.isEnabled=false
  }
  </code></pre>
  
  <p>But I want to disable the entire card. Please help</p>