Esempio n. 1
0
 componentDidMount: function() {
   this._handleSpringUpdate();
   this._emitDidFocus(this.state.routeStack[this.state.presentedIndex]);
   if (this.parentNavigator) {
     this.parentNavigator.setHandler(this._handleRequest);
   } else if (Platform.OS === 'android') {
     // There is no navigator in our props or context, so this is the
     // top-level navigator. We will handle back button presses here
     BackAndroid.addEventListener('hardwareBackPress', this._handleAndroidBackPress);
   }
 },
Esempio n. 2
0
 componentDidMount: function() {
   this.springSystem = new rebound.SpringSystem();
   this.spring = this.springSystem.createSpring();
   this.spring.setRestSpeedThreshold(0.05);
   var animationConfig = this.state.sceneConfigStack[this.state.presentedIndex];
   animationConfig && this._configureSpring(animationConfig);
   this.spring.addListener(this);
   this.onSpringUpdate();
   this._emitDidFocus(this.state.presentedIndex);
   if (this.parentNavigator) {
     this.parentNavigator.setHandler(this._handleRequest);
   } else {
     // There is no navigator in our props or context, so this is the
     // top-level navigator. We will handle back button presses here
     BackAndroid.addEventListener('hardwareBackPress', this._handleBackPress);
   }
 },
Esempio n. 3
0
 componentDidMount: function() {
   BackAndroid.addEventListener('hardwareBackPress', this.handleBackButton);
 },
Esempio n. 4
0
 componentWillMount() {
   BackAndroid.addEventListener('hardwareBackPress', this._handleBackButtonPress.bind(this));
 }