title: How to enable and disable the view in card item?
body: <p>I am using cardview to design this layout. Here when I click <strong>3 dots icon</strong> in any item, a respective card item shows the <strong>transparent Black layer</strong> over this. But what do I need to do that when I click <strong>ITEM-1 Vennila</strong>,it need to show the <strong>transparent Black layout</strong> and then when I click the <strong>ITEM -2 dots</strong>, <strong>ITEM-1 Transparent has to be gone and ITEM-2 Transparent has to be shown.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/iQA5W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iQA5W.png" alt="enter image description here"></a></p>
  
  <p>I am using RecyclerView. Please help me to fix it.</p>
  
  <p>This is my Adapter code:</p>
  
  <pre><code>public class CardAdapter extends RecyclerView.Adapter&lt;CardAdapter.ViewHolder&gt; {
  
      List&lt;Restaurant_Beam&gt; restaurant_prducts;
      Config config;
      Bitmap bmp;
      boolean success = false;
      ArrayList&lt;String&gt; CATEGORYNAME = new ArrayList&lt;&gt;();
      ArrayList&lt;String&gt; ITEMNAME = new ArrayList&lt;&gt;();
      ArrayList&lt;String&gt; ITEM_PRICE = new ArrayList&lt;&gt;();
      ArrayList&lt;String&gt; LIKE_COUNT = new ArrayList&lt;&gt;();
      int clickCount = 0;
  
      private ImageLoader imageLoader;
      private Context context;
  
      public CardAdapter(List&lt;Restaurant_Beam&gt; superHeroes, Context context) {
          super();
  
          this.restaurant_prducts = superHeroes;
          this.context = context;
      }
  
      @Override
      public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, parent, false);
          ViewHolder viewHolder = new ViewHolder(v);
          return viewHolder;
      }
  
      @Override
      public void onBindViewHolder(final ViewHolder holder, final int position) {
  
          Restaurant_Beam restaurant_beam = restaurant_prducts.get(position);
          Typeface tf = Typeface.createFromAsset(context.getAssets(), "roboto.medium.ttf");
          Typeface tf1 = Typeface.createFromAsset(context.getAssets(), "roboto.regular.ttf");
  
  
          imageLoader = CustomVolleyRequest.getInstance(context).getImageLoader();
          imageLoader.get(config.IMAGE_URL + restaurant_beam.getImageUrl() + ".jpg", ImageLoader.getImageListener(holder.productImage, R.drawable.image_1, R.drawable.image_1));  //android.R.drawable.ic_dialog_alert
  
          String IMAGE_URL = config.IMAGE_URL + restaurant_beam.getImageUrl() + ".jpg";
          String ITEM_NAME = restaurant_beam.getStr_productName();
          String CATEGORY_NAME = restaurant_beam.getStr_categoryName();
          String PRICE = String.valueOf(restaurant_beam.getStrPrice());
          int LIKECOUNT = (restaurant_beam.getLikeCount());
          String ITEM_ID = restaurant_beam.getProduct_id();
          Log.e("Like Count  ", String.valueOf(LIKECOUNT));
  
          holder.productImage.setImageUrl(IMAGE_URL, imageLoader);
          holder.txt_itemName.setText(ITEM_NAME);
          holder.txt_itemName.setTypeface(tf);
          holder.txt_categoryName.setText(CATEGORY_NAME);
          holder.txt_itemName.setTypeface(tf1);
          holder.txt_Price.setText(PRICE);
          holder.txtFav.setText(String.valueOf(LIKECOUNT));
          holder.txtItemID.setText(ITEM_ID);
  
          holder.linearLayout.setVisibility(View.INVISIBLE);
  
  
          ITEMNAME.add(ITEM_NAME);
          CATEGORYNAME.add(CATEGORY_NAME);
          ITEM_PRICE.add(PRICE);
          LIKE_COUNT.add(String.valueOf(LIKECOUNT));
  
  
          Log.e("Card Adapter", "Product Name" + String.valueOf(ITEMNAME) + "  Category Name" + CATEGORYNAME + " Price" + ITEM_PRICE + "Restaurant Product" + restaurant_prducts);
  
          holder.productImage.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  Intent i = new Intent(view.getContext(), ProductActivity.class);
                  i.putExtra("itemName", holder.txt_itemName.getText().toString());
                  i.putExtra("categoryName", holder.txt_categoryName.getText().toString());
                  i.putExtra("Price", Integer.parseInt(holder.txt_Price.getText().toString()));
                  i.putExtra("like", Integer.parseInt(holder.txtFav.getText().toString()));
                  i.putExtra("itemID", holder.txtItemID.getText().toString());
  
                  view.getContext().startActivity(i);
              }
          });
  
          holder.iv_settings.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  clickCount++;
  
                  if (v.isEnabled() == true) {
                      holder.linearLayout.setVisibility(View.VISIBLE);
                      holder.txt_categoryName.setVisibility(View.INVISIBLE);
                      holder.txt_itemName.setVisibility(View.INVISIBLE);
                      holder.iv_settings.setVisibility(View.INVISIBLE);
                  }
  
              }
          });
  
          holder.viewDetail.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Toast.makeText(v.getContext(), "Clicked ViewDetail", Toast.LENGTH_SHORT).show();
              }
          });
          holder.addToCart.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Toast.makeText(v.getContext(), "Clicked AddToCart", Toast.LENGTH_SHORT).show();
              }
          });
          holder.checkOut.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Toast.makeText(v.getContext(), "Clicked CheckOut", Toast.LENGTH_SHORT).show();
              }
          });
      }
  
      @Override
      public int getItemCount() {
          Log.e("Restaurant Size", String.valueOf(restaurant_prducts
                  .size()));
          return restaurant_prducts.size();
      }
  
      public void setFilter(String query) {
          Log.e("Adapter Query", query);
  
          if (ITEMNAME.contains(query)) {
              Log.e("Inside of SetFilter", " Res");
              Log.e("Adapter", String.valueOf(ITEMNAME));
          }
  
          Log.e("Adapter Query", String.valueOf(ITEMNAME) + " " + CATEGORYNAME + " " + ITEM_PRICE + " ");
          notifyDataSetChanged();
      }
  
      public class ViewHolder extends RecyclerView.ViewHolder {
          public NetworkImageView productImage;
          public TextView txt_categoryName, txtFav, txtItemID;
          public TextView txt_itemName, txt_Price;
          public CardView cardlist_item;
          public ImageView iv_settings;
          public LinearLayout linearLayout;
          public Button viewDetail, addToCart, checkOut;
  
          public ViewHolder(View itemView) {
              super(itemView);
              iv_settings = (ImageView) itemView.findViewById(R.id.iv_settings);
              cardlist_item = (CardView) itemView.findViewById(R.id.cardlist_item);
              txt_itemName = (TextView) itemView.findViewById(R.id.txt_itemName);
              txt_Price = (TextView) itemView.findViewById(R.id.txt_Price);
              txt_categoryName = (TextView) itemView.findViewById(R.id.txt_categoryName);
              productImage = (NetworkImageView) itemView.findViewById(R.id.productImage);
              txtFav = (TextView) itemView.findViewById(R.id.txtFav);
              txtItemID = (TextView) itemView.findViewById(R.id.txtItemID);
              linearLayout = (LinearLayout) itemView.findViewById(R.id.linearTransparent);
              viewDetail = (Button) itemView.findViewById(R.id.butViewDetail);
              addToCart = (Button) itemView.findViewById(R.id.but_addTCart);
              checkOut = (Button) itemView.findViewById(R.id.butCheckOut);
          }
      }
  }
  </code></pre>
  
  <p>xml code:</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:id="@+id/cardlist_item"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_margin="5dp"
      android:background="@drawable/curved_shape"
      android:orientation="vertical"
      card_view:cardElevation="7dp"&gt;
  
      &lt;RelativeLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="2dp"
          android:background="#FFF"
          android:orientation="horizontal"&gt;
  
          &lt;com.android.volley.toolbox.NetworkImageView
              android:id="@+id/productImage"
              android:layout_width="150dp"
              android:layout_height="130dp"
              android:layout_alignParentEnd="true"
              android:layout_alignParentLeft="true"
              android:layout_alignParentRight="true"
              android:background="@drawable/round_shape"
              android:layout_alignParentStart="true"
              android:layout_alignParentTop="true"
              android:src="@drawable/product_2" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/linearLayout"
              android:layout_width="match_parent"
              android:layout_height="35dp"
              android:layout_alignLeft="@+id/productImage"
              android:layout_alignStart="@+id/productImage"
              android:layout_below="@+id/productImage"
              android:background="@drawable/curved_shape"
              android:gravity="center_vertical"
              android:orientation="horizontal"
              android:paddingLeft="3dp"
              android:paddingRight="4dp"
              android:weightSum="1"&gt;
  
              &lt;TextView
                  android:id="@+id/listitem_name"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:layout_gravity="center"
                  android:layout_weight="0.1"
                  android:textStyle="bold"
                  android:text="@string/Rs"
                  android:textSize="12dp" /&gt;
  
              &lt;TextView
                  android:id="@+id/txt_Price"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:textStyle="bold"
                  android:layout_weight="0.25"
                  android:text="120"
                  android:textSize="12dp" /&gt;
  
              &lt;ImageView
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="0.07"
                  android:src="@drawable/ic_favorite" /&gt;
  
              &lt;TextView
                  android:id="@+id/txtFav"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="0.20"
                  android:text=" 153"
                  android:textSize="10dp" /&gt;
  
              &lt;TextView
                  android:id="@+id/txtItemID"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="0.00"
                  android:textSize="0dp" /&gt;
  
              &lt;ImageView
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="0.07"
                  android:gravity="center"
                  android:src="@drawable/ic_schedule" /&gt;
  
              &lt;TextView
                  android:id="@+id/txtTime"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="0.25"
                  android:gravity="center"
                  android:text="30 min"
                  android:textSize="10dp" /&gt;
          &lt;/LinearLayout&gt;
  
  
          &lt;ImageView
              android:id="@+id/imageView4"
              android:layout_width="150dp"
              android:layout_height="130dp"
              android:layout_alignParentEnd="true"
              android:layout_alignParentLeft="true"
              android:layout_alignParentRight="true"
              android:layout_alignParentStart="true"
              android:background="@drawable/transparent_layout" /&gt;
  
          &lt;TextView
              android:id="@+id/txt_itemName"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_above="@+id/txt_categoryName"
              android:layout_alignLeft="@+id/productImage"
              android:layout_alignStart="@+id/productImage"
              android:layout_marginLeft="8dp"
              android:text="Veg Burger"
              android:textColor="@color/white"
              android:textSize="16dp"
              android:textStyle="bold" /&gt;
  
          &lt;TextView
              android:id="@+id/txt_categoryName"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_above="@+id/linearLayout"
              android:layout_alignLeft="@+id/productImage"
              android:layout_alignStart="@+id/productImage"
              android:layout_marginBottom="12dp"
              android:layout_marginLeft="8dp"
              android:layout_marginTop="2dp"
              android:text="Category Name"
              android:textColor="@color/white"
              android:textSize="11dp"
              android:textStyle="bold" /&gt;
  
          &lt;ImageView
              android:id="@+id/iv_settings"
              android:layout_width="30dp"
              android:layout_height="35dp"
              android:layout_alignBottom="@+id/txt_categoryName"
  
              android:layout_alignParentEnd="true"
              android:layout_alignParentRight="true"
              android:layout_alignTop="@+id/txt_itemName"
              android:foregroundGravity="right"
              android:src="@drawable/ic_settings3" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/linearTransparent"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_alignBottom="@+id/imageView4"
              android:layout_alignParentLeft="true"
              android:layout_alignParentStart="true"
              android:layout_alignParentTop="true"
              android:background="@color/transparent_black"
              android:orientation="vertical"
              android:visibility="visible"&gt;
  
              &lt;Button
                  android:id="@+id/butViewDetail"
                  android:layout_width="120dp"
                  android:layout_height="30dp"
                  android:layout_gravity="center_horizontal"
                  android:layout_marginTop="8dp"
                  android:background="@color/white"
                  android:text="View Detail" /&gt;
  
              &lt;Button
                  android:id="@+id/but_addTCart"
                  android:layout_width="120dp"
                  android:layout_height="30dp"
                  android:layout_gravity="center_horizontal"
                  android:layout_marginTop="8dp"
                  android:background="@color/green"
                  android:text="ADD TO CART"
                  android:textColor="@color/white" /&gt;
  
              &lt;Button
                  android:id="@+id/butCheckOut"
                  android:layout_width="120dp"
                  android:layout_height="30dp"
                  android:layout_gravity="center_horizontal"
                  android:layout_marginTop="8dp"
                  android:background="@color/orange"
                  android:text="CHECK  OUT"
                  android:textColor="@color/white" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>