Browse Source

卡尔总控主机版本增加语音播报床号为数字或数值模式

weizhengliang 2 years ago
parent
commit
de0db4c640

+ 2 - 2
android_host_manager/src/main/zk_h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHomeActivity.kt

@@ -530,9 +530,9 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
         SettingConfiguration.getInstance().transferCall = SettingConfig.getTransferCall(activity)
         if (SettingConfiguration.getInstance().transferCall) {
             startTransferScheduledExecutor()
-        } else {
+        } /*else {
             startRemoveCallScheduledExecutor()
-        }
+        }*/
 
         //记录app启动时间
         val lastTime = SettingConfig.getAppStartTime(activity)

+ 14 - 0
android_host_manager/src/main/zk_h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SystemSettingsFragment.kt

@@ -105,6 +105,12 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
             radio_sync_ntp_off.isChecked = true
         }
 
+        if (SettingConfig.getVoiceNumeric(activity)) {
+            radio_voice_numeric_on.isChecked = true
+        } else {
+            radio_voice_numeric_off.isChecked = true
+        }
+
         //语音播报次数
         call_number_tv.text = SettingConfig.getCallNumber(this.activity).toString()
         call_number_seekb.setProgress((SettingConfig.getCallNumber(this.activity)))
@@ -362,6 +368,14 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
             }
         }
 
+        group_call_voice_numeric.setOnCheckedChangeListener { group, checkedId ->
+            if (checkedId == R.id.radio_voice_numeric_on) {
+                SettingConfig.setVoiceNumeric(activity, true)
+            } else {
+                SettingConfig.setVoiceNumeric(activity, false)
+            }
+        }
+
         spinner_call_stay_time.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
             override fun onItemSelected(
                 parent: AdapterView<*>?,

+ 11 - 1
android_host_manager/src/main/zk_h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/settingconfig/SettingConfig.java

@@ -26,7 +26,7 @@ public class SettingConfig {
 
     //播报次数
     private static final String KEY_SP_CALL_NUMBER = "KEY_SP_CALL_NUMBER";
-    private static final int call_number = 2;
+    private static final int call_number = 3;
 
     //主机白天亮度
     private static final String KEY_SP_MAIN_ENGINE_DAYTIME_BRIGHTNESS = "KEY_SP_MAIN_ENGINE_DAYTIME_BRIGHTNESS";
@@ -139,6 +139,8 @@ public class SettingConfig {
 
     private static final String KEY_SP_SYNC_NTP_TIME = "KEY_SP_SYNC_NTP_TIME";
 
+    private static final String KEY_SP_VOICE_NUMERIC = "KEY_SP_VOICE_NUMERIC";
+
     public static boolean getSyncNtpTime(Context context) {
         return getSP(context).getBoolean(KEY_SP_SYNC_NTP_TIME, true);
     }
@@ -155,6 +157,14 @@ public class SettingConfig {
         getEditor(context).putBoolean(KEY_SP_RECORD_ENABLE, enable).apply();
     }
 
+    public static boolean getVoiceNumeric(Context context) {
+        return getSP(context).getBoolean(KEY_SP_VOICE_NUMERIC, true);
+    }
+
+    public static void setVoiceNumeric(Context context, boolean enable) {
+        getEditor(context).putBoolean(KEY_SP_VOICE_NUMERIC, enable).apply();
+    }
+
     //语音播报模式
     public static int getTtsMode(Context context) {
         return getSP(context).getInt(KEY_SP_TTS_MODE, TTS_ON);

+ 15 - 10
android_host_manager/src/main/zk_h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/util/Util.kt

@@ -7,6 +7,7 @@ import android.content.Context.KEYGUARD_SERVICE
 import android.os.PowerManager
 import android.util.DisplayMetrics
 import android.view.WindowManager
+import com.wdkl.ncs.android.component.nursehome.settingconfig.SettingConfig
 import com.wdkl.ncs.android.lib.base.BaseApplication
 
 
@@ -44,17 +45,21 @@ object Util {
     }
 
     fun appendSpace(para: String): String {
-        val length = para.length
-        val value = CharArray(length shl 1)
-        var i = 0
-        var j = 0
-        while (i < length) {
-            value[j] = para[i]
-            value[1 + j] = ' '
-            ++i
-            j = i shl 1
+        if (SettingConfig.getVoiceNumeric(BaseApplication.appContext)) {
+            val length = para.length
+            val value = CharArray(length shl 1)
+            var i = 0
+            var j = 0
+            while (i < length) {
+                value[j] = para[i]
+                value[1 + j] = ' '
+                ++i
+                j = i shl 1
+            }
+            return String(value)
+        } else {
+            return para
         }
-        return String(value)
     }
 
 

+ 41 - 1
android_host_manager/src/main/zk_h10_wke_1h/res/layout/fragment_system_settings.xml

@@ -114,6 +114,45 @@
                     </LinearLayout>
 
                     <LinearLayout
+                        android:id="@+id/ll_call_voice_numeric"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:layout_marginBottom="10px"
+                        android:orientation="horizontal">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:text="语音播报为数字:"
+                            android:textColor="#000000"
+                            android:textSize="14px" />
+
+                        <RadioGroup
+                            android:id="@+id/group_call_voice_numeric"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:orientation="horizontal">
+
+                            <RadioButton
+                                android:id="@+id/radio_voice_numeric_on"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="@string/setting_call_forwarding_enable"
+                                android:textSize="14px" />
+
+                            <RadioButton
+                                android:id="@+id/radio_voice_numeric_off"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="@string/setting_call_forwarding_disable"
+                                android:textSize="14px" />
+                        </RadioGroup>
+
+                    </LinearLayout>
+
+                    <LinearLayout
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_marginTop="2dp"
@@ -232,7 +271,8 @@
                     <LinearLayout
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:layout_marginBottom="8dp">
+                        android:layout_marginBottom="8dp"
+                        android:visibility="gone">
 
                         <TextView
                             android:layout_width="wrap_content"