I am trying to implement some of the new Material Design activity animations, but the tutorials that I read show only examples in which the animated presentation refers to the activity.
In my application, I use RecyclerView , so ImageView not part of the activity:
MainActivity -> Where I call startActivity() ↳ MainFragment ↳ RecyclerView ↳ RecyclerViewAdapter ↳ ViewHolder ↳ ImageView -> The hero imageView I'd like to animate
From what I read, I have to start a new activity as follows:
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, (View) mImageView, "hero_image"); Intent intent = new Intent(this, SecondActivity.class); startActivityForResult(intent, options.toBundle());
The question is that mImageView does not belong to MainActivity . How should I pass it on?
source share