Merge "fix NPE when fragment container is null" into oc-dev
This commit is contained in:
@@ -1464,13 +1464,17 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
|
|||||||
} else {
|
} else {
|
||||||
final ViewGroup container = fragment.mContainer;
|
final ViewGroup container = fragment.mContainer;
|
||||||
final View animatingView = fragment.mView;
|
final View animatingView = fragment.mView;
|
||||||
container.startViewTransition(animatingView);
|
if (container != null) {
|
||||||
|
container.startViewTransition(animatingView);
|
||||||
|
}
|
||||||
// Delay the actual hide operation until the animation finishes, otherwise
|
// Delay the actual hide operation until the animation finishes, otherwise
|
||||||
// the fragment will just immediately disappear
|
// the fragment will just immediately disappear
|
||||||
anim.addListener(new AnimatorListenerAdapter() {
|
anim.addListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
container.endViewTransition(animatingView);
|
if (container != null) {
|
||||||
|
container.endViewTransition(animatingView);
|
||||||
|
}
|
||||||
animation.removeListener(this);
|
animation.removeListener(this);
|
||||||
animatingView.setVisibility(View.GONE);
|
animatingView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user