|
@@ -7,6 +7,7 @@ import android.content.Context
|
|
import android.content.Intent
|
|
import android.content.Intent
|
|
import android.content.IntentFilter
|
|
import android.content.IntentFilter
|
|
import android.graphics.Color
|
|
import android.graphics.Color
|
|
|
|
+import android.net.ConnectivityManager
|
|
import android.net.Uri
|
|
import android.net.Uri
|
|
import android.os.Build
|
|
import android.os.Build
|
|
import android.os.CountDownTimer
|
|
import android.os.CountDownTimer
|
|
@@ -40,10 +41,7 @@ import com.wdkl.ncs.android.component.nursehome.databinding.ActivityNurseHomeBin
|
|
import com.wdkl.ncs.android.component.nursehome.fragment.*
|
|
import com.wdkl.ncs.android.component.nursehome.fragment.*
|
|
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.settingconfig.SettingConfig
|
|
import com.wdkl.ncs.android.component.nursehome.settingconfig.SettingConfig
|
|
-import com.wdkl.ncs.android.component.nursehome.util.CallDialogHelper
|
|
|
|
-import com.wdkl.ncs.android.component.nursehome.util.ScreenManagerUtil
|
|
|
|
-import com.wdkl.ncs.android.component.nursehome.util.TimeTransition
|
|
|
|
-import com.wdkl.ncs.android.component.nursehome.util.VoiceManagerUtil
|
|
|
|
|
|
+import com.wdkl.ncs.android.component.nursehome.util.*
|
|
import com.wdkl.ncs.android.lib.base.BaseActivity
|
|
import com.wdkl.ncs.android.lib.base.BaseActivity
|
|
import com.wdkl.ncs.android.lib.utils.AppTool
|
|
import com.wdkl.ncs.android.lib.utils.AppTool
|
|
import com.wdkl.ncs.android.lib.utils.debugLog
|
|
import com.wdkl.ncs.android.lib.utils.debugLog
|
|
@@ -162,6 +160,8 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
|
|
setSettingConfiguration()
|
|
setSettingConfiguration()
|
|
|
|
|
|
initCountDownTimer()
|
|
initCountDownTimer()
|
|
|
|
+
|
|
|
|
+ updateNetState()
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -186,13 +186,13 @@ class NurseHomeActivity : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
|
|
}
|
|
}
|
|
|
|
|
|
override fun userLogin() {
|
|
override fun userLogin() {
|
|
- debugLog("NurseHome", "user login")
|
|
|
|
- //updateStatus(SipStatus.REGISTERCOM)
|
|
|
|
|
|
+ //debugLog("NurseHome", "user login")
|
|
|
|
+ view_title_layout_tv_point.setBackgroundResource(R.color.green)
|
|
}
|
|
}
|
|
|
|
|
|
override fun userLogout() {
|
|
override fun userLogout() {
|
|
- debugLog("NurseHome", "user logout")
|
|
|
|
- //updateStatus(SipStatus.REGISTERFAIL)
|
|
|
|
|
|
+ //debugLog("NurseHome", "user logout")
|
|
|
|
+ view_title_layout_tv_point.setBackgroundResource(R.color.red_color)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -524,15 +524,25 @@ fun call(tyte:Int){
|
|
ScreenManagerUtil().setScreenBrightness(context,Math.ceil(2.54 * SettingConfig.getMainEngineDaytimeBrightness(context)).toInt())
|
|
ScreenManagerUtil().setScreenBrightness(context,Math.ceil(2.54 * SettingConfig.getMainEngineDaytimeBrightness(context)).toInt())
|
|
//设置白天系统音量和响铃音
|
|
//设置白天系统音量和响铃音
|
|
setTheSystemVolume(SettingConfig.getHostDaytimeVolume(context))
|
|
setTheSystemVolume(SettingConfig.getHostDaytimeVolume(context))
|
|
|
|
+ day_night_state_imagev.setImageResource(R.drawable.ic_daylight)
|
|
|
|
|
|
}else{ //夜晚
|
|
}else{ //夜晚
|
|
//设置晚上亮度
|
|
//设置晚上亮度
|
|
ScreenManagerUtil().setScreenBrightness(context,Math.ceil(2.54 * SettingConfig.getHostNightBrightness(context)).toInt())
|
|
ScreenManagerUtil().setScreenBrightness(context,Math.ceil(2.54 * SettingConfig.getHostNightBrightness(context)).toInt())
|
|
//设置晚上系统音量和响铃音
|
|
//设置晚上系统音量和响铃音
|
|
setTheSystemVolume(SettingConfig.getHostNightVolume(context))
|
|
setTheSystemVolume(SettingConfig.getHostNightVolume(context))
|
|
|
|
+ day_night_state_imagev.setImageResource(R.drawable.ic_night)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ updateNetState()
|
|
|
|
+ updateTcpState()
|
|
|
|
|
|
|
|
+ //sip状态
|
|
|
|
+ if (SocketManager.getInstance().userState == 1) {
|
|
|
|
+ view_title_layout_tv_point.setBackgroundResource(R.color.green)
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_tv_point.setBackgroundResource(R.color.red_color)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -576,6 +586,32 @@ fun call(tyte:Int){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private fun updateNetState() {
|
|
|
|
+ if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_WIFI) {
|
|
|
|
+ wifi_state_imagev.visibility = View.VISIBLE
|
|
|
|
+ wifi_state_imagev.setImageResource(R.drawable.ic_wifi_success)
|
|
|
|
+ ethernet_state_imagev.visibility = View.GONE
|
|
|
|
+ } else if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_ETHERNET) {
|
|
|
|
+ ethernet_state_imagev.visibility = View.VISIBLE
|
|
|
|
+ ethernet_state_imagev.setImageResource(R.drawable.ic_ethernet_success)
|
|
|
|
+ wifi_state_imagev.visibility = View.GONE
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (NetHelper.isBTConnected()) {
|
|
|
|
+ bluetooth_state_imagev.visibility = View.VISIBLE
|
|
|
|
+ bluetooth_state_imagev.setImageResource(R.drawable.ic_bt_success)
|
|
|
|
+ } else {
|
|
|
|
+ bluetooth_state_imagev.visibility = View.GONE
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private fun updateTcpState() {
|
|
|
|
+ if (Constants.tcp_connected) {
|
|
|
|
+ tcp_state_imagev.setImageResource(R.drawable.ic_tcp_success)
|
|
|
|
+ } else {
|
|
|
|
+ tcp_state_imagev.setImageResource(R.drawable.ic_tcp_fail)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
fun onMoonEvent(messageEvent: MessageEvent) {
|
|
fun onMoonEvent(messageEvent: MessageEvent) {
|
|
@@ -657,6 +693,11 @@ fun call(tyte:Int){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //TCP连接状态
|
|
|
|
+ Constants.EVENT_TCP_STATE -> {
|
|
|
|
+ updateTcpState()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|