|
@@ -39,11 +39,6 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
|
|
|
}
|
|
|
|
|
|
override fun init() {
|
|
|
- if (!TextUtils.isEmpty(Constant.BED_NAME)) {
|
|
|
- //床位名称
|
|
|
- tv_bed_name.text = Constant.BED_NAME
|
|
|
- }
|
|
|
-
|
|
|
updateInfo()
|
|
|
}
|
|
|
|
|
@@ -69,8 +64,6 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
|
|
|
//隐藏空页面并展示入住信息
|
|
|
ll_empty.visibility = View.GONE
|
|
|
ll_custom_view.visibility = View.VISIBLE
|
|
|
- //床位名称
|
|
|
- tv_bed_name.text = Constant.BED_NAME
|
|
|
|
|
|
//显示入住信息
|
|
|
tv_custom_name.text = customInfo.named
|
|
@@ -126,6 +119,14 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
|
|
|
}
|
|
|
|
|
|
fun updateInfo() {
|
|
|
+ if (Constant.DEVICE_STATUS == 0) {
|
|
|
+ tv_bed_name.text = "设备未启用"
|
|
|
+ tv_bed_name.setTextColor(resources.getColor(R.color.red_color))
|
|
|
+ } else {
|
|
|
+ tv_bed_name.text = Constant.BED_NAME
|
|
|
+ tv_bed_name.setTextColor(resources.getColor(R.color.main_color))
|
|
|
+ }
|
|
|
+
|
|
|
if (Constant.CUSTOM_ID != -1) {
|
|
|
ll_empty.visibility = View.GONE
|
|
|
presenter.loadCustomInfo(Constant.CUSTOM_ID)
|