title: RecyclerView with expandable Views
body: <p>I have already found <a href="https://stackoverflow.com/questions/27203817/recyclerview-expand-collapse-items">this</a> post that contains an answer how to do it. But there are some things that don't work and I can't figure out why.</p>
  
  <pre><code>@Override
          public void onBindViewHolder(final ShipViewer.anAdapter.NumberViewHolder holder, final int position) {
  
              final int[] mExpandedPosition = {-1};
              final boolean isExpanded = position== mExpandedPosition[0];
              holder.details.setVisibility(isExpanded?View.VISIBLE:View.GONE);
              holder.itemView.setActivated(isExpanded);
              holder.itemView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      mExpandedPosition[0] = isExpanded ? -1:position;
                      TransitionManager.beginDelayedTransition(recyclerView);
                      notifyDataSetChanged();
                  }
              });
              holder.bind(position);
          }
  </code></pre>
  
  <p>First of, I can't resolve details. Details is a gone ConstraintLayout inside of my Viewholder:</p>
  
  <pre><code>&lt;android.support.constraint.ConstraintLayout
          android:id="@+id/details"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginLeft="16dp"
          android:layout_marginRight="16dp"
          android:layout_marginTop="0dp"
          android:visibility="gone"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/bigtextname"&gt;
  
          &lt;TextView
              android:id="@+id/textView10"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="TextView" /&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>My second problem is that I can't resolve recyclerView. I have already tried inserting my adapter but that also doesn't work.</p>
  
  <p>Lastly, is it fine that so many things are final here? This doesn't seem right, but if I don't do it it tells me that they need to be final to be accessed from an inner class.</p>
  
  <p>My recyclerView:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/ShipRec"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/black"&gt;
  
  &lt;/android.support.v7.widget.RecyclerView&gt;
  </code></pre>
  
  <p>Initialization of RecyclerView:</p>
  
  <pre><code>View b = inflater.inflate(R.layout.shipviewerrecview, container, false);
  
                      if(!shipsCursor.moveToPosition(0)) {return b;}
  
                      shipropView = (RecyclerView) b.findViewById(R.id.ShipRec);
                      LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
                      shipropView.setLayoutManager(layoutManager);
                      shipropView.setHasFixedSize(true);
  shippropAdapter = new ShipViewer.anAdapter(numberofField, Names, Type, Size, MaxSize, Amount);
  
  
                      ShipsDbHelper.close();
                      return b;
  </code></pre>