shared-element-transition
Shared element activity transition on android 5
I encounter the same issue, and notice the crash happens if the original shared element is no longer visible on the previous screen when you go back (probably it is the last element on screen in portrait, but once switched to landscape it’s no longer visible), and thus the transition has nowhere to put back … Read more
How to know when Shared Element Transition ends
Did you try to bind animation listener to the shared element view inside onMapSharedElements? ViewCompat.animate(view) will give you either a new or cached ViewPropertyAnimator(Compat) and then binding the animation listener should be trivial. I haven’t tried it, though. setEnterSharedElementCallback(new SharedElementCallback() { @Override public void onMapSharedElements(List<String> names, Map<String, View> sharedElements) { super.onMapSharedElements(names, sharedElements); View keySharedElementView = … Read more
Fragment shared element transition with add() instead of replace()?
Try this getSupportFragmentManager().beginTransaction() .addSharedElement(myImage, “mytransition”) .add(R.id.recycler_view_container, myFragment2) .hide(myFragment1) commit(); worked for me
FEATURE_ACTIVITY_TRANSITIONS vs. FEATURE_CONTENT_TRANSITIONS
I’m glad I have an opportunity to answer these questions as the documentation is less than clear. Early-on, there was one flag FEATURE_CONTENT_TRANSITIONS that handled both of the features. We split them when Material applications got unexpected behavior when it was enabled. So some older documentation may still say that you have to enable FEATURE_CONTENT_TRANSITIONS … Read more
Crash in Activity Transitions with SharedElement
Try to get fragment from FragmentManager: fragmentManager.findFragmentByTag(“android:switcher:” + R.id.viewPager + “:” + position) If fragment is null, try creating a new fragment.
Blinking screen on image transition between activities
On the exiting activity, call getWindow().setExitTransition(null); On the entering activity, call getWindow().setEnterTransition(null); It will prevent the fade out of the exiting activity and the fade in of the entering activity, which removes the apparent blinking effect.