-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.android.js
41 lines (38 loc) · 890 Bytes
/
index.android.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React, { Component } from 'react';
import ReactNative from 'react-native';
const { View,Text } = ReactNative;
import Viewport from './app/Viewport';
import Swiper from 'react-native-swiper';
class Scene extends Component {
constructor(props) {
super();
this.state = {
scrollEnabled: true
};
}
setScrollForSwiper (bool) {
this.setState({
scrollEnabled: bool
});
}
render () {
let arr = [0, 1, 2, 3, 4];
return (
<Swiper style={{flex: 1}} scrollEnabled={this.state.scrollEnabled}>
{
arr.map((item, i) => {
return (
<View style={{flex: 1}} key={i}>
<View style={{flex: 1}} ></View>
<Viewport style={{flex: 1}}
setScrollForSwiper={this.setScrollForSwiper.bind(this)}
gameId={i} />
</View>
)
})
}
</Swiper>
)
}
}
ReactNative.AppRegistry.registerComponent('DragAndDrop', () => Scene);