title: Shared Element transition don't work from recyclerVIew
body: <p>I'm trying to make a shared element transition between fragments from a recycler view and I don't know where I'm wrong.</p>
  <p>In the enter transition it enters as a normal fragment navigation. In the return transition it animates but in a wrong way and it always animates to the last index of the recycler view.</p>
  <p>How can I fix it?</p>
  <pre><code>class HomeFragment : Fragment(R.layout.fragment_home) {
  
      private var _binding: FragmentHomeBinding? = null
      private val binding: FragmentHomeBinding get() = _binding!!
      private val viewModel: CloudViewModel by viewModel()
  
      override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View {
          _binding = FragmentHomeBinding.inflate(inflater, container, false)
  
          return binding.root
      }
  
      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
  
          val adapter = GridAdapter(cloudList, cloudListener)
          val recyclerView = binding.rvGrid
          recyclerView.adapter = adapter
  
          postponeEnterTransition()
          recyclerView.doOnPreDraw {
              startPostponedEnterTransition()
          }
  
      }
  
      private val cloudListener = GridAdapter.CloudListener { cloud, image -&gt;
          val directions = HomeFragmentDirections.actionHomeFragmentToCloudDetailsFragment(cloud)
  
          val extras = FragmentNavigatorExtras(
              image to &quot;image_big&quot;,
              )
          
          findNavController().navigate(
              directions,
              extras
          )
      }
  }
  </code></pre>
  <pre><code>class CloudDetailsFragment : Fragment(R.layout.fragment_cloud_details) {
  
      private var _binding: FragmentCloudDetailsBinding? = null
      private val binding: FragmentCloudDetailsBinding get() = _binding!!
      val args: CloudDetailsFragmentArgs by navArgs()
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          val animation = TransitionInflater.from(requireContext()).inflateTransition(
              android.R.transition.move
          )
          sharedElementEnterTransition = animation
          sharedElementReturnTransition = animation
      }
  
      override fun onCreateView(
          inflater: LayoutInflater, container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View {
          _binding = FragmentCloudDetailsBinding.inflate(inflater, container, false)
          return binding.root
      }
  
      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
          
          val cloudName = binding.textDetails
          cloudName.text = args.cloud.cloudName
  
          val cloudImage = binding.imageDetails
  
          Glide
              .with(this)
              .load(args.cloud.cloudImage)
              .centerCrop()
              .placeholder(R.drawable.ic_stat_name)
              .into(cloudImage)
  
      }
  }
  </code></pre>
  <pre><code>class GridAdapter(
      private val cloudList: List&lt;Cloud&gt;,
      private val clickListener: CloudListener
  ) : RecyclerView.Adapter&lt;GridAdapter.ViewHolder&gt;() {
  
      class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
  
          private val image: ImageView = view.findViewById(R.id.image_grid)!!
          private val text: TextView = view.findViewById(R.id.text_grid)
  
          fun bind(
              item: Cloud,
              clickListener: CloudListener
          ) {
  
              fun ImageView.load(imageAddress: String) {
                  Glide.with(this)
                      .load(imageAddress)
                      .centerCrop()
                      .placeholder(R.drawable.ic_stat_name)
                      .into(this)
              }
  
              image.load(item.cloudImage!!)
  
              text.text = item.cloudName
              itemView.setOnClickListener {
                  clickListener.onClick(item, image)
              }
          }
      }
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
          return ViewHolder(
              LayoutInflater.from(parent.context).inflate(
                  R.layout.grid_adapter,
                  parent,
                  false
              )
          )
      }
      
      override fun onBindViewHolder(holder: ViewHolder, position: Int) {
          val item = cloudList[position]
          holder.bind(item, clickListener)
      }
  
      override fun getItemCount(): Int {
          return cloudList.size
      }
  
      class CloudListener(val clickListener: (cloud: Cloud, image: ImageView) -&gt; Unit) {
          fun onClick(
              cloud: Cloud,
              image: ImageView
          ) = clickListener(cloud, image)
      }
  }
  </code></pre>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:padding=&quot;16dp&quot;&gt;
  
      &lt;ImageView
          android:id=&quot;@+id/imageView&quot;
          android:layout_width=&quot;112dp&quot;
          android:layout_height=&quot;112dp&quot;
          android:src=&quot;@drawable/iag_logo&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textView&quot;
          android:layout_width=&quot;0dp&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginStart=&quot;8dp&quot;
          android:text=&quot;Cloud Identifier&quot;
          android:textSize=&quot;48sp&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toEndOf=&quot;@+id/imageView&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
      &lt;androidx.recyclerview.widget.RecyclerView
          android:id=&quot;@+id/rv_grid&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;0dp&quot;
          android:orientation=&quot;vertical&quot;
          app:layoutManager=&quot;androidx.recyclerview.widget.GridLayoutManager&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toBottomOf=&quot;@+id/textView&quot;
          app:spanCount=&quot;2&quot;
          tools:listitem=&quot;@layout/grid_adapter&quot; /&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
      &lt;ImageView
          android:id=&quot;@+id/image_details&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;400dp&quot;
          android:transitionName=&quot;image_big&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/text_details&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_margin=&quot;16dp&quot;
  
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toBottomOf=&quot;@+id/image_details&quot; /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>