I am currently using a custom shared element transition for when I launch Activity B from activity A. Everything works perfectly.
I want to use another custom Transition that doesn't involve any shared elements for the return transition from activity B back to activity A. However, I am having trouble with several parts:
Appreciate any help I can get!
EDIT:
Further investigation revealed that my return transition's createAnimator isn't even being called even though I'm calling setSharedElementReturnTransition. But I know the set call is doing something because it now doesn't try to reverse the original enter animation (default behavior) and instead of just overlaps the two views.
EDIT #2:
After looking at George Mount's answer, I added
@Override
public void captureStartValues(TransitionValues transitionValues) {
transitionValues.view.setVisibility(View.VISIBLE);
}
@Override
public void captureEndValues(TransitionValues transitionValues) {
transitionValues.view.setVisibility(View.INVISIBLE);
}
This is now causing my return transition's createAnimator to at least run albeit the animation is still weird. Why does the visibility matter?
I actually found the culprit that was causing my return transition's createAnimator to not run. Apparently, if the transition framework thinks that the starting and ending states for the transitioning views are the same, it won't create an animator. Therefore, adding some dummy but different values into captureStartState and captureEndState finally caused my return transition to run properly.