@@ -21,14 +21,14 @@ const ScrollableTabBar = require('./ScrollableTabBar');
2121
2222
2323const ScrollableTabView = React . createClass ( {
24- mixins : [ TimerMixin , ] ,
24+ mixins : [ TimerMixin , ] ,
2525 statics : {
2626 DefaultTabBar,
2727 ScrollableTabBar,
2828 } ,
2929
3030 propTypes : {
31- tabBarPosition : PropTypes . oneOf ( [ 'top' , 'bottom' , 'overlayTop' , 'overlayBottom' , ] ) ,
31+ tabBarPosition : PropTypes . oneOf ( [ 'top' , 'bottom' , 'overlayTop' , 'overlayBottom' , ] ) ,
3232 initialPage : PropTypes . number ,
3333 page : PropTypes . number ,
3434 onChangeTab : PropTypes . func ,
@@ -46,8 +46,8 @@ const ScrollableTabView = React.createClass({
4646 tabBarPosition : 'top' ,
4747 initialPage : 0 ,
4848 page : - 1 ,
49- onChangeTab : ( ) => { } ,
50- onScroll : ( ) => { } ,
49+ onChangeTab : ( ) => { } ,
50+ onScroll : ( ) => { } ,
5151 contentProps : { } ,
5252 scrollWithoutAnimation : false ,
5353 locked : false ,
@@ -65,7 +65,6 @@ const ScrollableTabView = React.createClass({
6565 } ,
6666
6767 componentDidMount ( ) {
68- //InteractionManager.runAfterInteractions(() => {
6968 setTimeout ( ( ) => {
7069 if ( this . scrollView && Platform . OS === 'android' ) {
7170 console . log ( "Scrolling to " + this . props . initialPage + " with containerWidth " + this . state . containerWidth ) ;
@@ -88,7 +87,7 @@ const ScrollableTabView = React.createClass({
8887 goToPage ( pageNumber ) {
8988 const offset = pageNumber * this . state . containerWidth ;
9089 if ( this . scrollView ) {
91- this . scrollView . scrollTo ( { x : offset , y : 0 , animated : ! this . props . scrollWithoutAnimation , } ) ;
90+ this . scrollView . scrollTo ( { x : offset , y : 0 , animated : ! this . props . scrollWithoutAnimation , } ) ;
9291 }
9392
9493 const currentPage = this . state . currentPage ;
@@ -108,9 +107,9 @@ const ScrollableTabView = React.createClass({
108107 }
109108 } ,
110109
111- updateSceneKeys ( { page, children = this . props . children , callback = ( ) => { } , } ) {
110+ updateSceneKeys ( { page, children = this . props . children , callback = ( ) => { } , } ) {
112111 let newKeys = this . newSceneKeys ( { previousKeys : this . state . sceneKeys , currentPage : page , children, } ) ;
113- this . setState ( { currentPage : page , sceneKeys : newKeys , } , callback ) ;
112+ this . setState ( { currentPage : page , sceneKeys : newKeys , } , callback ) ;
114113 } ,
115114
116115 newSceneKeys ( { previousKeys = [ ] , currentPage = 0 , children = this . props . children , } ) {
@@ -146,11 +145,11 @@ const ScrollableTabView = React.createClass({
146145 pagingEnabled
147146 automaticallyAdjustContentInsets = { false }
148147 contentOffset = { { x : this . props . initialPage * this . state . containerWidth , } }
149- ref = { ( scrollView ) => { this . scrollView = scrollView ; } }
148+ ref = { ( scrollView ) => { this . scrollView = scrollView ; } }
150149 onScroll = { ( e ) => {
151150 const offsetX = e . nativeEvent . contentOffset . x ;
152151 this . _updateScrollValue ( offsetX / this . state . containerWidth ) ;
153- } }
152+ } }
154153 onMomentumScrollBegin = { this . _onMomentumScrollBeginAndEnd }
155154 onMomentumScrollEnd = { this . _onMomentumScrollBeginAndEnd }
156155 scrollEventThrottle = { 16 }
@@ -172,9 +171,9 @@ const ScrollableTabView = React.createClass({
172171 return < SceneComponent
173172 key = { child . key }
174173 shouldUpdated = { this . _shouldRenderSceneKey ( idx , this . state . currentPage ) }
175- style = { { width : this . state . containerWidth , } }
176- >
177- { this . _keyExists ( this . state . sceneKeys , key ) ? child : < View tabLabel = { child . props . tabLabel } /> }
174+ style = { { width : this . state . containerWidth , } }
175+ >
176+ { this . _keyExists ( this . state . sceneKeys , key ) ? child : < View tabLabel = { child . props . tabLabel } /> }
178177 </ SceneComponent > ;
179178 } ) ;
180179 } ,
@@ -262,7 +261,7 @@ const ScrollableTabView = React.createClass({
262261 } ;
263262 }
264263
265- return < View style = { [ styles . container , this . props . style , ] } onLayout = { this . _handleLayout } >
264+ return < View style = { [ styles . container , this . props . style , ] } onLayout = { this . _handleLayout } >
266265 { this . props . tabBarPosition === 'top' && this . renderTabBar ( tabBarProps ) }
267266 { this . renderScrollableContent ( ) }
268267 { ( this . props . tabBarPosition === 'bottom' || overlayTabs ) && this . renderTabBar ( tabBarProps ) }
0 commit comments