Merge "Fix problem with empty AnimatorSet during fragment removal." into oc-mr1-dev

am: 465a956066

Change-Id: Ieb8f17d3b1c345f27298dd4e461eaa7b780543b7
This commit is contained in:
George Mount
2017-09-14 02:19:59 +00:00
committed by android-build-merger

View File

@@ -1380,8 +1380,13 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
@Override
public void onAnimationEnd(Animator anim) {
container.endViewTransition(view);
if (fragment.getAnimatingAway() != null) {
fragment.setAnimatingAway(null);
Animator animator = f.getAnimatingAway();
f.setAnimatingAway(null);
// If the animation finished immediately, the fragment's
// view will still be there. If so, we can just pretend
// there was no animation and skip the moveToState()
if (container.indexOfChild(view) == -1
&& animator != null) {
moveToState(fragment, fragment.getStateAfterAnimating(),
0, 0, false);
}