Merge "fix NPE when fragment container is null" into oc-dev am: 38eae1bb15

am: 01c9ed8b7e

Change-Id: Ie497c5446752410af84745c0f9a93cc60f26fc4c
This commit is contained in:
George Mount
2017-04-20 20:53:19 +00:00
committed by android-build-merger

View File

@@ -1464,13 +1464,17 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
} else {
final ViewGroup container = fragment.mContainer;
final View animatingView = fragment.mView;
container.startViewTransition(animatingView);
if (container != null) {
container.startViewTransition(animatingView);
}
// Delay the actual hide operation until the animation finishes, otherwise
// the fragment will just immediately disappear
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
container.endViewTransition(animatingView);
if (container != null) {
container.endViewTransition(animatingView);
}
animation.removeListener(this);
animatingView.setVisibility(View.GONE);
}