@@ -494,6 +494,7 @@ var Navigator = React.createClass({
494494
495495 _completeTransition : function ( ) {
496496 if ( this . spring . getCurrentValue ( ) === 1 ) {
497+ this . _onAnimationEnd ( ) ;
497498 var presentedIndex = this . state . toIndex ;
498499 this . state . presentedIndex = presentedIndex ;
499500 this . state . fromIndex = presentedIndex ;
@@ -515,6 +516,7 @@ var Navigator = React.createClass({
515516 // For visual consistency, the from index is always used to configure the spring
516517 this . state . sceneConfigStack [ this . state . fromIndex ]
517518 ) ;
519+ this . _onAnimationStart ( ) ;
518520 this . state . isAnimating = true ;
519521 this . spring . setVelocity ( v ) ;
520522 this . spring . setEndValue ( 1 ) ;
@@ -573,6 +575,34 @@ var Navigator = React.createClass({
573575 }
574576 } ,
575577
578+ _onAnimationStart : function ( ) {
579+ this . _setRenderSceneToHarwareTextureAndroid ( this . state . fromIndex , true ) ;
580+ this . _setRenderSceneToHarwareTextureAndroid ( this . state . toIndex , true ) ;
581+
582+ var navBar = this . _navBar ;
583+ if ( navBar && navBar . onAnimationStart ) {
584+ navBar . onAnimationStart ( this . state . fromIndex , this . state . toIndex ) ;
585+ }
586+ } ,
587+
588+ _onAnimationEnd : function ( ) {
589+ this . _setRenderSceneToHarwareTextureAndroid ( this . state . fromIndex , false ) ;
590+ this . _setRenderSceneToHarwareTextureAndroid ( this . state . toIndex , false ) ;
591+
592+ var navBar = this . _navBar ;
593+ if ( navBar && navBar . onAnimationEnd ) {
594+ navBar . onAnimationEnd ( this . state . fromIndex , this . state . toIndex ) ;
595+ }
596+ } ,
597+
598+ _setRenderSceneToHarwareTextureAndroid : function ( sceneIndex , shouldRenderToHardwareTexture ) {
599+ var viewAtIndex = this . refs [ 'scene_' + sceneIndex ] ;
600+ if ( viewAtIndex === null || viewAtIndex === undefined ) {
601+ return ;
602+ }
603+ viewAtIndex . setNativeProps ( { renderToHardwareTextureAndroid : shouldRenderToHardwareTexture } ) ;
604+ } ,
605+
576606 /**
577607 * Becomes the responder on touch start (capture) while animating so that it
578608 * blocks all touch interactions inside of it. However, this responder lock
@@ -610,6 +640,7 @@ var Navigator = React.createClass({
610640 this . state . fromIndex = this . state . presentedIndex ;
611641 var gestureSceneDelta = this . _deltaForGestureAction ( this . _activeGestureAction ) ;
612642 this . state . toIndex = this . state . presentedIndex + gestureSceneDelta ;
643+ this . onAnimationStart ( ) ;
613644 }
614645 } ,
615646
0 commit comments