title: Activity Transition between two RecyclerViews
body: <p>I animate from one <code>RecyclerView</code> with a <code>GridLayout</code> to another one. It displays images like a gallery.</p>
  
  <p>The parent <code>RecyclerView</code> shows the first 3 elements of a folder, the child <code>RecyclerView</code> shows the complete content in a Grid...</p>
  
  <p><strong>main adapter</strong></p>
  
  <pre><code>@Override
  public void onBindViewHolder(FolderViewHolder holder, int position) {
      holder.transitionPairs.clear();
      for (int i = 0; i &lt; 3; i++) {
          ImageView iv = holder.getIconView(i);
          Image image = mItems.get(position).getImages().get(i);
          holder.transitionPairs.add(new Pair(iv, image.getTransitionName()));
      }
  </code></pre>
  
  <p><strong>child adapter</strong></p>
  
  <pre><code>@Override
  public void onBindViewHolder(ImageViewHolder holder, int position) {
  
      ViewCompat.setTransitionName(holder.icon, mItems.get(position).getTransitionName());
  }
  </code></pre>
  
  <ul>
  <li>both adapters set the SAME transition name, it's generated from the image uri, so it's surely unique</li>
  </ul>
  
  <p>I start the child view like following:</p>
  
  <pre><code>Intent intent = new Intent(getActivity(), ImagesActivity.class);
          intent.putExtra("folderIndex", pos);
          intent.putExtra("folder", item);
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN) {
              ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(), vh.getTransitionPairs().toArray(new Pair[vh.getTransitionPairs().size()]));
              getActivity().startActivity(intent, options.toBundle());
          }
         else
              getActivity().startActivity(intent);
  </code></pre>
  
  <p>The transition pairs are saved in the <code>ViewHolder</code> and are generated whenever the <code>ViewHolder</code> is bound, as you can see in the <code>ViewHolders</code> code above</p>
  
  <p><strong>PROBLEM</strong></p>
  
  <p>Showing the child view is not animated, going back is animated...</p>