@@ -71,101 +71,98 @@ var SampleNavigationBarRouteMapper = {
7171 }
7272} ;
7373
74- var SampleRouteMapper = {
74+ var _delay = 400 ; // Just to test for race conditions with native nav.
7575
76- delay : 400 , // Just to test for race conditions with native nav.
77-
78- navigationItemForRoute : function ( route , navigationOperations ) {
79- var content = route . content ;
80- return (
81- < ScrollView >
82- < View style = { styles . scene } >
83- < TouchableBounce
84- onPress = { this . _pushRouteLater ( navigationOperations . push ) } >
85- < View style = { styles . button } >
86- < Text style = { styles . buttonText } > request push soon</ Text >
87- </ View >
88- </ TouchableBounce >
89- < TouchableBounce
90- onPress = { this . _pushRouteLater ( navigationOperations . replace ) } >
91- < View style = { styles . button } >
92- < Text > { content } </ Text >
93- </ View >
94- </ TouchableBounce >
95- < TouchableBounce
96- onPress = { this . _pushRouteLater ( navigationOperations . replace ) } >
97- < View style = { styles . button } >
98- < Text > { content } </ Text >
99- </ View >
100- </ TouchableBounce >
101- < TouchableBounce
102- onPress = { this . _pushRouteLater ( navigationOperations . replace ) } >
103- < View style = { styles . button } >
104- < Text > { content } </ Text >
105- </ View >
106- </ TouchableBounce >
107- < TouchableBounce
108- onPress = { this . _pushRouteLater ( navigationOperations . replace ) } >
109- < View style = { styles . button } >
110- < Text > { content } </ Text >
111- </ View >
112- </ TouchableBounce >
113- < TouchableBounce
114- onPress = { this . _pushRouteLater ( navigationOperations . replace ) } >
115- < View style = { styles . button } >
116- < Text > { content } </ Text >
117- </ View >
118- </ TouchableBounce >
119- < TouchableBounce
120- onPress = { this . _popRouteLater ( navigationOperations . pop ) } >
121- < View style = { styles . button } >
122- < Text style = { styles . buttonText } > request pop soon</ Text >
123- </ View >
124- </ TouchableBounce >
125- < TouchableBounce
126- onPress = {
127- this . _immediatelySetTwoItemsLater (
128- navigationOperations . immediatelyResetRouteStack
129- )
130- } >
131- < View style = { styles . button } >
132- < Text style = { styles . buttonText } > Immediate set two routes</ Text >
133- </ View >
134- </ TouchableBounce >
135- < TouchableBounce
136- onPress = { this . _popToTopLater ( navigationOperations . popToTop ) } >
137- < View style = { styles . button } >
138- < Text style = { styles . buttonText } > pop to top soon</ Text >
139- </ View >
140- </ TouchableBounce >
141- </ View >
142- </ ScrollView >
143- ) ;
144- } ,
76+ var renderScene = function ( route , navigationOperations ) {
77+ var content = route . content ;
78+ return (
79+ < ScrollView >
80+ < View style = { styles . scene } >
81+ < TouchableBounce
82+ onPress = { _pushRouteLater ( navigationOperations . push ) } >
83+ < View style = { styles . button } >
84+ < Text style = { styles . buttonText } > request push soon</ Text >
85+ </ View >
86+ </ TouchableBounce >
87+ < TouchableBounce
88+ onPress = { _pushRouteLater ( navigationOperations . replace ) } >
89+ < View style = { styles . button } >
90+ < Text > { content } </ Text >
91+ </ View >
92+ </ TouchableBounce >
93+ < TouchableBounce
94+ onPress = { _pushRouteLater ( navigationOperations . replace ) } >
95+ < View style = { styles . button } >
96+ < Text > { content } </ Text >
97+ </ View >
98+ </ TouchableBounce >
99+ < TouchableBounce
100+ onPress = { _pushRouteLater ( navigationOperations . replace ) } >
101+ < View style = { styles . button } >
102+ < Text > { content } </ Text >
103+ </ View >
104+ </ TouchableBounce >
105+ < TouchableBounce
106+ onPress = { _pushRouteLater ( navigationOperations . replace ) } >
107+ < View style = { styles . button } >
108+ < Text > { content } </ Text >
109+ </ View >
110+ </ TouchableBounce >
111+ < TouchableBounce
112+ onPress = { _pushRouteLater ( navigationOperations . replace ) } >
113+ < View style = { styles . button } >
114+ < Text > { content } </ Text >
115+ </ View >
116+ </ TouchableBounce >
117+ < TouchableBounce
118+ onPress = { _popRouteLater ( navigationOperations . pop ) } >
119+ < View style = { styles . button } >
120+ < Text style = { styles . buttonText } > request pop soon</ Text >
121+ </ View >
122+ </ TouchableBounce >
123+ < TouchableBounce
124+ onPress = {
125+ _immediatelySetTwoItemsLater (
126+ navigationOperations . immediatelyResetRouteStack
127+ )
128+ } >
129+ < View style = { styles . button } >
130+ < Text style = { styles . buttonText } > Immediate set two routes</ Text >
131+ </ View >
132+ </ TouchableBounce >
133+ < TouchableBounce
134+ onPress = { _popToTopLater ( navigationOperations . popToTop ) } >
135+ < View style = { styles . button } >
136+ < Text style = { styles . buttonText } > pop to top soon</ Text >
137+ </ View >
138+ </ TouchableBounce >
139+ </ View >
140+ </ ScrollView >
141+ ) ;
142+ } ;
145143
146- _popToTopLater : function ( popToTop ) {
147- return ( ) => setTimeout ( popToTop , SampleRouteMapper . delay ) ;
148- } ,
144+ var _popToTopLater = function ( popToTop ) {
145+ return ( ) => setTimeout ( popToTop , _delay ) ;
146+ } ;
149147
150- _pushRouteLater : function ( push ) {
151- return ( ) => setTimeout (
152- ( ) => push ( _getRandomRoute ( ) ) ,
153- SampleRouteMapper . delay
154- ) ;
155- } ,
148+ var _pushRouteLater = function ( push ) {
149+ return ( ) => setTimeout (
150+ ( ) => push ( _getRandomRoute ( ) ) ,
151+ _delay
152+ ) ;
153+ } ;
156154
157- _immediatelySetTwoItemsLater : function ( immediatelyResetRouteStack ) {
158- return ( ) => setTimeout (
159- ( ) => immediatelyResetRouteStack ( [
160- _getRandomRoute ( ) ,
161- _getRandomRoute ( ) ,
162- ] )
163- ) ;
164- } ,
155+ var _immediatelySetTwoItemsLater = function ( immediatelyResetRouteStack ) {
156+ return ( ) => setTimeout (
157+ ( ) => immediatelyResetRouteStack ( [
158+ _getRandomRoute ( ) ,
159+ _getRandomRoute ( ) ,
160+ ] )
161+ ) ;
162+ } ;
165163
166- _popRouteLater : function ( pop ) {
167- return ( ) => setTimeout ( pop , SampleRouteMapper . delay ) ;
168- } ,
164+ var _popRouteLater = function ( pop ) {
165+ return ( ) => setTimeout ( pop , _delay ) ;
169166} ;
170167
171168var BreadcrumbNavSample = React . createClass ( {
@@ -194,7 +191,7 @@ var BreadcrumbNavSample = React.createClass({
194191 debugOverlay = { false }
195192 style = { [ styles . appContainer ] }
196193 initialRoute = { initialRoute }
197- routeMapper = { SampleRouteMapper }
194+ renderScene = { renderScene }
198195 navigationBar = {
199196 < BreadcrumbNavigationBar
200197 navigationBarRouteMapper = { SampleNavigationBarRouteMapper }
@@ -212,7 +209,7 @@ var BreadcrumbNavSample = React.createClass({
212209 debugOverlay = { false }
213210 style = { [ styles . appContainer ] }
214211 initialRoute = { initialRoute }
215- routeMapper = { SampleRouteMapper }
212+ renderScene = { renderScene }
216213 navigationBar = {
217214 < BreadcrumbNavigationBar
218215 navigationBarRouteMapper = { SampleNavigationBarRouteMapper }
0 commit comments