title: Android - CardView sometimes hide content
body: <p>I'm developing an App that use RecyclerView to display a list of products. Everything works fine, but sometimes, some TextViews is not showed inside the CardView. Using Layout Inspector I've noticed that the views are there, but the CardView layout hided the content. Bellow is my code:</p>
  
  <p>card_view_product.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout
      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"
      &gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          app:cardCornerRadius="4dp"
          app:cardElevation="4dp"
          app:cardUseCompatPadding="true"
          app:layout_constraintHorizontal_bias="0.0"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="parent"&gt;
  
          &lt;android.support.constraint.ConstraintLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:orientation="vertical"&gt;
  
  
              &lt;ImageView
                  android:id="@+id/imageViewProductImage"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginEnd="8dp"
                  android:layout_marginLeft="8dp"
                  android:layout_marginRight="8dp"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="8dp"
                  android:adjustViewBounds="true"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toTopOf="parent"/&gt;
  
              &lt;TextView
                  android:id="@+id/textViewProductName"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginEnd="8dp"
                  android:layout_marginLeft="8dp"
                  android:layout_marginRight="8dp"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="8dp"
                  android:maxLines="3"
                  android:scrollHorizontally="false"
                  android:text="Texto"
                  android:textColor="@color/black_87"
                  android:textSize="18sp"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/imageViewProductImage"/&gt;
  
              &lt;TextView
                  android:id="@+id/textViewPriceFrom"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginEnd="8dp"
                  android:layout_marginLeft="8dp"
                  android:layout_marginRight="8dp"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="8dp"
                  android:text="R$"
                  android:textColor="@color/black_24"
                  android:textSize="18sp"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/textViewProductName"/&gt;
  
              &lt;TextView
                  android:id="@+id/textViewPriceTo"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginEnd="8dp"
                  android:layout_marginLeft="8dp"
                  android:layout_marginRight="8dp"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="8dp"
                  android:text="R$"
                  android:textColor="@color/faded_orange"
                  android:textSize="18sp"
                  app:layout_constraintLeft_toLeftOf="parent"
                  app:layout_constraintRight_toRightOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/textViewPriceFrom"/&gt;
          &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>content_category.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout
      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="match_parent"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:showIn="@layout/activity_category"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recyclerViewProducts"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginBottom="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginRight="8dp"
          android:layout_marginTop="8dp"
          android:clipToPadding="true"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="parent"/&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>And the onBindViewHOlder of my adapter:</p>
  
  <pre><code>public void onBindViewHolder(ViewHolder holder, final int position) {
      if (position&gt;(products.size()-4)){
          parent.loadMoreProducts();
      }
      final ProductModel product = products.get(position);
      ImageView imageViewProduct = (ImageView) holder.mView.findViewById(R.id.imageViewProductImage);
      TextView textViewName = (TextView) holder.mView.findViewById(R.id.textViewProductName);
      TextView textViewPriceFrom = (TextView) holder.mView.findViewById(R.id.textViewPriceFrom);
      TextView textViewPriceTo = (TextView) holder.mView.findViewById(R.id.textViewPriceTo);
  
      if (product.imageURL!=null) {
          Picasso.with(holder.mView.getContext()).load(imageUrl).into(imageViewProduct);
      }
      textViewPriceFrom.setVisibility(View.INVISIBLE);
      textViewPriceFrom.setPaintFlags(textViewPriceFrom.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
  
      if (product.enginePrice!=null &amp;&amp; product.enginePrice.listPrice!=null &amp;&amp; product.enginePrice.amountPrice!=null){
          if (product.enginePrice.listPrice&gt;product.enginePrice.amountPrice){
              textViewPriceFrom.setVisibility(View.VISIBLE);
          }
          textViewPriceFrom.setText(Util.priceStringFromDouble(product.enginePrice.listPrice));
          textViewPriceTo.setText(Util.priceStringFromDouble(product.enginePrice.amountPrice));
      }
      textViewName.setText(product.name+position);
      holder.mView.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
  
          }
      });
  }
  </code></pre>
  
  <p>I've noticed that only when the First TextView has the same value this bug occur. Bellow is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/WUQmR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WUQmR.png" alt="enter image description here"></a></p>