Jelajahi Sumber

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

weizhengliang 2 tahun lalu
induk
melakukan
87ff454b16

+ 7 - 3
android_host/src/main/h10_z3128_1h/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHomeActivity.kt

@@ -416,7 +416,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)
     }
@@ -674,6 +674,10 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 SettingConfiguration.getInstance().transferDurationLeader = 30
             }
 
+            if (data.dayVol != null) {
+                SettingConfig.setHostCallVolume(this, data.dayVol)
+            }
+
             SettingConfiguration.getInstance().doctorTitle = data.doctorTitle
             SettingConfiguration.getInstance().nurseTitle = data.nurseTitle
             if (data.doctorValid != null) {
@@ -1857,7 +1861,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
             SerialPortUtil.getInstance().setMIC(true)
             //防止频繁按下
             if (!Constants.hookOn && System.currentTimeMillis() - hookonTime > 1800) {
-                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostHandsFreePlayVolume(this.activity))
+                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(this.activity))
                 if (Constants.CALL_STATE == Constants.CALL_OUTGOING) {
                     //呼出取消
                     Constants.CALL_STATE = Constants.CALL_STANDBY
@@ -1879,7 +1883,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
             EventBus.getDefault().post(MessageEvent(false, Constants.EVENT_TOGGLE_SPEAKER))
 
             if (Constants.hookOn && System.currentTimeMillis() - hookoffTime > 2000) {
-                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostGamepadPlayVolume(this.activity))
+                VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(this.activity))
                 if (Constants.CALL_STATE != Constants.CALL_CALLING && Constants.CALL_STATE != Constants.CALL_OUTGOING) {
                     //不是呼出也不是通话状态则接听电话
                     EventBus.getDefault().post(MessageEvent("hookoff", Constants.EVENT_HOOK_OFF))

+ 11 - 11
android_host/src/main/h10_z3128_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SystemSettingsFragment.kt

@@ -145,12 +145,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)){
@@ -425,6 +427,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){//单工模式
@@ -527,13 +530,10 @@ 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 这里需要配合语音通话 视屏通话通讯使用
-            }
-            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)
             }
             R.id.extension_daytime_brightness_seekb -> { //分机白天亮度设置
                 extension_daytime_brightness_tv.text = p1.toString()
@@ -618,12 +618,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_z3128_1h/java/com/wdkl/ncs/android/component/nursehome/settingconfig/SettingConfig.java

@@ -51,11 +51,15 @@ 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";
@@ -360,37 +364,44 @@ 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_z3128_1h/res/layout/fragment_system_settings.xml

@@ -735,6 +735,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" />
@@ -769,7 +815,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"