title: how to maintain Visibllity of recyclerview item in adapter class
body: <p>I have a <code>layout</code> like bellow in my <code>Adapter</code>:</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:card_view="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="#FFFFFF"&gt;
  
          &lt;android.support.v7.widget.CardView
              android:id="@+id/cardVisibleLayout"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/txtCategoryNameTop"
              card_view:cardElevation="2dp"&gt;
  
              &lt;LinearLayout
                  android:id="@+id/lnVisibleLayout"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:orientation="horizontal"&gt;
  
                  &lt;com.joanzapata.iconify.widget.IconTextView
                      android:id="@+id/itxtArrow"
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:background="@null"
                      android:gravity="center"
                      android:text="@string/fa_chevron_down"
                      android:textColor="@color/orangePeel" /&gt;
                  &lt;TextView
                      android:id="@+id/txtConnectToTeacher"
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_gravity="center"
                      android:layout_weight="1.3"
                      android:gravity="center"
                      android:text="@string/contact_teacher" /&gt;
                  &lt;RelativeLayout
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_gravity="right"
                      android:layout_marginBottom="5dp"
                      android:layout_marginLeft="10dp"
                      android:layout_marginTop="5dp"
                      android:layout_weight="3.7"
                      android:gravity="right"
                      android:orientation="vertical"&gt;
  
                      &lt;TextView
                          android:id="@+id/txtCourseName"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_alignParentRight="true"
                          android:layout_marginRight="10dp"
                          android:layout_marginTop="10dp" /&gt;
  
                      &lt;TextView
                          android:id="@+id/txtTeacherName"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_alignParentRight="true"
                          android:layout_below="@+id/txtCourseName"
                          android:layout_marginRight="10dp"
                          android:layout_marginTop="10dp" /&gt;
                  &lt;/RelativeLayout&gt;
              &lt;/LinearLayout&gt;
          &lt;/android.support.v7.widget.CardView&gt;
  
          &lt;RelativeLayout
              android:id="@+id/rlInvisibleLayout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_below="@+id/cardVisibleLayout"
              android:animateLayoutChanges="true"
              android:background="#E0E0E0"
              android:visibility="gone"&gt;
  
              &lt;RelativeLayout
                  android:id="@+id/rlLessonLink"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_alignParentRight="true"
                  android:layout_marginRight="15dp"&gt;
  
                  &lt;ImageView
                      android:id="@+id/imgLessonLink"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignParentRight="true"
                      android:layout_centerVertical="true"
                      android:layout_marginLeft="5dp"
                      app:srcCompat="@drawable/ic_circle" /&gt;
  
                  &lt;TextView
                      android:id="@+id/txtLessonLink"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_centerVertical="true"
                      android:layout_toLeftOf="@+id/imgLessonLink"
                      android:text="@string/lesson_link"
                      android:textColor="@color/black" /&gt;
              &lt;/RelativeLayout&gt;
          &lt;/RelativeLayout&gt;
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I am <code>visible/gone</code> <code>RelativeLayout</code> with this id <code>rlInvisibleLayout</code> but when I scroll the <code>RecyclerView</code> I lost it.</p>
  
  <p>Like bellow:</p>
  
  <pre><code>@Override
  public void onBindViewHolder(@NonNull final ViewHolder viewHolder, int position) {
  .....
          viewHolder.cardVisibleLayout.setOnClickListener(view -&gt; {
              if (viewHolder.rlInvisibleLayout.getVisibility() == View.VISIBLE) {
                  viewHolder.rlInvisibleLayout.setVisibility(View.GONE);
                  viewHolder.iconTextView.setText(R.string.fa_chevron_down);
              } else {
                  viewHolder.rlInvisibleLayout.setVisibility(View.VISIBLE);
                  viewHolder.iconTextView.setText(R.string.fa_chevron_up);
              }
          });
  ....
  }
  </code></pre>