-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.android.js
55 lines (45 loc) · 1.18 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var ReactPropTypes = require('ReactPropTypes');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var SeekBar = React.createClass({
propTypes: {
/**
* Used to locate this view in end-to-end tests.
*/
testID: ReactPropTypes.string,
onChange: ReactPropTypes.func,
progress: ReactPropTypes.number,
max: ReactPropTypes.number
},
_onChange: function(event) {
if(!this.props.onChange) {
return;
}
this.props.onChange(event.nativeEvent.progress);
},
getDefaultProps: function() {
return {
progress: 50,
max: 100
};
},
mixins: [NativeMethodsMixin],
render: function() {
return <AndroidSeekBar {...this.props} onChange={this._onChange}/>;
},
});
var AndroidSeekBar = createReactNativeComponentClass({
validAttributes: {
...ReactNativeViewAttributes.UIView,
progress: true,
max: true
},
uiViewClassName: 'RNSeekBar',
propTypes: {
nativeOnly: {onChange: true}
}
});
module.exports = SeekBar;