Skip to content

Commit 29bea02

Browse files
committed
update Example to RN-0.55.4
1 parent eb219f1 commit 29bea02

39 files changed

+7385
-8115
lines changed

Example/.flowconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,5 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*
5050
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5151
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5252

53-
unsafe.enable_getters_and_setters=true
54-
5553
[version]
56-
^0.61.0
54+
^0.67.0

Example/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ buck-out/
5151
*/fastlane/report.xml
5252
*/fastlane/Preview.html
5353
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle

Example/App.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export default class App extends Component {
3333
this.onRecognizerError = this.onRecognizerError.bind(this);
3434
this.onRecognizerVolumeChanged = this.onRecognizerVolumeChanged.bind(this);
3535
this.onSyntheBtnPress = this.onSyntheBtnPress.bind(this);
36+
this.onIsSpeakingBtnPress = this.onIsSpeakingBtnPress.bind(this);
37+
this.onResumeBtnPress = this.onResumeBtnPress.bind(this);
3638
}
3739

3840
componentDidMount() {
@@ -69,6 +71,15 @@ export default class App extends Component {
6971
<Button containerStyle={styles.containerStyle} style={{ color: "white" }} onPress={this.onSyntheBtnPress} activeOpacity={0.8}>
7072
Tap to speak
7173
</Button>
74+
<Button containerStyle={styles.containerStyle} style={{ color: "white" }} onPress={this.onIsSpeakingBtnPress} activeOpacity={0.8}>
75+
is Speaking?
76+
</Button>
77+
<Button containerStyle={styles.containerStyle} style={{ color: "white" }} onPress={this.onPauseBtnPress} activeOpacity={0.8}>
78+
Pause
79+
</Button>
80+
<Button containerStyle={styles.containerStyle} style={{ color: "white" }} onPress={this.onResumeBtnPress} activeOpacity={0.8}>
81+
Resume
82+
</Button>
7283
</View>
7384
);
7485
}
@@ -111,6 +122,19 @@ export default class App extends Component {
111122
Synthesizer.start(this.state.text);
112123
}
113124

125+
async onPauseBtnPress() {
126+
Synthesizer.pause();
127+
}
128+
129+
onResumeBtnPress() {
130+
Synthesizer.resume();
131+
}
132+
133+
async onIsSpeakingBtnPress() {
134+
let isSpeaking = await Synthesizer.isSpeaking();
135+
alert(isSpeaking);
136+
}
137+
114138
onSynthesizerSpeakCompletedEvent(result) {
115139
alert('onSynthesizerSpeakCompletedEvent\n\n' + JSON.stringify(result));
116140
}

Example/__tests__/App.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

Example/android/app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example"
3-
android:versionCode="1"
4-
android:versionName="1.0">
2+
package="com.example">
53

64
<uses-permission android:name="android.permission.INTERNET" />
75
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
86

9-
<uses-sdk
10-
android:minSdkVersion="16"
11-
android:targetSdkVersion="22" />
7+
<!-- 讯飞语音需要,部分为可选,详见讯飞文档 -->
8+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
9+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
10+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
11+
<!--读取网络信息状态 -->
12+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
13+
<!--获取当前wifi状态 -->
14+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
15+
<!--允许程序改变网络连接状态 -->
16+
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
17+
<!--读取手机信息权限 -->
18+
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
19+
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
1220

1321
<application
1422
android:name=".MainApplication"
15-
android:allowBackup="true"
1623
android:label="@string/app_name"
1724
android:icon="@mipmap/ic_launcher"
25+
android:allowBackup="false"
1826
android:theme="@style/AppTheme">
1927
<activity
2028
android:name=".MainActivity"

Example/ios/Example.xcodeproj/project.pbxproj

Lines changed: 204 additions & 192 deletions
Large diffs are not rendered by default.

Example/ios/Example/AppDelegate.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
#import <UIKit/UIKit.h>

Example/ios/Example/AppDelegate.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
#import "AppDelegate.h"

Example/ios/Example/main.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
#import <UIKit/UIKit.h>

Example/ios/ExampleTests/ExampleTests.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
#import <UIKit/UIKit.h>

0 commit comments

Comments
 (0)