|
@@ -70,6 +70,8 @@ import kotlinx.android.synthetic.main.callingdoor_main_lay.room_action_more
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay.room_action_power_reset
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay.room_action_power_reset
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay.tv_room_name
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay.tv_room_name
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay.view_flipper
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay.view_flipper
|
|
|
|
+import kotlinx.android.synthetic.main.callingdoor_main_lay.room_actions
|
|
|
|
+import kotlinx.android.synthetic.main.callingdoor_main_lay.ll_room_name
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay_rk3288.*
|
|
import kotlinx.android.synthetic.main.callingdoor_main_lay_rk3288.*
|
|
import kotlinx.android.synthetic.main.view_bed_name.*
|
|
import kotlinx.android.synthetic.main.view_bed_name.*
|
|
import kotlinx.android.synthetic.main.view_title_layout.*
|
|
import kotlinx.android.synthetic.main.view_title_layout.*
|
|
@@ -146,6 +148,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
private var netErrCount : Int = 0
|
|
private var netErrCount : Int = 0
|
|
|
|
|
|
override fun getLayId(): Int {
|
|
override fun getLayId(): Int {
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom") {
|
|
|
|
+ setTheme(R.style.MomAppTheme)
|
|
|
|
+ }
|
|
|
|
+
|
|
if ("rk3288".equals(Build.MODEL)) {
|
|
if ("rk3288".equals(Build.MODEL)) {
|
|
return R.layout.callingdoor_main_lay_rk3288
|
|
return R.layout.callingdoor_main_lay_rk3288
|
|
} else {
|
|
} else {
|
|
@@ -249,6 +255,15 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
view_title_layout_tv_point.text = "rtc"
|
|
view_title_layout_tv_point.text = "rtc"
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom") {
|
|
|
|
+ //隐藏按钮
|
|
|
|
+ room_actions.visibility = View.GONE
|
|
|
|
+ ll_call_view.visibility = View.GONE
|
|
|
|
+
|
|
|
|
+ ll_room_name.setBackgroundResource(R.mipmap.room_bg_girl)
|
|
|
|
+ tv_room_name.setTextColor(Color.WHITE)
|
|
|
|
+ }
|
|
|
|
+
|
|
//presenter.loadTcpServerHost()
|
|
//presenter.loadTcpServerHost()
|
|
//注册广播
|
|
//注册广播
|
|
regReceiver()
|
|
regReceiver()
|
|
@@ -585,7 +600,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
} else {
|
|
} else {
|
|
tv_room_name.text = Constant.ROOM_NAME + " " + Constant.NursingTitle + "..."
|
|
tv_room_name.text = Constant.ROOM_NAME + " " + Constant.NursingTitle + "..."
|
|
}
|
|
}
|
|
- tv_room_name.setTextColor(resources.getColor(R.color.nursing_color))
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE != "mom") {
|
|
|
|
+ tv_room_name.setTextColor(resources.getColor(R.color.nursing_color))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private fun exitNursing() {
|
|
private fun exitNursing() {
|
|
@@ -596,14 +613,20 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//room_action_nurse.text = "进入护理"
|
|
//room_action_nurse.text = "进入护理"
|
|
room_action_nurse.setBackgroundResource(R.mipmap.bg_bottom_btn)
|
|
room_action_nurse.setBackgroundResource(R.mipmap.bg_bottom_btn)
|
|
tv_room_name.text = Constant.ROOM_NAME
|
|
tv_room_name.text = Constant.ROOM_NAME
|
|
- tv_room_name.setTextColor(resources.getColor(R.color.main_color))
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE != "mom") {
|
|
|
|
+ tv_room_name.setTextColor(resources.getColor(R.color.main_color))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
override fun bindEvent() {
|
|
override fun bindEvent() {
|
|
room_action_home.setOnClickListener {
|
|
room_action_home.setOnClickListener {
|
|
if (mainFragment != curFragment) {
|
|
if (mainFragment != curFragment) {
|
|
if (initialized && Constant.DEVICE_STATUS != 0) {
|
|
if (initialized && Constant.DEVICE_STATUS != 0) {
|
|
- switchFragment(R.id.callingdoor_main_frame, MainFragment(), mainFragment)
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom") {
|
|
|
|
+ switchFragment(R.id.callingdoor_main_frame, YzMainFragment(), mainFragment)
|
|
|
|
+ } else {
|
|
|
|
+ switchFragment(R.id.callingdoor_main_frame, MainFragment(), mainFragment)
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
showMessage(R.string.data_empty)
|
|
showMessage(R.string.data_empty)
|
|
}
|
|
}
|
|
@@ -1031,7 +1054,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
override fun showDeviceInfo(deviceInfo: DeviceRoomInfoVO) {
|
|
override fun showDeviceInfo(deviceInfo: DeviceRoomInfoVO) {
|
|
//显示床位信息界面
|
|
//显示床位信息界面
|
|
if (!mainFragment.equals(curFragment)) {
|
|
if (!mainFragment.equals(curFragment)) {
|
|
- switchFragment(R.id.callingdoor_main_frame, MainFragment(), mainFragment)
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom") {
|
|
|
|
+ switchFragment(R.id.callingdoor_main_frame, YzMainFragment(), mainFragment)
|
|
|
|
+ } else {
|
|
|
|
+ switchFragment(R.id.callingdoor_main_frame, MainFragment(), mainFragment)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (deviceInfo.sipId != null) {
|
|
if (deviceInfo.sipId != null) {
|
|
@@ -1060,10 +1087,14 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
if (Constant.DEVICE_STATUS == 0) {
|
|
if (Constant.DEVICE_STATUS == 0) {
|
|
tv_room_name.setText(R.string.device_disable)
|
|
tv_room_name.setText(R.string.device_disable)
|
|
- tv_room_name.setTextColor(resources.getColor(R.color.red_color))
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE != "mom") {
|
|
|
|
+ tv_room_name.setTextColor(resources.getColor(R.color.red_color))
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
tv_room_name.text = Constant.ROOM_NAME
|
|
tv_room_name.text = Constant.ROOM_NAME
|
|
- tv_room_name.setTextColor(resources.getColor(R.color.main_color))
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE != "mom") {
|
|
|
|
+ tv_room_name.setTextColor(resources.getColor(R.color.main_color))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (deviceInfo.frameId != null) {
|
|
if (deviceInfo.frameId != null) {
|
|
@@ -1599,6 +1630,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
switchFragment(R.id.callingdoor_main_frame, QrCodeFragment(), qrFragment)
|
|
switchFragment(R.id.callingdoor_main_frame, QrCodeFragment(), qrFragment)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Constant.EVENT_UPDATE_TITLE -> {
|
|
|
|
+ updateMomTitle()
|
|
|
|
+ }
|
|
|
|
+
|
|
/*Constant.EVENT_REMOVE_CALL_BED -> {
|
|
/*Constant.EVENT_REMOVE_CALL_BED -> {
|
|
room_action_call_bed.visibility = View.GONE
|
|
room_action_call_bed.visibility = View.GONE
|
|
room_cancel_call.visibility = View.GONE
|
|
room_cancel_call.visibility = View.GONE
|
|
@@ -1771,6 +1806,41 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private fun updateMomTitle() {
|
|
|
|
+ if (Constant.babyGirl) {
|
|
|
|
+ ll_room_name.setBackgroundResource(R.mipmap.room_bg_girl)
|
|
|
|
+ rl_activity_main_view.setBackgroundResource(R.color.main_bg_color_girl)
|
|
|
|
+ view_title_layout_tv_hospital_name.setTextColor(Constant.colorGirl)
|
|
|
|
+ view_title_clock.setTextColor(Constant.colorGirl)
|
|
|
|
+ view_title_layout_tv_no.setTextColor(Constant.colorGirl)
|
|
|
|
+ } else {
|
|
|
|
+ ll_room_name.setBackgroundResource(R.mipmap.room_bg_boy)
|
|
|
|
+ rl_activity_main_view.setBackgroundResource(R.color.main_bg_color_boy)
|
|
|
|
+ view_title_layout_tv_hospital_name.setTextColor(Constant.colorBoy)
|
|
|
|
+ view_title_clock.setTextColor(Constant.colorBoy)
|
|
|
|
+ view_title_layout_tv_no.setTextColor(Constant.colorBoy)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Constant.day_state == 1) {
|
|
|
|
+ //晚上
|
|
|
|
+ if (Constant.babyGirl) {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night_red)
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //白天
|
|
|
|
+ if (Constant.babyGirl) {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight_red)
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ updateNetState()
|
|
|
|
+ updateTcpState()
|
|
|
|
+ }
|
|
|
|
+
|
|
private fun updateStatus(state: String) {
|
|
private fun updateStatus(state: String) {
|
|
this.runOnUiThread {
|
|
this.runOnUiThread {
|
|
when (state) {
|
|
when (state) {
|
|
@@ -1788,18 +1858,34 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
|
|
|
|
private fun updateNetState() {
|
|
private fun updateNetState() {
|
|
- if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_WIFI) {
|
|
|
|
- view_title_layout_iv_wifi.visibility = View.VISIBLE
|
|
|
|
- view_title_layout_iv_wifi.setImageResource(R.mipmap.ic_wifi_success)
|
|
|
|
- view_title_layout_iv_ethernet.visibility = View.GONE
|
|
|
|
- } else if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_ETHERNET) {
|
|
|
|
- view_title_layout_iv_ethernet.visibility = View.VISIBLE
|
|
|
|
- view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_success)
|
|
|
|
- view_title_layout_iv_wifi.visibility = View.GONE
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom" && Constant.babyGirl) {
|
|
|
|
+ if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_WIFI) {
|
|
|
|
+ view_title_layout_iv_wifi.visibility = View.VISIBLE
|
|
|
|
+ view_title_layout_iv_wifi.setImageResource(R.mipmap.ic_wifi_success_red)
|
|
|
|
+ view_title_layout_iv_ethernet.visibility = View.GONE
|
|
|
|
+ } else if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_ETHERNET) {
|
|
|
|
+ view_title_layout_iv_ethernet.visibility = View.VISIBLE
|
|
|
|
+ view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_success_red)
|
|
|
|
+ view_title_layout_iv_wifi.visibility = View.GONE
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_iv_ethernet.visibility = View.VISIBLE
|
|
|
|
+ view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_fail)
|
|
|
|
+ view_title_layout_iv_wifi.visibility = View.GONE
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- view_title_layout_iv_ethernet.visibility = View.VISIBLE
|
|
|
|
- view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_fail)
|
|
|
|
- view_title_layout_iv_wifi.visibility = View.GONE
|
|
|
|
|
|
+ if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_WIFI) {
|
|
|
|
+ view_title_layout_iv_wifi.visibility = View.VISIBLE
|
|
|
|
+ view_title_layout_iv_wifi.setImageResource(R.mipmap.ic_wifi_success)
|
|
|
|
+ view_title_layout_iv_ethernet.visibility = View.GONE
|
|
|
|
+ } else if (NetHelper.getInstance().networkType == ConnectivityManager.TYPE_ETHERNET) {
|
|
|
|
+ view_title_layout_iv_ethernet.visibility = View.VISIBLE
|
|
|
|
+ view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_success)
|
|
|
|
+ view_title_layout_iv_wifi.visibility = View.GONE
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_iv_ethernet.visibility = View.VISIBLE
|
|
|
|
+ view_title_layout_iv_ethernet.setImageResource(R.mipmap.ic_ethernet_fail)
|
|
|
|
+ view_title_layout_iv_wifi.visibility = View.GONE
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1846,7 +1932,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
private fun updateTcpState() {
|
|
private fun updateTcpState() {
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.TCP_CONNECTED) {
|
|
- view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_success)
|
|
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom" && Constant.babyGirl) {
|
|
|
|
+ view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_success_red)
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_success)
|
|
|
|
+ }
|
|
view_title_layout_tv_point.setBackgroundResource(R.color.green)
|
|
view_title_layout_tv_point.setBackgroundResource(R.color.green)
|
|
} else {
|
|
} else {
|
|
view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_fail)
|
|
view_title_layout_iv_tcp.setImageResource(R.mipmap.ic_tcp_fail)
|
|
@@ -1877,7 +1967,12 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//设置白天系统音量和响铃音
|
|
//设置白天系统音量和响铃音
|
|
VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
|
|
VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
|
|
VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
|
|
VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
|
|
- view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight)
|
|
|
|
|
|
+
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom" && Constant.babyGirl) {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight_red)
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_daylight)
|
|
|
|
+ }
|
|
|
|
|
|
//灭掉紧急按钮灯
|
|
//灭掉紧急按钮灯
|
|
AppTool.Time.delay(2000) {
|
|
AppTool.Time.delay(2000) {
|
|
@@ -1890,14 +1985,19 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
if (Constant.day_state != 1 || forceSet) {
|
|
if (Constant.day_state != 1 || forceSet) {
|
|
//设置晚上亮度
|
|
//设置晚上亮度
|
|
if ("mk_h10_a133_1".equals(BuildConfig.APP_DEVICE_TYPE)) {
|
|
if ("mk_h10_a133_1".equals(BuildConfig.APP_DEVICE_TYPE)) {
|
|
- zhylManager.disp_setLcdBackLight(getContentResolver(),Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt(),1)
|
|
|
|
|
|
+ zhylManager.disp_setLcdBackLight(getContentResolver(),Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt(),1)
|
|
}else{
|
|
}else{
|
|
ScreenManagerUtil().setScreenBrightness(this, Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt())
|
|
ScreenManagerUtil().setScreenBrightness(this, Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt())
|
|
}
|
|
}
|
|
//设置晚上系统音量和响铃音
|
|
//设置晚上系统音量和响铃音
|
|
VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorNightSystemVolume(this))
|
|
VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorNightSystemVolume(this))
|
|
VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorNightSystemVolume(this))
|
|
VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorNightSystemVolume(this))
|
|
- view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night)
|
|
|
|
|
|
+
|
|
|
|
+ if (BuildConfig.UI_TYPE == "mom" && Constant.babyGirl) {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night_red)
|
|
|
|
+ } else {
|
|
|
|
+ view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night)
|
|
|
|
+ }
|
|
|
|
|
|
//打开紧急按钮灯
|
|
//打开紧急按钮灯
|
|
AppTool.Time.delay(2000) {
|
|
AppTool.Time.delay(2000) {
|