Browse Source

更新版本

liuyuqi-dellpc 4 years ago
parent
commit
0c3897c09d

+ 6 - 6
app/build.gradle

@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
 
 android {
     compileSdkVersion 28
+    buildToolsVersion "29.0.2"
     defaultConfig {
         applicationId "com.zqx.kedaxunfei"
         minSdkVersion 19
@@ -19,15 +20,14 @@ android {
 }
 
 dependencies {
-    compile fileTree(include: ['*.jar'], dir: 'libs')
+    implementation fileTree(include: ['*.jar'], dir: 'libs')
     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
         exclude group: 'com.android.support', module: 'support-annotations'
     })
-    compile 'com.android.support:appcompat-v7:25.1.0'
-    testCompile 'junit:junit:4.12'
-    compile 'com.jakewharton:butterknife:8.4.0'
+    implementation 'com.android.support:appcompat-v7:28.0.0'
+    implementation 'com.android.support:cardview-v7:28.0.0'
+    annotationProcessor 'com.jakewharton:butterknife:8.4.0'
     annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
     compile files('libs/Msc.jar')
-    compile 'com.android.support:cardview-v7:25.1.0'
-    compile 'homhomlin.lib:sldinglayout:0.9.0'
+    implementation 'homhomlin.lib:sldinglayout:0.9.0'
 }

+ 13 - 8
app/src/main/res/layout/activity_main.xml

@@ -17,7 +17,8 @@
         android:paddingBottom="5dp"
         android:paddingLeft="12dp"
         android:paddingRight="12dp"
-        android:paddingTop="12dp">
+        android:paddingTop="12dp"
+        android:focusable="true">
 
         <EditText
             android:id="@+id/et"
@@ -25,8 +26,10 @@
             android:layout_height="wrap_content"
             android:background="@drawable/shape_bg"
             android:gravity="top"
-            android:hint="请输入文字"
-            android:lines="8"
+            android:hint="@string/please_input"
+            android:inputType="text"
+            android:minLines="8"
+            android:autofillHints=""
             android:padding="5dp"
             android:textSize="20sp" />
 
@@ -41,7 +44,6 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:background="@drawable/selector_currspker"
-                android:clickable="true"
                 android:gravity="center_vertical"
                 android:onClick="onSpkerSwitchClick"
                 android:orientation="horizontal"
@@ -51,7 +53,8 @@
                     android:id="@+id/iv_curspk_icon"
                     android:layout_width="40dp"
                     android:layout_height="40dp"
-                    android:src="@mipmap/xiaoyan" />
+                    android:src="@mipmap/xiaoyan"
+                    android:contentDescription="TODO" />
 
                 <TextView
                     android:id="@+id/tv_curspk_desc"
@@ -73,10 +76,11 @@
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="语速:"
+                android:text="@string/speed"
                 android:textSize="15sp" />
 
             <SeekBar
+                android:focusable="auto"
                 android:progress="50"
                 android:id="@+id/seekBar"
                 android:layout_width="match_parent"
@@ -90,13 +94,14 @@
             android:layout_marginTop="20dp"
             android:background="@drawable/selector_btn"
             android:onClick="onSpeakClick"
-            android:text="点我说话"
+            android:text="@string/btn_speak"
             android:textColor="#fff"
             android:textSize="18sp" />
 
 
 
         <FrameLayout
+            android:id="@+id/fl_remark"
             android:layout_width="match_parent"
             android:layout_height="0dp"
             android:layout_weight="1" />
@@ -105,7 +110,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:gravity="center"
-            android:text="由科大讯飞提供技术支持"
+            android:text="@string/xunfei"
             android:textSize="13sp" />
     </LinearLayout>
 

+ 1 - 1
app/src/main/res/layout/dialog_speaker.xml

@@ -8,7 +8,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="5dp"
-        android:text="选择发音人"
+        android:text="@string/choose_role"
         android:textSize="18sp" />
 
     <FrameLayout

+ 3 - 2
app/src/main/res/layout/item_speaker.xml

@@ -10,11 +10,12 @@
         android:id="@+id/iv_speaker_icon"
         android:src= "@mipmap/xiaoyan"
         android:layout_width="40dp"
-        android:layout_height="40dp" />
+        android:layout_height="40dp"
+        android:contentDescription="desc"/>
     <TextView
         android:id="@+id/tv_speaker_desc"
         android:textSize="18sp"
-        android:text="小燕 青年女声"
+        android:text="@string/voice_xiaoyan"
         android:layout_width="match_parent"
         android:layout_height="wrap_content" />
 

+ 2 - 2
app/src/main/res/layout/view_bg_main.xml

@@ -11,7 +11,7 @@
         android:layout_height="wrap_content"
         android:layout_marginTop="5dp"
         android:padding="5dp"
-        android:text="App由章启翔开发"
+        android:text="@string/remark_name"
         android:textColor="#626668"
         android:textSize="15sp" />
 
@@ -19,7 +19,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:padding="5dp"
-        android:text="语音技术由科大讯飞提供"
+        android:text="@string/remark_about"
         android:textColor="#626668"
         android:textSize="15sp" />
 </LinearLayout>

+ 8 - 0
app/src/main/res/values/strings.xml

@@ -1,3 +1,11 @@
 <resources>
     <string name="app_name">讯飞语音</string>
+    <string name="remark_about">语音技术由科大讯飞提供</string>
+    <string name="remark_name">App由章启翔开发</string>
+    <string name="voice_xiaoyan">小燕 青年女声</string>
+    <string name="choose_role">选择发音人</string>
+    <string name="please_input">请输入文字</string>
+    <string name="speed">语速:</string>
+    <string name="btn_speak">点我说话</string>
+    <string name="xunfei">由科大讯飞提供技术支持</string>
 </resources>

+ 2 - 0
build.gradle

@@ -2,6 +2,7 @@
 
 buildscript {
     repositories {
+        google()
         jcenter()
     }
     dependencies {
@@ -14,6 +15,7 @@ buildscript {
 
 allprojects {
     repositories {
+        google()
         jcenter()
     }
 }