浏览代码

去掉免提和手柄通话音量设置,只保留一个总的通话音量设置

weizhengliang 2 年之前
父节点
当前提交
8454f0323c

+ 9 - 5
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHomeActivity.kt

@@ -807,7 +807,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
         //门口机通话音量 没做白昼区分
         SettingConfig.setDoorPhoneVolume(this, SettingConfiguration.getInstance().dayDoorVol)
 
-        VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostHandsFreePlayVolume(this.activity))
+        VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(this.activity))
 
         updateTime(true)
     }
@@ -1138,6 +1138,10 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 SettingConfiguration.getInstance().transferDurationLeader = 30
             }
 
+            if (data.dayVol != null) {
+                SettingConfig.setHostCallVolume(this, data.dayVol)
+            }
+
             if (data.systemConfigList != null && data.systemConfigList.size > 0) {
                 for (setting in data.systemConfigList) {
                     if (setting.keyCode != null && setting.keyCode.equals("groupHostTransferSeconds")) {
@@ -1517,7 +1521,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 if (System.currentTimeMillis() - hookonTime > 2000) {
                     Constants.hookOn = true
                     VoiceManagerUtil.switchAudioMode(activity, true)
-                    VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostHandsFreePlayVolume(activity))
+                    VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
 
                     if (Constants.CALL_STATE == Constants.CALL_OUTGOING) {
                         //呼出取消
@@ -1539,7 +1543,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 if (System.currentTimeMillis() - hookoffTime > 2000) {
                     Constants.hookOn = false
                     VoiceManagerUtil.switchAudioMode(activity, false)
-                    VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostGamepadPlayVolume(activity))
+                    VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
 
                     if (Constants.CALL_STATE == Constants.CALL_STANDBY) {
                         //不是呼出也不是通话状态则接听电话
@@ -1564,7 +1568,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
             if (System.currentTimeMillis() - hookoffTime > 2000) {
                 Constants.hookOn = false
                 VoiceManagerUtil.switchAudioMode(activity, false)
-                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostGamepadPlayVolume(activity))
+                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
 
                 if (Constants.CALL_STATE == Constants.CALL_STANDBY) {
                     //不是呼出也不是通话状态则接听电话
@@ -1579,7 +1583,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
             if (System.currentTimeMillis() - hookonTime > 2000) {
                 Constants.hookOn = true
                 VoiceManagerUtil.switchAudioMode(activity, true)
-                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostHandsFreePlayVolume(activity))
+                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
 
                 if (Constants.CALL_STATE == Constants.CALL_OUTGOING) {
                     //呼出取消

+ 10 - 12
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SystemSettingsFragment.kt

@@ -140,12 +140,14 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
 
 
         //主机免提播放音量
-        host_hands_free_play_volume_tv.text = SettingConfig.getHostHandsFreePlayVolume(this.activity).toString()
+        /*host_hands_free_play_volume_tv.text = SettingConfig.getHostHandsFreePlayVolume(this.activity).toString()
         host_hands_free_play_volume_seekb.setProgress(SettingConfig.getHostHandsFreePlayVolume(this.activity))
         //主机手柄播放音量
         host_gamepad_play_volume_tv.text = SettingConfig.getHostGamepadPlayVolume(this.activity).toString()
-        host_gamepad_play_volume_seekb.setProgress(SettingConfig.getHostGamepadPlayVolume(this.activity))
-        //todo 根据白天晚上设置播放音量
+        host_gamepad_play_volume_seekb.setProgress(SettingConfig.getHostGamepadPlayVolume(this.activity))*/
+
+        host_call_volume_tv.text = SettingConfig.getHostCallVolume(this.activity).toString()
+        host_call_volume_seekb.setProgress(SettingConfig.getHostCallVolume(this.activity))
 
         //通话模式
         if(SettingConfig.single_pass_mode == SettingConfig.getTalkMode(this.activity)){
@@ -415,6 +417,7 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
         //主机播放音量设置
         host_hands_free_play_volume_seekb.setOnSeekBarChangeListener(this)
         host_gamepad_play_volume_seekb.setOnSeekBarChangeListener(this)
+        host_call_volume_seekb.setOnSeekBarChangeListener(this)
         //通话模式
         talk_mode_radiogrp.setOnCheckedChangeListener { radioGroup, i ->
             if(i == R.id.single_pass_mode_radiobt){//单工模式
@@ -532,13 +535,8 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
                 host_handle_input_volume_tv.text = p1.toString()
                 //todo 这里需要配合语音通话 视屏通话通讯使用
             }
-            R.id.host_hands_free_play_volume_seekb -> { //主机免提播放音量
-                host_hands_free_play_volume_tv.text = p1.toString()
-                //todo 这里需要配合语音通话 视屏通话通讯使用
-                VoiceManagerUtil.setCallVoice(this.activity, p1)
-            }
-            R.id.host_gamepad_play_volume_seekb -> { //主机手柄播放音量
-                host_gamepad_play_volume_tv.text = p1.toString()
+            R.id.host_call_volume_seekb -> { //主机通话音量
+                host_call_volume_tv.text = p1.toString()
                 //todo 这里需要配合语音通话 视屏通话通讯使用
                 VoiceManagerUtil.setCallVoice(this.activity, p1)
             }
@@ -625,12 +623,12 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
             R.id.host_handle_input_volume_seekb -> { //主机手柄录入音量
                 SettingConfig.setHostHandleInputVolume(this.activity,p0.progress)
             }
-            R.id.host_hands_free_play_volume_seekb -> { //主机免提播放音量
+            /*R.id.host_hands_free_play_volume_seekb -> { //主机免提播放音量
                 SettingConfig.setHostHandsFreePlayVolume(this.activity,p0.progress)
             }
             R.id.host_gamepad_play_volume_seekb -> { //主机手柄播放音量
                 SettingConfig.setHostGamepadPlayVolume(this.activity,p0.progress)
-            }
+            }*/
             R.id.extension_daytime_brightness_seekb -> { //分机白天亮度设置
                 SettingConfig.setExtensionDaytimeBrightness(this.activity,p0.progress)
             }

+ 22 - 11
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/settingconfig/SettingConfig.java

@@ -50,11 +50,14 @@ public class SettingConfig {
     private static final int host_handle_input_volume = 30;
 
     //主机免提播放音量
-    private static final String KEY_SP_HOST_HANDS_FREE_PLAY_VOLUME = "KEY_SP_HOST_HANDS_FREE_PLAY_VOLUME";
-    private static final int host_hands_free_play_volume = 90;
+    //private static final String KEY_SP_HOST_HANDS_FREE_PLAY_VOLUME = "KEY_SP_HOST_HANDS_FREE_PLAY_VOLUME";
+    //private static final int host_hands_free_play_volume = 90;
     //主机手柄播放音量
-    private static final String KEY_SP_HOST_GAMEPAD_PLAY_VOLUME = "KEY_SP_HOST_GAMEPAD_PLAY_VOLUME";
-    private static final int host_gamepad_play_volume = 40;
+    //private static final String KEY_SP_HOST_GAMEPAD_PLAY_VOLUME = "KEY_SP_HOST_GAMEPAD_PLAY_VOLUME";
+    //private static final int host_gamepad_play_volume = 40;
+    //主机通话音量
+    private static final String KEY_SP_HOST_CALL_VOLUME = "KEY_SP_HOST_CALL_VOLUME";
+    private static final int default_host_call_volume = 80;
 
     //语音播报模式
     private static final String KEY_SP_TTS_MODE = "KEY_SP_TTS_MODE";
@@ -359,35 +362,43 @@ public class SettingConfig {
      *
      * @return
      */
-    public static int getHostHandsFreePlayVolume(Context context) {
+    /*public static int getHostHandsFreePlayVolume(Context context) {
         return getSP(context).getInt(KEY_SP_HOST_HANDS_FREE_PLAY_VOLUME, host_hands_free_play_volume);
-    }
+    }*/
 
     /**
      * 设置主机免提播放音量
      *
      * @param value
      */
-    public static void setHostHandsFreePlayVolume(Context context, int value) {
+    /*public static void setHostHandsFreePlayVolume(Context context, int value) {
         getEditor(context).putInt(KEY_SP_HOST_HANDS_FREE_PLAY_VOLUME, value).apply();
-    }
+    }*/
 
     /**
      * 获取主机手柄播放音量
      *
      * @return
      */
-    public static int getHostGamepadPlayVolume(Context context) {
+    /*public static int getHostGamepadPlayVolume(Context context) {
         return getSP(context).getInt(KEY_SP_HOST_GAMEPAD_PLAY_VOLUME, host_gamepad_play_volume);
-    }
+    }*/
 
     /**
      * 设置主机手柄播放音量
      *
      * @param value
      */
-    public static void setHostGamepadPlayVolume(Context context, int value) {
+    /*public static void setHostGamepadPlayVolume(Context context, int value) {
         getEditor(context).putInt(KEY_SP_HOST_GAMEPAD_PLAY_VOLUME, value).apply();
+    }*/
+
+    public static int getHostCallVolume(Context context) {
+        return getSP(context).getInt(KEY_SP_HOST_CALL_VOLUME, default_host_call_volume);
+    }
+
+    public static void setHostCallVolume(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_HOST_CALL_VOLUME, value).apply();
     }
 
 

+ 48 - 1
android_host/src/main/h10_wke_1h/res/layout/fragment_system_settings.xml

@@ -671,6 +671,52 @@
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:layout_gravity="center_vertical"
+                                android:text="@string/setting_host_device_call_volume"
+                                android:textColor="#000000"
+                                android:textSize="14px" />
+
+                            <TextView
+                                android:id="@+id/host_call_volume_tv"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_gravity="center_vertical"
+                                android:layout_marginLeft="15px"
+                                android:text="12"
+                                android:textColor="#000000"
+                                android:textSize="14px" />
+                        </LinearLayout>
+
+                        <SeekBar
+                            android:id="@+id/host_call_volume_seekb"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginLeft="-6px"
+                            android:layout_marginRight="15px"
+                            android:layout_weight="1"
+                            android:maxHeight="2px"
+                            android:progressDrawable="@drawable/po_seekbar"
+                            android:thumb="@drawable/seekbar_thumb">
+
+                        </SeekBar>
+
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="2dp"
+                        android:orientation="vertical"
+                        android:visibility="gone">
+
+                        <LinearLayout
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:orientation="horizontal">
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_gravity="center_vertical"
                                 android:text="@string/setting_host_device_hands_free_volume"
                                 android:textColor="#000000"
                                 android:textSize="14px" />
@@ -705,7 +751,8 @@
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_marginTop="2dp"
-                        android:orientation="vertical">
+                        android:orientation="vertical"
+                        android:visibility="gone">
 
                         <LinearLayout
                             android:layout_width="wrap_content"

+ 1 - 0
resource/src/main/res/values-es/strings.xml

@@ -175,6 +175,7 @@
     <string name="setting_host_device_night_volume">Host: volumen nocturno</string>
     <string name="setting_host_device_hands_free_volume">Host: volumen de manos libres</string>
     <string name="setting_host_device_earpiece_volume">Host: volumen del auricular</string>
+    <string name="setting_host_device_call_volume">Host: call volume</string>
     <string name="setting_bed_device">extensión de cama</string>
     <string name="setting_bed_device_day_brightness">Extensión: brillo diurno</string>
     <string name="setting_bed_device_night_brightness">Extensión: brillo nocturno</string>

+ 1 - 0
resource/src/main/res/values-ru/strings.xml

@@ -176,6 +176,7 @@
     <string name="setting_host_device_night_volume">Хост: ночная громкость</string>
     <string name="setting_host_device_hands_free_volume">Хост: громкая связь</string>
     <string name="setting_host_device_earpiece_volume">Хост: громкость динамика</string>
+    <string name="setting_host_device_call_volume">Host: call volume</string>
     <string name="setting_bed_device">Дополнительное устройство</string>
     <string name="setting_bed_device_day_brightness">Расширение: дневная яркость</string>
     <string name="setting_bed_device_night_brightness">Расширение: ночная яркость</string>

+ 1 - 0
resource/src/main/res/values-zh/strings.xml

@@ -189,6 +189,7 @@
     <string name="setting_host_device_night_volume">主机夜晚音量</string>
     <string name="setting_host_device_hands_free_volume">主机免提模式音量</string>
     <string name="setting_host_device_earpiece_volume">主机听筒模式音量</string>
+    <string name="setting_host_device_call_volume">主机通话音量</string>
     <string name="setting_bed_device">分机</string>
     <string name="setting_bed_device_day_brightness">分机白天亮度</string>
     <string name="setting_bed_device_night_brightness">分机夜晚亮度</string>

+ 1 - 0
resource/src/main/res/values/strings.xml

@@ -189,6 +189,7 @@
     <string name="setting_host_device_night_volume">Host: night volume</string>
     <string name="setting_host_device_hands_free_volume">Host: hands free volume</string>
     <string name="setting_host_device_earpiece_volume">Host: earpiece volume</string>
+    <string name="setting_host_device_call_volume">Host: call volume</string>
     <string name="setting_bed_device">Extension device</string>
     <string name="setting_bed_device_day_brightness">Extension: day brightness</string>
     <string name="setting_bed_device_night_brightness">Extension: night brightness</string>