-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorSeekbarNative.js
More file actions
43 lines (36 loc) · 1003 Bytes
/
ColorSeekbarNative.js
File metadata and controls
43 lines (36 loc) · 1003 Bytes
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
42
43
import React, {
Component,
StyleSheet,
processColor,
requireNativeComponent,
PropTypes,
View,
Event,
Text,
} from 'react-native';
class ColorSeekbarNative extends Component {
constructor(props) {
super(props);
this.state= {
value: 0,
};
}
_onChange(event) {
this.state.value = event.nativeEvent.progress;
}
render() {
var { style, color} = this.props;
return (
<View style={style}>
<ColorSeekbarAndroid
onChange={this._onChange.bind((this))}
style={{flex: 1, alignSelf: 'stretch', width: 200}}
color={[color].map(processColor)}
/>
<Text style={{color: this.state.colorBottom, flex: 2}}>React: {this.state.value}</Text>
</View>
);
}
}
var ColorSeekbarAndroid = requireNativeComponent('ColorSeekBar', null);
module.exports = ColorSeekbarNative;