Compare commits
5 Commits
20adea0533
...
8ce4133e50
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ce4133e50 | |||
| 05b8ddf0fd | |||
| 61a9adab5e | |||
| 50a191f675 | |||
| bbd9a7e85c |
10
.idea/jarRepositories.xml
generated
10
.idea/jarRepositories.xml
generated
@ -31,5 +31,15 @@
|
||||
<option name="name" value="maven2" />
|
||||
<option name="url" value="https://maven.aliyun.com/repository/jcenter/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@ -3,8 +3,8 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "30.0.2"
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "chaoran.business.pda"
|
||||
|
||||
Binary file not shown.
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="chaoran.business">
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -7,6 +7,7 @@ import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@ -32,11 +33,11 @@ import chaoran.business.engine.VoiceEngine;
|
||||
/**
|
||||
* 提供文字转语音功能,实时播报PDA状态
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity implements ResultListener {
|
||||
public class MainActivity extends AppCompatActivity implements ResultListener{
|
||||
|
||||
private WebView webView;
|
||||
private Adapter adapter;
|
||||
private VoiceEngine voiceEngine;
|
||||
//private VoiceEngine voiceEngine;
|
||||
private SettingEngine settingEngine;
|
||||
private ProgressBar progressBar;
|
||||
private ActionBar actionBar;
|
||||
@ -48,11 +49,13 @@ public class MainActivity extends AppCompatActivity implements ResultListener {
|
||||
setContentView(R.layout.activity_main);
|
||||
initView();
|
||||
initData();
|
||||
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
BrandEnum brand = BrandEnum.code(Build.MANUFACTURER);
|
||||
Toast.makeText(this, Build.MANUFACTURER, Toast.LENGTH_LONG).show();
|
||||
Log.i("brand===",brand.toString());
|
||||
switch (brand) {
|
||||
case UROBO:
|
||||
adapter = new UroBoAdapter(this, this);
|
||||
@ -75,7 +78,7 @@ public class MainActivity extends AppCompatActivity implements ResultListener {
|
||||
@SuppressLint("JavascriptInterface")
|
||||
private void initView() {
|
||||
actionBar = getSupportActionBar();
|
||||
voiceEngine = new TekVoiceEngine(this);
|
||||
// voiceEngine = new TekVoiceEngine(this);
|
||||
settingEngine = new NetworkSettingEngine(this);
|
||||
webView = findViewById(R.id.webView);
|
||||
progressBar = findViewById(R.id.loading);
|
||||
@ -85,7 +88,7 @@ public class MainActivity extends AppCompatActivity implements ResultListener {
|
||||
//设置接口进行windows暴露
|
||||
settings.setDomStorageEnabled(true);
|
||||
//语音引擎
|
||||
webView.addJavascriptInterface(voiceEngine, "TekVoiceEngine");
|
||||
// webView.addJavascriptInterface(voiceEngine, "TekVoiceEngine");
|
||||
//网络设置展示
|
||||
webView.addJavascriptInterface(settingEngine, "NetworkSettingEngine");
|
||||
//重新加载页面
|
||||
@ -160,8 +163,8 @@ public class MainActivity extends AppCompatActivity implements ResultListener {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
//再次唤醒该页面时,重新加载页面和语音配置
|
||||
webView.loadUrl(url());
|
||||
voiceEngine.reload();
|
||||
//webView.loadUrl(url());
|
||||
// voiceEngine.reload();
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:max="200"
|
||||
android:min="100"
|
||||
android:min="0"
|
||||
android:id="@+id/voice_speed" />
|
||||
|
||||
<TextView />
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<string name="title_activity_main">主页</string>
|
||||
|
||||
<!-- 讯飞离线语音appid-->
|
||||
<string name="app_id">601c9ec6</string>
|
||||
<string name="app_id">602e1727</string>
|
||||
|
||||
<!-- 讯飞离线语音弹出框格式-->
|
||||
<string name="tts_toast_format" formatted="false">缓冲进度为%d%%,播放进度为%d%%</string>
|
||||
|
||||
Reference in New Issue
Block a user