Skip to content

Commit a9ac6f2

Browse files
committed
remove platform-specified variable name
1 parent 0d9f504 commit a9ac6f2

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

index.js

+8-15
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,24 @@ const ScrollableTabView = createReactClass({
5757
getInitialState() {
5858
const containerWidth = Dimensions.get('window').width;
5959
let scrollValue;
60-
let scrollXIOS;
61-
let positionAndroid;
62-
let offsetAndroid;
60+
let scrollX;
6361

64-
scrollXIOS = new Animated.Value(this.props.initialPage * containerWidth);
62+
scrollX = new Animated.Value(this.props.initialPage * containerWidth);
6563
const containerWidthAnimatedValue = new Animated.Value(containerWidth);
6664
// Need to call __makeNative manually to avoid a native animated bug. See
6765
// https://github.com/facebook/react-native/pull/14435
6866
containerWidthAnimatedValue.__makeNative();
69-
scrollValue = Animated.divide(scrollXIOS, containerWidthAnimatedValue);
67+
scrollValue = Animated.divide(scrollX, containerWidthAnimatedValue);
7068

7169
const callListeners = this._polyfillAnimatedValue(scrollValue);
72-
scrollXIOS.addListener(
70+
scrollX.addListener(
7371
({ value, }) => callListeners(value / this.state.containerWidth)
7472
);
7573

7674
return {
7775
currentPage: this.props.initialPage,
7876
scrollValue,
79-
scrollXIOS,
80-
positionAndroid,
81-
offsetAndroid,
77+
scrollX,
8278
containerWidth,
8379
sceneKeys: this.newSceneKeys({ currentPage: this.props.initialPage, }),
8480
};
@@ -95,7 +91,7 @@ const ScrollableTabView = createReactClass({
9591
},
9692

9793
componentWillUnmount() {
98-
this.state.scrollXIOS.removeAllListeners();
94+
this.state.scrollX.removeAllListeners();
9995
},
10096

10197
goToPage(pageNumber) {
@@ -186,7 +182,7 @@ const ScrollableTabView = createReactClass({
186182
contentOffset={{ x: this.props.initialPage * this.state.containerWidth, }}
187183
ref={(scrollView) => { this.scrollView = scrollView; }}
188184
onScroll={Animated.event(
189-
[{ nativeEvent: { contentOffset: { x: this.state.scrollXIOS, }, }, }, ],
185+
[{ nativeEvent: { contentOffset: { x: this.state.scrollX, }, }, }, ],
190186
{ useNativeDriver: true, listener: this._onScroll, }
191187
)}
192188
onMomentumScrollBegin={this._onMomentumScrollBeginAndEnd}
@@ -266,7 +262,7 @@ const ScrollableTabView = createReactClass({
266262
// Need to call __makeNative manually to avoid a native animated bug. See
267263
// https://github.com/facebook/react-native/pull/14435
268264
containerWidthAnimatedValue.__makeNative();
269-
scrollValue = Animated.divide(this.state.scrollXIOS, containerWidthAnimatedValue);
265+
scrollValue = Animated.divide(this.state.scrollX, containerWidthAnimatedValue);
270266
this.setState({ containerWidth: width, scrollValue, });
271267

272268
this.requestAnimationFrame(() => {
@@ -326,7 +322,4 @@ const styles = StyleSheet.create({
326322
container: {
327323
flex: 1,
328324
},
329-
scrollableContentAndroid: {
330-
flex: 1,
331-
},
332325
});

0 commit comments

Comments
 (0)