I am trying to transition an ImageView from an item within my RecyclerView inside a fragment to an Activity. I have declared the following in my
styles.xml
<!-- enable window content transitions -->
<item name="android:windowActivityTransitions">true</item>
<!-- specify enter and exit transitions -->
<!-- options are: explode, slide, fade -->
<item name="android:windowEnterTransition">@transition/change_image_transform</item>
<item name="android:windowExitTransition">@transition/change_image_transform</item>
<!-- specify shared element transitions -->
<item name="android:windowSharedElementEnterTransition">
@transition/change_image_transform
</item>
<item name="android:windowSharedElementExitTransition">
@transition/change_image_transform
</item>
Then in my
Recyclerview Adapter
I am starting the activity using
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
{
ActivityOptionsCompat options = ActivityOptionsCompat.MakeSceneTransitionAnimation((Activity)Context, pec.View, "profile");
Context.StartActivity(intent, options.ToBundle());
}
I have defined both ImageViews with the
transitionName="profile"
and also have a
transition/change_image_transform.xml
that looks like
<?xml version="1.0" encoding="utf-8" ?>
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<changeImageTransform/>
</transitionSet>
There are no errors, just no transition takes place between my item in the recyclerview and the activity.