|
@@ -37,6 +37,7 @@ import com.wdkl.ncs.android.component.nursehome.visit.frgment.VisitCallFragment
|
|
import com.wdkl.ncs.android.component.nursehome.visit.frgment.VisitMainFragment
|
|
import com.wdkl.ncs.android.component.nursehome.visit.frgment.VisitMainFragment
|
|
import com.wdkl.ncs.android.component.nursehome.visit.frgment.VisitSetFragment
|
|
import com.wdkl.ncs.android.component.nursehome.visit.frgment.VisitSetFragment
|
|
import com.wdkl.ncs.android.component.nursehome.hardware.HardWareFactroy
|
|
import com.wdkl.ncs.android.component.nursehome.hardware.HardWareFactroy
|
|
|
|
+import com.wdkl.ncs.android.component.nursehome.helper.SoundPoolManager
|
|
import com.wdkl.ncs.android.component.nursehome.launch.NurseHomeLaunch
|
|
import com.wdkl.ncs.android.component.nursehome.launch.NurseHomeLaunch
|
|
import com.wdkl.ncs.android.component.nursehome.led.LedItem
|
|
import com.wdkl.ncs.android.component.nursehome.led.LedItem
|
|
import com.wdkl.ncs.android.component.nursehome.led.LedManagerUtils
|
|
import com.wdkl.ncs.android.component.nursehome.led.LedManagerUtils
|
|
@@ -465,6 +466,7 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
batteryInterFilter.addAction(Intent.ACTION_BATTERY_CHANGED)
|
|
batteryInterFilter.addAction(Intent.ACTION_BATTERY_CHANGED)
|
|
//batteryInterFilter.addAction(Intent.ACTION_POWER_CONNECTED)
|
|
//batteryInterFilter.addAction(Intent.ACTION_POWER_CONNECTED)
|
|
//batteryInterFilter.addAction(Intent.ACTION_POWER_DISCONNECTED)
|
|
//batteryInterFilter.addAction(Intent.ACTION_POWER_DISCONNECTED)
|
|
|
|
+
|
|
batteryBroadcastReceiver = BatteryBroadcastReceiver(battery_state_img)
|
|
batteryBroadcastReceiver = BatteryBroadcastReceiver(battery_state_img)
|
|
registerReceiver(batteryBroadcastReceiver, batteryInterFilter)
|
|
registerReceiver(batteryBroadcastReceiver, batteryInterFilter)
|
|
}
|
|
}
|
|
@@ -610,6 +612,7 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
// }
|
|
// }
|
|
|
|
|
|
main_rl_3.setOnClickListener(this)
|
|
main_rl_3.setOnClickListener(this)
|
|
|
|
+ nb_device_radio_bt.setOnClickListener(this)
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
*页面销毁回调
|
|
*页面销毁回调
|
|
@@ -957,7 +960,7 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
if (removeRight) {
|
|
if (removeRight) {
|
|
removeRightFragment()
|
|
removeRightFragment()
|
|
} else {
|
|
} else {
|
|
- showMiddleFragment(FramePartFragment())
|
|
|
|
|
|
+ showMiddleFragment(FramePartFragment(),true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -973,38 +976,41 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
}
|
|
}
|
|
//首页
|
|
//首页
|
|
R.id.menu_home -> {
|
|
R.id.menu_home -> {
|
|
- showMiddleFragment(FramePartFragment())
|
|
|
|
|
|
+ showMiddleFragment(FramePartFragment(),true)
|
|
}
|
|
}
|
|
R.id.menu_ward -> {
|
|
R.id.menu_ward -> {
|
|
- showMiddleFragment(SickbedFragment())
|
|
|
|
|
|
+ showMiddleFragment(SickbedFragment(),true)
|
|
}
|
|
}
|
|
//广播
|
|
//广播
|
|
R.id.menu_broadcasting -> {
|
|
R.id.menu_broadcasting -> {
|
|
|
|
|
|
- showMiddleFragment(BroadcastNewFragment())
|
|
|
|
|
|
+ showMiddleFragment(BroadcastNewFragment(),true)
|
|
}
|
|
}
|
|
|
|
|
|
R.id.menu_doctor -> {
|
|
R.id.menu_doctor -> {
|
|
- showMiddleFragment(DoctorHostFragment())
|
|
|
|
|
|
+ showMiddleFragment(DoctorHostFragment(),true)
|
|
}
|
|
}
|
|
|
|
|
|
R.id.menu_moving -> {
|
|
R.id.menu_moving -> {
|
|
- showMiddleFragment(NurseMoveFragment())
|
|
|
|
|
|
+ showMiddleFragment(NurseMoveFragment(),true)
|
|
}
|
|
}
|
|
|
|
|
|
R.id.menu_others -> {
|
|
R.id.menu_others -> {
|
|
- showMiddleFragment(OtherHostFragment())
|
|
|
|
|
|
+ showMiddleFragment(OtherHostFragment(),true)
|
|
}
|
|
}
|
|
|
|
|
|
R.id.menu_more -> {
|
|
R.id.menu_more -> {
|
|
- showMiddleFragment(WorkFragment())
|
|
|
|
|
|
+ showMiddleFragment(WorkFragment(),true)
|
|
}
|
|
}
|
|
R.id.menu_hosting -> {
|
|
R.id.menu_hosting -> {
|
|
- showMiddleFragment(TrustManagementFragment())
|
|
|
|
|
|
+ showMiddleFragment(TrustManagementFragment(),true)
|
|
|
|
+ }
|
|
|
|
+ R.id.nb_device_radio_bt -> {
|
|
|
|
+ showMiddleFragment(IotDeviceFragment(),true)
|
|
}
|
|
}
|
|
|
|
|
|
R.id.menu_led -> {
|
|
R.id.menu_led -> {
|
|
- showMiddleFragment(VisitMainFragment())
|
|
|
|
|
|
+ showMiddleFragment(VisitMainFragment(),true)
|
|
redDot.visibility = View.GONE
|
|
redDot.visibility = View.GONE
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1021,11 +1027,11 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
}
|
|
}
|
|
|
|
|
|
//显示中间主界面
|
|
//显示中间主界面
|
|
- fun showMiddleFragment(fragment: Fragment) {
|
|
|
|
|
|
+ fun showMiddleFragment(fragment: Fragment, boolean: Boolean) {
|
|
supportFragmentManager.inTransaction {
|
|
supportFragmentManager.inTransaction {
|
|
remove(currentFragment!!)
|
|
remove(currentFragment!!)
|
|
currentFragment = fragment
|
|
currentFragment = fragment
|
|
- updateLeftBtState()
|
|
|
|
|
|
+ updateLeftBtState(boolean)
|
|
add(R.id.host_main_frame, fragment)
|
|
add(R.id.host_main_frame, fragment)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1080,8 +1086,7 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
.commitAllowingStateLoss()
|
|
.commitAllowingStateLoss()
|
|
skyCallFragment = null
|
|
skyCallFragment = null
|
|
}
|
|
}
|
|
- //call_frame_new.bringToFront()
|
|
|
|
-
|
|
|
|
|
|
+// call_frame_new.bringToFront()
|
|
skyCallFragment = fragment
|
|
skyCallFragment = fragment
|
|
supportFragmentManager.beginTransaction()
|
|
supportFragmentManager.beginTransaction()
|
|
.setCustomAnimations(R.anim.slide_down_in, R.anim.slide_up_out)
|
|
.setCustomAnimations(R.anim.slide_down_in, R.anim.slide_up_out)
|
|
@@ -1302,12 +1307,11 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
hookonTime = System.currentTimeMillis()
|
|
hookonTime = System.currentTimeMillis()
|
|
} else if (intent.action == Constant.HOOK_OFF) {
|
|
} else if (intent.action == Constant.HOOK_OFF) {
|
|
Log.e(TAG, "手柄拿起 ")
|
|
Log.e(TAG, "手柄拿起 ")
|
|
- EventBus.getDefault().post(MessageEvent(false, Constant.EVENT_TOGGLE_SPEAKER))
|
|
|
|
if (System.currentTimeMillis() - hookoffTime > 2000) {
|
|
if (System.currentTimeMillis() - hookoffTime > 2000) {
|
|
Constant.hookOn = false
|
|
Constant.hookOn = false
|
|
|
|
+ EventBus.getDefault().post(MessageEvent(false, Constant.EVENT_TOGGLE_SPEAKER))
|
|
VoiceManagerUtil.switchAudioMode(activity, false)
|
|
VoiceManagerUtil.switchAudioMode(activity, false)
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
|
|
-
|
|
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
//不是呼出也不是通话状态则接听电话
|
|
//不是呼出也不是通话状态则接听电话
|
|
EventBus.getDefault().post(MessageEvent("hookoff", Constant.EVENT_HOOK_OFF))
|
|
EventBus.getDefault().post(MessageEvent("hookoff", Constant.EVENT_HOOK_OFF))
|
|
@@ -1326,12 +1330,11 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
Log.d(TAG, "keyDown ====> keyCode: $keyCode, action: ${event?.action}")
|
|
Log.d(TAG, "keyDown ====> keyCode: $keyCode, action: ${event?.action}")
|
|
if (keyCode == 135 || keyCode == 139) {
|
|
if (keyCode == 135 || keyCode == 139) {
|
|
//手柄拿起
|
|
//手柄拿起
|
|
- Constant.hookOn = false
|
|
|
|
- EventBus.getDefault().post(MessageEvent(false, Constant.EVENT_TOGGLE_SPEAKER))
|
|
|
|
if (System.currentTimeMillis() - hookoffTime > 2000) {
|
|
if (System.currentTimeMillis() - hookoffTime > 2000) {
|
|
|
|
+ Constant.hookOn = false
|
|
|
|
+ EventBus.getDefault().post(MessageEvent(false, Constant.EVENT_TOGGLE_SPEAKER))
|
|
VoiceManagerUtil.switchAudioMode(activity, false)
|
|
VoiceManagerUtil.switchAudioMode(activity, false)
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
|
|
-
|
|
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
//不是呼出也不是通话状态则接听电话
|
|
//不是呼出也不是通话状态则接听电话
|
|
EventBus.getDefault().post(MessageEvent("hookoff", Constant.EVENT_HOOK_OFF))
|
|
EventBus.getDefault().post(MessageEvent("hookoff", Constant.EVENT_HOOK_OFF))
|
|
@@ -1469,106 +1472,121 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
//view_title_layout_tv_point.setBackgroundResource(R.mipmap.sip_h)
|
|
//view_title_layout_tv_point.setBackgroundResource(R.mipmap.sip_h)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- private fun updateLeftBtState() {
|
|
|
|
- menu_home.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_home.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ private fun updateLeftBtState(isbg :Boolean) {
|
|
|
|
|
|
- menu_broadcasting.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_broadcasting.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ if(isbg){
|
|
|
|
+ menu_home.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_home.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_doctor.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_doctor.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_broadcasting.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_broadcasting.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_ward.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_ward.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_doctor.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_doctor.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_ward_disease.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_ward_disease.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_ward.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_ward.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_moving.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_moving.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_ward_disease.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_ward_disease.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_others.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_others.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_moving.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_moving.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_settings.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_settings.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_others.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_others.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_led.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_led.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_settings.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_settings.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_more.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_more.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
+ menu_led.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_led.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- menu_hosting.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
- menu_hosting.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
- group_menus.clearCheck()
|
|
|
|
- // 判断当前显示的Fragment是哪个
|
|
|
|
- when (currentFragment) {
|
|
|
|
- is FramePartFragment -> {
|
|
|
|
- //首页
|
|
|
|
- main_rl_3.visibility = View.VISIBLE
|
|
|
|
- menu_home.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_home.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is DoctorHostFragment -> {
|
|
|
|
- //医生
|
|
|
|
- menu_doctor.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_doctor.setTextColor(getResources().getColor(R.color.delete_text_color))
|
|
|
|
- }
|
|
|
|
- is BroadcastNewFragment -> {
|
|
|
|
- //广播
|
|
|
|
- menu_broadcasting.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_broadcasting.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is BedsInTheWardFragment -> {
|
|
|
|
- //病区
|
|
|
|
- menu_ward_disease.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_ward_disease.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is SickbedFragment -> {
|
|
|
|
- //病床
|
|
|
|
- menu_ward.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_ward.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is SystemSettingsFragment -> {
|
|
|
|
- //设置
|
|
|
|
- menu_settings.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_settings.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is TrustManagementFragment -> {
|
|
|
|
- //托管
|
|
|
|
- menu_hosting.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_hosting.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is NurseMoveFragment -> {
|
|
|
|
- //移动
|
|
|
|
- menu_moving.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_moving.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
|
|
+ menu_more.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_more.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
|
|
- is OtherHostFragment -> {
|
|
|
|
- //其他
|
|
|
|
- menu_others.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_others.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is LedSettingsFragment -> {
|
|
|
|
- //led
|
|
|
|
- menu_led.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_led.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is WorkFragment -> {
|
|
|
|
- //更多
|
|
|
|
- menu_more.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_more.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
- }
|
|
|
|
- is VisitMainFragment -> {
|
|
|
|
- //探视
|
|
|
|
- menu_led.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
- menu_led.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
|
|
+ menu_hosting.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ menu_hosting.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
+
|
|
|
|
+ nb_device_radio_bt.setBackgroundResource(R.drawable.shape_main_bt_bg)
|
|
|
|
+ nb_device_radio_bt.setTextColor(getResources().getColor(R.color.white))
|
|
|
|
+
|
|
|
|
+ group_menus.clearCheck()
|
|
|
|
+ // 判断当前显示的Fragment是哪个
|
|
|
|
+ when (currentFragment) {
|
|
|
|
+ is FramePartFragment -> {
|
|
|
|
+ //首页
|
|
|
|
+ main_rl_3.visibility = View.VISIBLE
|
|
|
|
+ menu_home.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_home.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is DoctorHostFragment -> {
|
|
|
|
+ //医生
|
|
|
|
+ menu_doctor.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_doctor.setTextColor(getResources().getColor(R.color.delete_text_color))
|
|
|
|
+ }
|
|
|
|
+ is BroadcastNewFragment -> {
|
|
|
|
+ //广播
|
|
|
|
+ menu_broadcasting.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_broadcasting.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is BedsInTheWardFragment -> {
|
|
|
|
+ //病区
|
|
|
|
+ menu_ward_disease.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_ward_disease.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is SickbedFragment -> {
|
|
|
|
+ //病床
|
|
|
|
+ menu_ward.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_ward.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is SystemSettingsFragment -> {
|
|
|
|
+ //设置
|
|
|
|
+ menu_settings.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_settings.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is TrustManagementFragment -> {
|
|
|
|
+ //托管
|
|
|
|
+ menu_hosting.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_hosting.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is NurseMoveFragment -> {
|
|
|
|
+ //移动
|
|
|
|
+ menu_moving.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_moving.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ is OtherHostFragment -> {
|
|
|
|
+ //其他
|
|
|
|
+ menu_others.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_others.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+// is LedSettingsFragment -> {
|
|
|
|
+// //led
|
|
|
|
+// menu_led.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+// menu_led.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+// }
|
|
|
|
+ is WorkFragment -> {
|
|
|
|
+ //更多
|
|
|
|
+ menu_more.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_more.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is VisitMainFragment -> {
|
|
|
|
+ //探视
|
|
|
|
+ menu_led.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ menu_led.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
|
|
+ is IotDeviceFragment -> {
|
|
|
|
+ //nb设备
|
|
|
|
+ nb_device_radio_bt.setBackgroundResource(R.drawable.shape_main_bt_bg2)
|
|
|
|
+ nb_device_radio_bt.setTextColor(getResources().getColor(R.color.delete_text_color));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
override fun onBackPressed() {
|
|
override fun onBackPressed() {
|
|
@@ -2110,24 +2128,21 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
EventBus.getDefault().post(MessageEvent(0, Constant.EVENT_REFRESH_CALL_LIST))
|
|
EventBus.getDefault().post(MessageEvent(0, Constant.EVENT_REFRESH_CALL_LIST))
|
|
} else if (tcpModel.action == TcpAction.DataAction.REMIND) {
|
|
} else if (tcpModel.action == TcpAction.DataAction.REMIND) {
|
|
//如果当前不在NB-IoT设备界面则提醒
|
|
//如果当前不在NB-IoT设备界面则提醒
|
|
-// nb_device_radio_bt.update(0)
|
|
|
|
-// WidgetsUtil.showToastWithImage(getString(R.string.iot_device_warning), 360f, 320f, R.drawable.toast_warn)
|
|
|
|
-//
|
|
|
|
-// if (!SettingConfig.getNbVoiceWarning(activity)) {
|
|
|
|
-// return
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// if (select_id != 11) {
|
|
|
|
-// if (SettingConfig.getTtsMode(activity) != SettingConfig.TTS_ON) {
|
|
|
|
-// SoundPoolManager.getInstance().playSound(5, 1.0f, 1.0f, 0)
|
|
|
|
-// } else {
|
|
|
|
-// if (tcpModel.data != null && tcpModel.data is String) {
|
|
|
|
-// val text = tcpModel.data as String
|
|
|
|
-// SpeechUtil.getInstance().stopSpeak(true)
|
|
|
|
-// SpeechUtil.getInstance().speakSingleText(text)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ nb_device_radio_bt.update(0)
|
|
|
|
+ WidgetsUtil.showToastWithImage(getString(R.string.iot_device_warning), 360f, 320f, R.drawable.toast_warn)
|
|
|
|
+
|
|
|
|
+ if (!SettingConfig.getNbVoiceWarning(activity)) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (SettingConfig.getTtsMode(activity) != SettingConfig.TTS_ON) {
|
|
|
|
+ SoundPoolManager.getInstance().playSound(5, 1.0f, 1.0f, 0)
|
|
|
|
+ } else {
|
|
|
|
+ if (tcpModel.data != null && tcpModel.data is String) {
|
|
|
|
+ val text = tcpModel.data as String
|
|
|
|
+ SpeechUtil.getInstance().stopSpeak(true)
|
|
|
|
+ SpeechUtil.getInstance().speakSingleText(text)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else if (tcpModel.type == TcpType.ENTRACEGUARD) {
|
|
} else if (tcpModel.type == TcpType.ENTRACEGUARD) {
|
|
if (tcpModel.action == TcpAction.EntraceGuardAction.STRANGER) {
|
|
if (tcpModel.action == TcpAction.EntraceGuardAction.STRANGER) {
|
|
@@ -2252,9 +2267,14 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
//发送音频广播后返回的数据
|
|
//发送音频广播后返回的数据
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
val json = JSON.parseObject(interactionVO.data.toString())
|
|
val json = JSON.parseObject(interactionVO.data.toString())
|
|
- val bid = json.getString("bId")
|
|
|
|
- addTobrIngList(interactionVO.id.toString(),bid)
|
|
|
|
-// Constant.bcInteractionId = interactionVO.id
|
|
|
|
|
|
+
|
|
|
|
+ if(json.containsKey("bId")){
|
|
|
|
+ var bid = json.getString("bId")
|
|
|
|
+ addTobrIngList(interactionVO.id.toString(),bid)
|
|
|
|
+ }else{
|
|
|
|
+ //喊话广播
|
|
|
|
+ Constant.bcInteractionId = interactionVO.id
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else if (tcpModel.action == TcpAction.BroadcastAction.STOP) {
|
|
} else if (tcpModel.action == TcpAction.BroadcastAction.STOP) {
|
|
//广播结束
|
|
//广播结束
|
|
@@ -2412,7 +2432,7 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Constant.EVENT_r_br_set -> {
|
|
Constant.EVENT_r_br_set -> {
|
|
- showMiddleFragment(BroadcastNewFragment())
|
|
|
|
|
|
+ showMiddleFragment(BroadcastNewFragment(),true)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2430,7 +2450,7 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
}
|
|
}
|
|
|
|
|
|
Constant.EVENT_r_VISIT_th -> {
|
|
Constant.EVENT_r_VISIT_th -> {
|
|
- showMiddleFragment(VisitMainFragment())
|
|
|
|
|
|
+ showMiddleFragment(VisitMainFragment(),true)
|
|
|
|
|
|
}
|
|
}
|
|
Constant.EVENT_V_VISIT_th -> {
|
|
Constant.EVENT_V_VISIT_th -> {
|
|
@@ -2533,7 +2553,6 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
|
|
|
|
//手柄串口消息
|
|
//手柄串口消息
|
|
override fun forkSpringData(data: Int) {
|
|
override fun forkSpringData(data: Int) {
|
|
-
|
|
|
|
if (Constant.isText) {
|
|
if (Constant.isText) {
|
|
if (data == 1) {
|
|
if (data == 1) {
|
|
EventBus.getDefault().post(MessageEvent("hook_off", Constant.EVENT_SERIAL_TEST))
|
|
EventBus.getDefault().post(MessageEvent("hook_off", Constant.EVENT_SERIAL_TEST))
|
|
@@ -2546,8 +2565,8 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
if (data == 1) {
|
|
if (data == 1) {
|
|
//放下手柄
|
|
//放下手柄
|
|
SerialPortUtilHost.getInstance().setHandsFree(true)
|
|
SerialPortUtilHost.getInstance().setHandsFree(true)
|
|
- SerialPortUtilHost.getInstance().setMIC(true)
|
|
|
|
- //防止频繁按下
|
|
|
|
|
|
+ SerialPortUtilHost.getInstance().setMIC(true) //防止频繁按下
|
|
|
|
+ Constant.hookOn = true
|
|
if (!Constant.hookOn && System.currentTimeMillis() - hookonTime > 1800) {
|
|
if (!Constant.hookOn && System.currentTimeMillis() - hookonTime > 1800) {
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostHandsFreePlayVolume(this.activity))
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostHandsFreePlayVolume(this.activity))
|
|
if (Constant.CALL_STATE == Constant.CALL_OUTGOING) {
|
|
if (Constant.CALL_STATE == Constant.CALL_OUTGOING) {
|
|
@@ -2563,13 +2582,13 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
}
|
|
}
|
|
hookonTime = System.currentTimeMillis()
|
|
hookonTime = System.currentTimeMillis()
|
|
}
|
|
}
|
|
- Constant.hookOn = true
|
|
|
|
|
|
+
|
|
} else if (data == 0) {
|
|
} else if (data == 0) {
|
|
//之前是放下状态,然后拿起手柄
|
|
//之前是放下状态,然后拿起手柄
|
|
SerialPortUtilHost.getInstance().setHandsFree(false)
|
|
SerialPortUtilHost.getInstance().setHandsFree(false)
|
|
SerialPortUtilHost.getInstance().setMIC(false)
|
|
SerialPortUtilHost.getInstance().setMIC(false)
|
|
|
|
+ Constant.hookOn = false
|
|
EventBus.getDefault().post(MessageEvent(false, Constant.EVENT_TOGGLE_SPEAKER))
|
|
EventBus.getDefault().post(MessageEvent(false, Constant.EVENT_TOGGLE_SPEAKER))
|
|
-
|
|
|
|
if (Constant.hookOn && System.currentTimeMillis() - hookoffTime > 2000) {
|
|
if (Constant.hookOn && System.currentTimeMillis() - hookoffTime > 2000) {
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostGamepadPlayVolume(this.activity))
|
|
VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostGamepadPlayVolume(this.activity))
|
|
if (Constant.CALL_STATE != Constant.CALL_CALLING && Constant.CALL_STATE != Constant.CALL_OUTGOING) {
|
|
if (Constant.CALL_STATE != Constant.CALL_CALLING && Constant.CALL_STATE != Constant.CALL_OUTGOING) {
|
|
@@ -2578,7 +2597,7 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNewN
|
|
}
|
|
}
|
|
hookoffTime = System.currentTimeMillis()
|
|
hookoffTime = System.currentTimeMillis()
|
|
}
|
|
}
|
|
- Constant.hookOn = false
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|