|  | @@ -6,7 +6,6 @@ import android.util.AttributeSet;
 | 
	
		
			
			| 6 | 6 |  import android.widget.FrameLayout;
 | 
	
		
			
			| 7 | 7 |  
 | 
	
		
			
			| 8 | 8 |  import com.facebook.react.ReactInstanceManager;
 | 
	
		
			
			| 9 |  | -import com.facebook.react.ReactRootView;
 | 
	
		
			
			| 10 | 9 |  import com.reactnativenavigation.activities.BaseReactActivity;
 | 
	
		
			
			| 11 | 10 |  import com.reactnativenavigation.core.RctManager;
 | 
	
		
			
			| 12 | 11 |  import com.reactnativenavigation.core.objects.Screen;
 | 
	
	
		
			
			|  | @@ -18,6 +17,8 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
 | 
	
		
			
			| 18 | 17 |  
 | 
	
		
			
			| 19 | 18 |  public class ScreenStack extends FrameLayout {
 | 
	
		
			
			| 20 | 19 |  
 | 
	
		
			
			|  | 20 | +    private static final int DISAPPEAR_ANIMATION_DELAY = 200;
 | 
	
		
			
			|  | 21 | +
 | 
	
		
			
			| 21 | 22 |      private static class ScreenView {
 | 
	
		
			
			| 22 | 23 |          Screen screen;
 | 
	
		
			
			| 23 | 24 |          RctView view;
 | 
	
	
		
			
			|  | @@ -53,16 +54,17 @@ public class ScreenStack extends FrameLayout {
 | 
	
		
			
			| 53 | 54 |      }
 | 
	
		
			
			| 54 | 55 |  
 | 
	
		
			
			| 55 | 56 |      public void push(Screen screen, RctView.OnDisplayedListener onDisplayed) {
 | 
	
		
			
			| 56 |  | -        RctView oldView = null;
 | 
	
		
			
			| 57 |  | -        if (!mStack.isEmpty()) {
 | 
	
		
			
			| 58 |  | -            oldView = mStack.peek().view;
 | 
	
		
			
			| 59 |  | -        }
 | 
	
		
			
			|  | 57 | +        RctView oldView = mStack.isEmpty() ? null : mStack.peek().view;
 | 
	
		
			
			| 60 | 58 |          RctView view = new RctView(mReactActivity, mReactInstanceManager, screen, onDisplayed);
 | 
	
		
			
			| 61 |  | -        addView(view, MATCH_PARENT, MATCH_PARENT);
 | 
	
		
			
			| 62 | 59 |          if (oldView != null) {
 | 
	
		
			
			| 63 |  | -            ReactRootView reactRootView = oldView.getReactRootView();
 | 
	
		
			
			| 64 |  | -            ReflectionUtils.setBooleanField(reactRootView, "mAttachScheduled", true);
 | 
	
		
			
			|  | 60 | +            addView(view, MATCH_PARENT, MATCH_PARENT);
 | 
	
		
			
			|  | 61 | +
 | 
	
		
			
			|  | 62 | +            ReflectionUtils.setBooleanField(oldView.getReactRootView(), "mAttachScheduled", true);
 | 
	
		
			
			|  | 63 | +            getLayoutTransition().setStartDelay(LayoutTransition.DISAPPEARING, DISAPPEAR_ANIMATION_DELAY);
 | 
	
		
			
			| 65 | 64 |              removeView(oldView);
 | 
	
		
			
			|  | 65 | +            getLayoutTransition().setStartDelay(LayoutTransition.DISAPPEARING, 0);
 | 
	
		
			
			|  | 66 | +        } else {
 | 
	
		
			
			|  | 67 | +            addView(view, MATCH_PARENT, MATCH_PARENT);
 | 
	
		
			
			| 66 | 68 |          }
 | 
	
		
			
			| 67 | 69 |          mStack.push(new ScreenView(screen, view));
 | 
	
		
			
			| 68 | 70 |      }
 | 
	
	
		
			
			|  | @@ -99,7 +101,7 @@ public class ScreenStack extends FrameLayout {
 | 
	
		
			
			| 99 | 101 |              addView(mStack.peek().view, 0);
 | 
	
		
			
			| 100 | 102 |          }
 | 
	
		
			
			| 101 | 103 |  
 | 
	
		
			
			| 102 |  | -        return oldScreenView.screen;
 | 
	
		
			
			|  | 104 | +        return oldScreenView != null ? oldScreenView.screen : null;
 | 
	
		
			
			| 103 | 105 |      }
 | 
	
		
			
			| 104 | 106 |  
 | 
	
		
			
			| 105 | 107 |      public Screen resetTo(Screen screen) {
 |