Commit a376de32 by cuiliang.shi

v0.1

1 parent 5172eec3
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
signingConfigs {
debug {
storeFile file('F:\\Cuiliang.shi\\android\\turingos\\turingos.jks')
storePassword 'agenewturing'
keyAlias = 'turingos'
keyPassword 'agenewturing'
}
}
compileSdkVersion 25 compileSdkVersion 25
buildToolsVersion '28' buildToolsVersion '28'
defaultConfig { defaultConfig {
...@@ -17,8 +25,6 @@ android { ...@@ -17,8 +25,6 @@ android {
} }
lintOptions { lintOptions {
abortOnError false abortOnError false
} }
......
The file could not be displayed because it is too large.
The file could not be displayed because it is too large.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
<application <application
android:persistent="true"
android:allowBackup="true" android:allowBackup="true"
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
......
...@@ -234,8 +234,14 @@ public class Base { ...@@ -234,8 +234,14 @@ public class Base {
setTTSListener(ttsClientListener); setTTSListener(ttsClientListener);
setActionBo(true, true); setActionBo(true, true);
if(AsrManager.getInstance().isRecording()){
AsrManager.getInstance().stop(); AsrManager.getInstance().stop();
}
if (TTSManager.getInstance().isSpeaking()){
TTSManager.getInstance().stopTTS(); TTSManager.getInstance().stopTTS();
}
record(); record();
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#880E0E0E" android:background="#880E0E0E">
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingRight="10dp" android:paddingRight="10dp">
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" > android:layout_margin="10dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -33,8 +34,9 @@ ...@@ -33,8 +34,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="top|left" android:editable="false"
android:focusable="false" android:focusable="false"
android:gravity="top|left"
android:hint="" android:hint=""
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:textSize="20sp" /> android:textSize="20sp" />
...@@ -43,19 +45,19 @@ ...@@ -43,19 +45,19 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="10dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="2dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="horizontal" > android:orientation="horizontal">
<Button <Button
android:clickable="true"
android:id="@+id/iat_recognize" android:id="@+id/iat_recognize"
android:layout_width="45dp" android:layout_width="45dp"
android:layout_height="49dp" android:layout_height="49dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/selector_record_bg" android:background="@drawable/selector_record_bg"
android:clickable="true"
android:focusable="true" android:focusable="true"
android:textSize="20sp" /> android:textSize="20sp" />
...@@ -64,96 +66,102 @@ ...@@ -64,96 +66,102 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="2dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="horizontal" > android:orientation="horizontal">
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout
android:gravity="center"
android:id="@+id/ai_music" android:id="@+id/ai_music"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/music_background"> android:gravity="center"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:background="@drawable/dialog_background">
<com.toscl.turingos.view.PlayView <com.toscl.turingos.view.PlayView
android:layout_width="wrap_content"
android:id="@+id/playview" android:id="@+id/playview"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_rowWeight="1" android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:clickable="true"
android:focusable="true"
android:onClick="play" android:onClick="play"
android:padding="10dp" android:padding="10dp"
android:layout_gravity="center"
android:rotation="180" android:rotation="180"
android:clickable="true"
android:focusable="true"
app:checked="true" app:checked="true"
app:pauseLineColor="@color/colorAccent" app:pauseLineColor="@color/color_3"
app:pauseLineDistance="18dp" app:pauseLineDistance="18dp"
app:pauseLineHeight="45dp" app:pauseLineHeight="45dp"
app:pauseLineWidth="8dp" app:pauseLineWidth="10dp"
app:radius="50dp" app:radius="50dp"
app:solidColor="@color/colorAccent" app:solidColor="@color/color_3"
app:triangleColor="@color/colorAccent" app:strokeWidth="10dp"
app:triangleColor="@color/color_3"
app:triangleHeight="40dp" /> app:triangleHeight="40dp" />
</LinearLayout>
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/ai_bg" android:id="@+id/ai_bg"
android:clickable="true"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/black_hint"> android:background="@color/black_hint"
</RelativeLayout> android:clickable="true"
android:visibility="gone"></RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/ai_wrapper" android:id="@+id/ai_wrapper"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:visibility="gone">
<LinearLayout <LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout <LinearLayout
android:orientation="vertical"
android:layout_gravity="center"
android:gravity="center"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:background="@drawable/shape_dialog_bg"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingBottom="20dp" android:paddingBottom="20dp">
android:layout_height="wrap_content"
android:background="@drawable/shape_dialog_bg">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="倾听中"
android:textColor="@color/ai" android:textColor="@color/ai"
android:textSize="23sp" android:textSize="23sp" />
android:text="倾听中"/>
<ImageView <ImageView
android:id="@+id/ai_pic" android:id="@+id/ai_pic"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="80sp" android:layout_height="80sp"
android:src="@drawable/anim_record"/> android:src="@drawable/anim_record" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="百合机器人为你服务"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" android:textSize="16sp" />
android:text="百合机器人为你服务"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
<resources> <resources>
<string name="app_name">M</string> <string name="app_name"></string>
<string name="turing_appkey">19693c9351fb41c9bb7b5b2695fd890b</string> <string name="turing_appkey">19693c9351fb41c9bb7b5b2695fd890b</string>
<string name="turing_secret">goV639J27FRW8Y9F</string> <string name="turing_secret">goV639J27FRW8Y9F</string>
<string name="network_error">网络慢.缓冲失败</string> <string name="network_error">网络慢.缓冲失败</string>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!