-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
51 lines (46 loc) · 1.37 KB
/
index.js
File metadata and controls
51 lines (46 loc) · 1.37 KB
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
import React, {Component, PropTypes} from 'react';
import {View, requireNativeComponent,NativeModules} from 'react-native';
const { RecordView } = NativeModules;
export class RCTTimerTip extends Component {
render() {
return (
<TimerTip
{...this.props}
/>);
}
}
RCTTimerTip.propTypes = {
...View.propTypes,
level:PropTypes.string,
time:PropTypes.string,
numFontSize:PropTypes.string,
status:PropTypes.string,//0正在录音,1,取消发送,2,录音时间过短
};
const TimerTip = requireNativeComponent('TimerTip', RCTTimerTip);
export class RCTRecordView extends Component {
/**
* 时间过长后,调用该方法恢复按钮为未点击状态
*/
static setButtonStateWithNormal(){
return RecordView.setButtonStateWithNormal();
}
_onchange = (event) => {
if (this.props.onChange && event.nativeEvent) {
this.props.onChange(event.nativeEvent);
}
}
render() {
return (
<RecordViewApi
{...this.props}
onChange={this._onchange}
/>);
}
}
RCTRecordView.propTypes = {
...View.propTypes,
textArr: PropTypes.arrayOf(PropTypes.string),
onChange: PropTypes.func,
fontSize: PropTypes.string,
};
const RecordViewApi = requireNativeComponent('RecordView', RCTRecordView);