Prechádzať zdrojové kódy

祁阳门口机界面修改

weizhengliang 1 rok pred
rodič
commit
df965dd5e4

+ 2 - 2
app/src/main/AndroidManifest.xml

@@ -32,9 +32,9 @@
         android:networkSecurityConfig="@xml/network_security_config"
         android:name="com.wdkl.app.ncs.application.Application"
         android:theme="@style/MyAppTheme">
-        <meta-data
+        <!--<meta-data
             android:name="com.enation.javashop.imagepluin.cache.MyGlideModule"
-            android:value="GlideModule" />
+            android:value="GlideModule" />-->
         <meta-data
             android:name="design_width_in_dp"
             android:value="1024"/>

+ 2 - 0
callingdoor/src/main/AndroidManifest.xml

@@ -8,6 +8,8 @@
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
     <uses-permission android:name="android.permission.BLUETOOTH"/>
     <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
+    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
 
     <application
         android:allowBackup="true"

+ 5 - 13
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt

@@ -491,7 +491,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
         //room_action_nurse.text = "进入护理"
         room_action_nurse.setBackgroundResource(R.mipmap.bg_bottom_btn)
         tv_room_name.text = Constant.ROOM_NAME
-        tv_room_name.setTextColor(resources.getColor(R.color.main_color))
+        tv_room_name.setTextColor(resources.getColor(R.color.white))
     }
 
     override fun bindEvent() {
@@ -620,6 +620,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
 
             Constant.callNums = 0
             DoorLightHelper.resetDoorLight()
+            EventBus.getDefault().post(MessageEvent("clear_calls", Constant.EVENT_CLEAR_CALLS))
 
             SpeechUtil.getInstance().stopSpeak()
             bedCalls.clear()
@@ -882,7 +883,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
             tv_room_name.setTextColor(resources.getColor(R.color.red_color))
         } else {
             tv_room_name.text = Constant.ROOM_NAME
-            tv_room_name.setTextColor(resources.getColor(R.color.main_color))
+            tv_room_name.setTextColor(resources.getColor(R.color.white))
         }
 
         if (deviceInfo.frameId != null) {
@@ -943,15 +944,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                 room_action_nurse.visibility = View.GONE
             }
 
-            //益阳妇幼去掉呼叫床位功能
-            if (partSetting.roomCallBed != null && partSetting.roomCallBed == 0) {
-                room_action_call_bed.visibility = View.GONE
-                //room_cancel_call.visibility = View.GONE
-            } else {
-                room_action_call_bed.visibility = View.VISIBLE
-                //room_cancel_call.visibility = View.VISIBLE
-            }
-
             if (partSetting.boolDoorLightAlwaysOn != null && partSetting.boolDoorLightAlwaysOn == 1) {
                 SettingConfig.setDoorLightAlwaysOn(activity, 1)
             } else {
@@ -963,13 +955,13 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                 Constant.nursingColor = partSetting.nursingColorRgb
             }
 
-            if (partSetting.powerControl != null) {
+            /*if (partSetting.powerControl != null) {
                 Constant.POWER_RESET = partSetting.powerControl
             }
 
             if (Constant.POWER_RESET) {
                 room_action_power_reset.visibility = View.VISIBLE
-            }
+            }*/
 
         } catch (ex: Exception) {
             showMessage(StringUtil.getResString(R.string.setting_params_error) + ex.message)

+ 167 - 304
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/adapter/FrameRoomAdapter.kt

@@ -3,96 +3,73 @@ package com.wdkl.app.ncs.callingdoor.adapter
 import android.content.Context
 import android.graphics.Color
 import android.graphics.drawable.Drawable
-import android.os.Build
 import android.support.v7.widget.RecyclerView
 import android.text.TextUtils
 import android.util.Log
+import android.view.Gravity
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import android.view.animation.AlphaAnimation
+import android.view.animation.Animation
+import android.view.animation.LinearInterpolator
 import android.widget.ImageView
 import android.widget.LinearLayout
 import android.widget.TextView
+import com.bumptech.glide.Glide
+import com.bumptech.glide.load.engine.DiskCacheStrategy
 import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.ncs.android.lib.utils.DensityUtils
 import com.wdkl.ncs.android.middleware.common.Constant
 import com.wdkl.ncs.android.middleware.model.dto.NurseConfigDto
 import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO
 import com.wdkl.ncs.android.middleware.utils.CommonUtils
-import com.wdkl.ncs.android.middleware.utils.StringUtil
 
 class FrameRoomAdapter : RecyclerView.Adapter<FrameRoomAdapter.BedViewHolder> {
 
     private var context: Context
     private var data: ArrayList<FrameBedVO>
     private var configList = ArrayList<NurseConfigDto>()
+    private var flickBedNames = ArrayList<String>()
 
     private var drawableMale: Drawable
     private var drawableFemale: Drawable
     private var drawableEmpty: Drawable
-    private var iconMale: Drawable
-    private var iconFemale: Drawable
+    //private var iconMale: Drawable
+    //private var iconFemale: Drawable
 
     constructor(context: Context, data: ArrayList<FrameBedVO>) {
         this.context = context
         this.data = data
 
-        if ("rk3288".equals(Build.MODEL)) {
-            drawableEmpty = context.resources.getDrawable(R.mipmap.ic_custom_empty2)
-            drawableEmpty.setBounds(0, 0, drawableEmpty.minimumWidth, drawableEmpty.minimumHeight)
-            drawableMale = context.resources.getDrawable(R.mipmap.ic_custom_male2)
-            drawableMale.setBounds(0, 0, drawableMale.minimumWidth, drawableMale.minimumHeight)
-            drawableFemale = context.resources.getDrawable(R.mipmap.ic_custom_female2)
-            drawableFemale.setBounds(0, 0, drawableFemale.minimumWidth, drawableFemale.minimumHeight)
-            iconMale = context.resources.getDrawable(R.mipmap.ic_gender_male2)
-            iconMale.setBounds(0, 0, iconMale.minimumWidth, iconMale.minimumHeight)
-            iconFemale = context.resources.getDrawable(R.mipmap.ic_gender_female2)
-            iconFemale.setBounds(0, 0, iconFemale.minimumWidth, iconFemale.minimumHeight)
-        } else {
-            drawableEmpty = context.resources.getDrawable(R.mipmap.ic_custom_empty)
-            drawableEmpty.setBounds(0, 0, drawableEmpty.minimumWidth, drawableEmpty.minimumHeight)
-            drawableMale = context.resources.getDrawable(R.mipmap.ic_custom_male)
-            drawableMale.setBounds(0, 0, drawableMale.minimumWidth, drawableMale.minimumHeight)
-            drawableFemale = context.resources.getDrawable(R.mipmap.ic_custom_female)
-            drawableFemale.setBounds(0, 0, drawableFemale.minimumWidth, drawableFemale.minimumHeight)
-            iconMale = context.resources.getDrawable(R.mipmap.ic_gender_male)
-            iconMale.setBounds(0, 0, iconMale.minimumWidth, iconMale.minimumHeight)
-            iconFemale = context.resources.getDrawable(R.mipmap.ic_gender_female)
-            iconFemale.setBounds(0, 0, iconFemale.minimumWidth, iconFemale.minimumHeight)
-        }
+        drawableEmpty = context.resources.getDrawable(R.mipmap.ic_custom_empty)
+        drawableEmpty.setBounds(0, 0, drawableEmpty.minimumWidth, drawableEmpty.minimumHeight)
+        drawableMale = context.resources.getDrawable(R.mipmap.ic_custom_male)
+        drawableMale.setBounds(0, 0, drawableMale.minimumWidth, drawableMale.minimumHeight)
+        drawableFemale = context.resources.getDrawable(R.mipmap.ic_custom_female)
+        drawableFemale.setBounds(0, 0, drawableFemale.minimumWidth, drawableFemale.minimumHeight)
+        //iconMale = context.resources.getDrawable(R.mipmap.ic_gender_male)
+        //iconMale.setBounds(0, 0, iconMale.minimumWidth, iconMale.minimumHeight)
+        //iconFemale = context.resources.getDrawable(R.mipmap.ic_gender_female)
+        //iconFemale.setBounds(0, 0, iconFemale.minimumWidth, iconFemale.minimumHeight)
     }
 
     override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BedViewHolder {
-        if ("rk3288".equals(Build.MODEL)) {
-            if (Constant.DEVICE_HEIGHT == 1280 && Constant.DEVICE_WIDTH == 800) {
-                val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_bed_rk3288_800, parent, false)
-                return BedViewHolder(view)
-            } else {
-                val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_bed_rk3288, parent, false)
-                return BedViewHolder(view)
-            }
-        } else {
-            val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_bed, parent, false)
-            return BedViewHolder(view)
-        }
+        val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_bed, parent, false)
+        return BedViewHolder(view)
     }
 
     override fun onBindViewHolder(holder: BedViewHolder, position: Int) {
         try {
-            initDefaultNursingConfigs()
             val pos = position % data.size
-
-            if ("rk3288".equals(Build.MODEL)) {
-                showBedInfoRk3288(holder, data.get(pos))
-            } else {
-                showBedInfo(holder, data.get(pos))
-            }
+            showBedInfo(holder, data.get(pos))
         } catch (e: Exception) {
             e.printStackTrace()
         }
     }
 
     override fun getItemCount(): Int {
-        if (data.size <= 3) {
+        if (data.size <= 2) {
             return data.size
         } else {
             return Int.MAX_VALUE
@@ -104,286 +81,187 @@ class FrameRoomAdapter : RecyclerView.Adapter<FrameRoomAdapter.BedViewHolder> {
         notifyDataSetChanged()
     }
 
-    private fun initDefaultNursingConfigs() {
-        //初始化默认护理项
-        configList.clear()
-        for (index in 1..5) {
-            var item = NurseConfigDto()
-            item.nurseConfigName = StringUtil.getResString(R.string.default_nurse_config_name)
-            item.nurseOptionName = StringUtil.getResString(R.string.str_empty)
-            item.nurseColorRbg = "D7D7D7"
-            configList.add(item)
-        }
-    }
-
     private fun showBedInfo(holder: BedViewHolder, bedVO: FrameBedVO) {
-        holder.bedName.text = CommonUtils.subStringAfter(bedVO.frameBed.fullName, "-")
-        if (TextUtils.isEmpty(bedVO.cardNo)) {
-            holder.cardNo.text = ""
-        } else {
-            holder.cardNo.text = StringUtil.getResString(R.string.card_no) + bedVO.cardNo
-        }
-
-        if (TextUtils.isEmpty(bedVO.customerName)) {
-            //空床位
-            holder.customName.setText(R.string.str_empty)
-            holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
-            holder.customAge.visibility = View.GONE
-            holder.doctorIcon.visibility = View.GONE
-            holder.doctorTitle.visibility = View.GONE
-            holder.doctorName.visibility = View.GONE
-            holder.nurseIcon.visibility = View.GONE
-            holder.nurseTitle.visibility = View.GONE
-            holder.nurseName.visibility = View.GONE
-        } else {
-            //有入住
-            holder.customName.text = bedVO.customerName
-            holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
-            holder.customAge.visibility = View.VISIBLE
-            holder.customAge.text = "" + bedVO.customerAge + bedVO.customerAgeUnit
-            if (bedVO.customerSex == 0) {
-                holder.customName.setCompoundDrawables(null, drawableFemale, null, null)
-                holder.customAge.setCompoundDrawables(iconFemale, null, null, null)
-            } else if (bedVO.customerSex == 1) {
-                holder.customName.setCompoundDrawables(null, drawableMale, null, null)
-                holder.customAge.setCompoundDrawables(iconMale, null, null, null)
-            } else {
-                holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
-                holder.customAge.setCompoundDrawables(null, null, null, null)
-            }
-            holder.doctorName.text = bedVO.doctorName
-            holder.nurseName.text = bedVO.nurseName
-
-            if (!TextUtils.isEmpty(Constant.doctorTitle)) {
-                holder.doctorTitle.text = Constant.doctorTitle
+        try {
+            val name = CommonUtils.subStringAfter(bedVO.frameBed.fullName, "-")
+            holder.bedName.text = name
+            if (TextUtils.isEmpty(bedVO.cardNo)) {
+                holder.cardNo.text = ""
             } else {
-                holder.doctorTitle.setText(R.string.doctor_title)
+                holder.cardNo.text = "住院号: " + bedVO.cardNo
             }
 
-            if (!TextUtils.isEmpty(Constant.nurseTitle)) {
-                holder.nurseTitle.text = Constant.nurseTitle
+            //检查是否有呼叫,更新背景动画效果
+            if (flickBedNames.contains(name)) {
+                Log.e("showBed", "show animator: $name")
+                holder.bedItem.setBackgroundResource(R.color.bed_light_color)
+                holder.bedName.setTextColor(Color.parseColor("#FFFD3B30"))
+                startAnimator(holder.bedName)
             } else {
-                holder.nurseTitle.setText(R.string.nurse_title)
+                Log.e("showBed", "clear animator: $name")
+                holder.bedItem.setBackgroundResource(R.color.right_item_select)
+                holder.bedName.setTextColor(Color.parseColor("#2F9DF1"))
+                clearAnimator(holder.bedName)
             }
 
-            if (Constant.doctorValid == 1) {
-                holder.doctorIcon.visibility = View.VISIBLE
-                holder.doctorTitle.visibility = View.VISIBLE
-                holder.doctorName.visibility = View.VISIBLE
+            /*if (data.size == 1) {
+                val layoutParams = LinearLayout.LayoutParams(DensityUtils.dp2px(context, 392f), ViewGroup.LayoutParams.MATCH_PARENT)
+                layoutParams.setMargins(214, 4, 4, 4)
+                layoutParams.gravity = Gravity.CENTER
+                holder.bedItem.setLayoutParams(layoutParams)
             } else {
+                val layoutParams = LinearLayout.LayoutParams(DensityUtils.dp2px(context, 392f), ViewGroup.LayoutParams.MATCH_PARENT)
+                layoutParams.setMargins(4, 4, 4, 4)
+                layoutParams.gravity = Gravity.CENTER
+                holder.bedItem.setLayoutParams(layoutParams)
+            }*/
+
+            if (TextUtils.isEmpty(bedVO.customerName)) {
+                //空床位
+                holder.customName.setText("空床位")
+                //holder.customName.setCompoundDrawables(drawableEmpty, null, null, null)
+                holder.customAge.visibility = View.GONE
                 holder.doctorIcon.visibility = View.GONE
                 holder.doctorTitle.visibility = View.GONE
                 holder.doctorName.visibility = View.GONE
-            }
-
-            if (Constant.nurseValid == 1) {
-                holder.nurseIcon.visibility = View.VISIBLE
-                holder.nurseTitle.visibility = View.VISIBLE
-                holder.nurseName.visibility = View.VISIBLE
-            } else {
                 holder.nurseIcon.visibility = View.GONE
                 holder.nurseTitle.visibility = View.GONE
                 holder.nurseName.visibility = View.GONE
-            }
+            } else {
+                //有入住
+                holder.customName.text = bedVO.customerName
+                //holder.customName.setCompoundDrawables(drawableEmpty, null, null, null)
+                holder.customAge.visibility = View.VISIBLE
+                //holder.customAge.text = "" + bedVO.customerAge + bedVO.customerAgeUnit
+                if (bedVO.customerSex == 0) {
+                    //holder.customName.setCompoundDrawables(drawableFemale, null, null, null)
+                    //holder.customAge.setCompoundDrawables(iconFemale, null, null, null)
+                    holder.customAge.text = "女 " + bedVO.customerAge + bedVO.customerAgeUnit
+                } else if (bedVO.customerSex == 1) {
+                    //holder.customName.setCompoundDrawables(drawableMale, null, null, null)
+                    //holder.customAge.setCompoundDrawables(iconMale, null, null, null)
+                    holder.customAge.text = "男 " + bedVO.customerAge + bedVO.customerAgeUnit
+                } else {
+                    //holder.customName.setCompoundDrawables(drawableEmpty, null, null, null)
+                    //holder.customAge.setCompoundDrawables(null, null, null, null)
+                    holder.customAge.text = "" + bedVO.customerAge + bedVO.customerAgeUnit
+                }
+                holder.doctorName.text = bedVO.doctorName
+                holder.nurseName.text = bedVO.nurseName
 
-            val nursingConfigs = bedVO.nurseConfigDtos
-            if (nursingConfigs != null && nursingConfigs.size > 0) {
-                for ((index, e) in nursingConfigs.withIndex()) {
-                    if (index < configList.size) {
-                        configList.set(index, e)
-                    } else {
-                        configList.add(e)
-                    }
+                if (!TextUtils.isEmpty(Constant.doctorTitle)) {
+                    holder.doctorTitle.text = Constant.doctorTitle
+                } else {
+                    holder.doctorTitle.setText("责任医生")
                 }
-            }
-        }
 
+                if (!TextUtils.isEmpty(Constant.nurseTitle)) {
+                    holder.nurseTitle.text = Constant.nurseTitle
+                } else {
+                    holder.nurseTitle.setText("责任护士")
+                }
 
-        if (StringUtil.notEmpty(configList[0].nurseColorRbg)) {
-            holder.nursingColor1.setBackgroundColor(Color.parseColor("#" + configList[0].nurseColorRbg))
-        } else {
-            holder.nursingColor1.setBackgroundColor(Color.parseColor("#D7D7D7"))
-        }
-        holder.nursingName1.setText(configList[0].nurseConfigName)
-        holder.nursingValue1.setText(configList[0].nurseOptionName)
+                if (Constant.doctorValid == 1) {
+                    holder.doctorIcon.visibility = View.VISIBLE
+                    holder.doctorTitle.visibility = View.VISIBLE
+                    holder.doctorName.visibility = View.VISIBLE
+
+                    Glide.with(context)
+                        .load(bedVO.doctorFace)
+                        //.skipMemoryCache(true)
+                        .diskCacheStrategy(DiskCacheStrategy.NONE)
+                        .placeholder(R.mipmap.doctor_default)//占位图
+                        .into(holder.doctorIcon)
+                } else {
+                    holder.doctorIcon.visibility = View.GONE
+                    holder.doctorTitle.visibility = View.GONE
+                    holder.doctorName.visibility = View.GONE
+                }
 
-        if (StringUtil.notEmpty(configList[1].nurseColorRbg)) {
-            holder.nursingColor2.setBackgroundColor(Color.parseColor("#" + configList[1].nurseColorRbg))
-        } else {
-            holder.nursingColor2.setBackgroundColor(Color.parseColor("#D7D7D7"))
+                if (Constant.nurseValid == 1) {
+                    holder.nurseIcon.visibility = View.VISIBLE
+                    holder.nurseTitle.visibility = View.VISIBLE
+                    holder.nurseName.visibility = View.VISIBLE
+
+                    Glide.with(context)
+                        .load(bedVO.nurseFace)
+                        //.skipMemoryCache(true)
+                        .diskCacheStrategy(DiskCacheStrategy.NONE)
+                        .placeholder(R.mipmap.nurse_default)//占位图
+                        .into(holder.nurseIcon)
+                } else {
+                    holder.nurseIcon.visibility = View.GONE
+                    holder.nurseTitle.visibility = View.GONE
+                    holder.nurseName.visibility = View.GONE
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
         }
-        holder.nursingName2.setText(configList[1].nurseConfigName)
-        holder.nursingValue2.setText(configList[1].nurseOptionName)
+    }
 
-        if (StringUtil.notEmpty(configList[2].nurseColorRbg)) {
-            holder.nursingColor3.setBackgroundColor(Color.parseColor("#" + configList[2].nurseColorRbg))
-        } else {
-            holder.nursingColor3.setBackgroundColor(Color.parseColor("#D7D7D7"))
+    override fun onViewRecycled(holder: BedViewHolder?) {
+        if (holder != null) {
+            Glide.clear(holder.doctorIcon)
+            Glide.clear(holder.nurseIcon)
         }
-        holder.nursingName3.setText(configList[2].nurseConfigName)
-        holder.nursingValue3.setText(configList[2].nurseOptionName)
+        super.onViewRecycled(holder)
+    }
 
-        if (StringUtil.notEmpty(configList[3].nurseColorRbg)) {
-            holder.nursingColor4.setBackgroundColor(Color.parseColor("#" + configList[3].nurseColorRbg))
-        } else {
-            holder.nursingColor4.setBackgroundColor(Color.parseColor("#D7D7D7"))
-        }
-        holder.nursingName4.setText(configList[3].nurseConfigName)
-        holder.nursingValue4.setText(configList[3].nurseOptionName)
+    private fun startAnimator(view: View) {
+        /*val animator: ValueAnimator = ObjectAnimator.ofInt(view, "backgroundColor", 0x22ff0000, 0x77ff0000) //对背景色颜色进行改变,操作的属性为"backgroundColor",此处必须这样写,不能全小写,后面的颜色为在对应颜色间进行渐变
+        animator.duration = 1500
+        animator.repeatCount = ValueAnimator.INFINITE //表示重复多次
+        animator.repeatMode = ValueAnimator.REVERSE //表示动画结束后,反过来再执行;RESTART表示从头开始,REVERSE表示从末尾倒播
+        animator.setEvaluator(ArgbEvaluator()) //如果要颜色渐变必须要ArgbEvaluator,来实现颜色之间的平滑变化,否则会出现颜色不规则跳动
+        animator.start()*/
+
+
+        val alphaAnimation = AlphaAnimation(1.0f, 0.1f)
+        alphaAnimation.duration = 1500
+        alphaAnimation.interpolator = LinearInterpolator()
+        alphaAnimation.repeatCount = Animation.INFINITE //表示重复多次
+        alphaAnimation.repeatMode = Animation.REVERSE //表示动画结束后,反过来再执行;RESTART表示从头开始,REVERSE表示从末尾倒播
+        view.startAnimation(alphaAnimation)
+    }
 
-        if (StringUtil.notEmpty(configList[4].nurseColorRbg)) {
-            holder.nursingColor5.setBackgroundColor(Color.parseColor("#" + configList[4].nurseColorRbg))
-        } else {
-            holder.nursingColor5.setBackgroundColor(Color.parseColor("#D7D7D7"))
-        }
-        holder.nursingName5.setText(configList[4].nurseConfigName)
-        holder.nursingValue5.setText(configList[4].nurseOptionName)
+    private fun clearAnimator(view: View) {
+        view.clearAnimation()
     }
 
-    private fun showBedInfoRk3288(holder: BedViewHolder, bedVO: FrameBedVO) {
-        holder.bedName.text = CommonUtils.subStringAfter(bedVO.frameBed.fullName, "-")
-        if (TextUtils.isEmpty(bedVO.cardNo)) {
-            holder.cardNo.text = ""
-        } else {
-            holder.cardNo.text = StringUtil.getResString(R.string.card_no) + bedVO.cardNo
+    fun addFlickBedItem(name: String) {
+        synchronized(flickBedNames) {
+            flickBedNames.add(name)
+            notifyDataSetChanged()
         }
+    }
 
-        if (TextUtils.isEmpty(bedVO.customerName)) {
-            //空床位
-            holder.customName.setText(R.string.str_empty)
-            holder.customName.setCompoundDrawables(drawableEmpty, null, null, null)
-            holder.customAge.visibility = View.GONE
-            holder.doctorIcon.visibility = View.GONE
-            holder.doctorTitle.visibility = View.GONE
-            holder.doctorName.visibility = View.GONE
-            holder.nurseIcon.visibility = View.GONE
-            holder.nurseTitle.visibility = View.GONE
-            holder.nurseName.visibility = View.GONE
-        } else {
-            //有入住
-            holder.customName.text = bedVO.customerName
-            holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
-            holder.customAge.visibility = View.VISIBLE
-            holder.customAge.text = "" + bedVO.customerAge + bedVO.customerAgeUnit
-            if (bedVO.customerSex == 0) {
-                holder.customName.setCompoundDrawables(drawableFemale, null, null, null)
-                holder.customAge.setCompoundDrawables(iconFemale, null, null, null)
-            } else if (bedVO.customerSex == 1) {
-                holder.customName.setCompoundDrawables(drawableMale, null, null, null)
-                holder.customAge.setCompoundDrawables(iconMale, null, null, null)
-            } else {
-                holder.customName.setCompoundDrawables(drawableEmpty, null, null, null)
-                holder.customAge.setCompoundDrawables(null, null, null, null)
-            }
-            holder.doctorName.text = bedVO.doctorName
-            holder.nurseName.text = bedVO.nurseName
-
-            if (!TextUtils.isEmpty(Constant.doctorTitle)) {
-                holder.doctorTitle.text = Constant.doctorTitle
-            } else {
-                holder.doctorTitle.setText(R.string.doctor_title)
-            }
-
-            if (!TextUtils.isEmpty(Constant.nurseTitle)) {
-                holder.nurseTitle.text = Constant.nurseTitle
-            } else {
-                holder.nurseTitle.setText(R.string.nurse_title)
-            }
-
-            if (Constant.doctorValid == 1) {
-                holder.doctorIcon.visibility = View.VISIBLE
-                holder.doctorTitle.visibility = View.VISIBLE
-                holder.doctorName.visibility = View.VISIBLE
-            } else {
-                holder.doctorIcon.visibility = View.GONE
-                holder.doctorTitle.visibility = View.GONE
-                holder.doctorName.visibility = View.GONE
-            }
-
-            if (Constant.nurseValid == 1) {
-                holder.nurseIcon.visibility = View.VISIBLE
-                holder.nurseTitle.visibility = View.VISIBLE
-                holder.nurseName.visibility = View.VISIBLE
-            } else {
-                holder.nurseIcon.visibility = View.GONE
-                holder.nurseTitle.visibility = View.GONE
-                holder.nurseName.visibility = View.GONE
-            }
-
-            val nursingConfigs = bedVO.nurseConfigDtos
-            if (nursingConfigs != null && nursingConfigs.size > 0) {
-                for ((index, e) in nursingConfigs.withIndex()) {
-                    if (index < configList.size) {
-                        configList.set(index, e)
-                    } else {
-                        configList.add(e)
+    fun removeFlickBedItem(name: String) {
+        synchronized(flickBedNames) {
+            if (flickBedNames.size > 0) {
+                val iterator = flickBedNames.iterator()
+                while (iterator.hasNext()) {
+                    val it = iterator.next()
+                    if (it == name) {
+                        iterator.remove()
                     }
                 }
             }
+            notifyDataSetChanged()
         }
+    }
 
-
-        if (StringUtil.notEmpty(configList[0].nurseColorRbg)) {
-            holder.nursingColor1.setBackgroundColor(Color.parseColor("#" + configList[0].nurseColorRbg))
-        } else {
-            holder.nursingColor1.setBackgroundColor(Color.parseColor("#D7D7D7"))
-        }
-        holder.nursingName1.setText(configList[0].nurseConfigName)
-        holder.nursingValue1.setText(configList[0].nurseOptionName)
-
-        if (StringUtil.notEmpty(configList[1].nurseColorRbg)) {
-            holder.nursingColor2.setBackgroundColor(Color.parseColor("#" + configList[1].nurseColorRbg))
-        } else {
-            holder.nursingColor2.setBackgroundColor(Color.parseColor("#D7D7D7"))
-        }
-        holder.nursingName2.setText(configList[1].nurseConfigName)
-        holder.nursingValue2.setText(configList[1].nurseOptionName)
-
-        if (StringUtil.notEmpty(configList[2].nurseColorRbg)) {
-            holder.nursingColor3.setBackgroundColor(Color.parseColor("#" + configList[2].nurseColorRbg))
-        } else {
-            holder.nursingColor3.setBackgroundColor(Color.parseColor("#D7D7D7"))
-        }
-        holder.nursingName3.setText(configList[2].nurseConfigName)
-        holder.nursingValue3.setText(configList[2].nurseOptionName)
-
-        if (StringUtil.notEmpty(configList[3].nurseColorRbg)) {
-            holder.nursingColor4.setBackgroundColor(Color.parseColor("#" + configList[3].nurseColorRbg))
-        } else {
-            holder.nursingColor4.setBackgroundColor(Color.parseColor("#D7D7D7"))
-        }
-        holder.nursingName4.setText(configList[3].nurseConfigName)
-        holder.nursingValue4.setText(configList[3].nurseOptionName)
-
-        if (StringUtil.notEmpty(configList[4].nurseColorRbg)) {
-            holder.nursingColor5.setBackgroundColor(Color.parseColor("#" + configList[4].nurseColorRbg))
-        } else {
-            holder.nursingColor5.setBackgroundColor(Color.parseColor("#D7D7D7"))
+    fun resetFlickBedItems() {
+        synchronized(flickBedNames) {
+            flickBedNames.clear()
+            notifyDataSetChanged()
         }
-        holder.nursingName5.setText(configList[4].nurseConfigName)
-        holder.nursingValue5.setText(configList[4].nurseOptionName)
     }
 
     class BedViewHolder: RecyclerView.ViewHolder {
+        var bedItem : LinearLayout
         var bedName : TextView
         var cardNo : TextView
-        var nursingColor1 : View
-        var nursingName1 : TextView
-        var nursingValue1 : TextView
-        var nursingColor2 : View
-        var nursingName2 : TextView
-        var nursingValue2 : TextView
-        var nursingColor3 : View
-        var nursingName3 : TextView
-        var nursingValue3 : TextView
-        var nursingColor4 : View
-        var nursingName4 : TextView
-        var nursingValue4 : TextView
-        var nursingColor5 : View
-        var nursingName5 : TextView
-        var nursingValue5 : TextView
-        var nursingView : LinearLayout
-
 
         var customName : TextView
         var customAge : TextView
@@ -395,24 +273,9 @@ class FrameRoomAdapter : RecyclerView.Adapter<FrameRoomAdapter.BedViewHolder> {
         var nurseName : TextView
 
         constructor(itemView: View): super(itemView) {
+            bedItem = itemView.findViewById(R.id.ll_item_bed)
             bedName = itemView.findViewById(R.id.tv_bed_name_title)
             cardNo = itemView.findViewById(R.id.tv_bed_card_no)
-            nursingColor1 = itemView.findViewById(R.id.nurse_config_item_color1)
-            nursingName1 = itemView.findViewById(R.id.nurse_config_item_name1)
-            nursingValue1 = itemView.findViewById(R.id.nurse_config_item_value1)
-            nursingColor2 = itemView.findViewById(R.id.nurse_config_item_color2)
-            nursingName2 = itemView.findViewById(R.id.nurse_config_item_name2)
-            nursingValue2 = itemView.findViewById(R.id.nurse_config_item_value2)
-            nursingColor3 = itemView.findViewById(R.id.nurse_config_item_color3)
-            nursingName3 = itemView.findViewById(R.id.nurse_config_item_name3)
-            nursingValue3 = itemView.findViewById(R.id.nurse_config_item_value3)
-            nursingColor4 = itemView.findViewById(R.id.nurse_config_item_color4)
-            nursingName4 = itemView.findViewById(R.id.nurse_config_item_name4)
-            nursingValue4 = itemView.findViewById(R.id.nurse_config_item_value4)
-            nursingColor5 = itemView.findViewById(R.id.nurse_config_item_color5)
-            nursingName5 = itemView.findViewById(R.id.nurse_config_item_name5)
-            nursingValue5 = itemView.findViewById(R.id.nurse_config_item_value5)
-            nursingView = itemView.findViewById(R.id.ll_nurse_configs)
 
             customName = itemView.findViewById(R.id.bed_customer_name)
             customAge = itemView.findViewById(R.id.bed_customer_age)

+ 22 - 35
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/MainFragment.kt

@@ -5,6 +5,7 @@ import android.support.v7.widget.DefaultItemAnimator
 import android.support.v7.widget.GridLayoutManager
 import android.text.TextUtils
 import com.enation.javashop.net.engine.model.NetState
+import com.google.gson.Gson
 import com.wdkl.app.ncs.callingdoor.R
 import com.wdkl.app.ncs.callingdoor.adapter.FrameRoomAdapter
 import com.wdkl.app.ncs.callingdoor.databinding.MainViewLayoutBinding
@@ -13,7 +14,6 @@ import com.wdkl.app.ncs.callingdoor.helper.Utils
 import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
 import com.wdkl.app.ncs.callingdoor.settings.SettingConfig
 import com.wdkl.ncs.android.lib.base.BaseFragment
-import com.wdkl.ncs.android.lib.utils.errorLog
 import com.wdkl.ncs.android.lib.utils.showMessage
 import com.wdkl.ncs.android.lib.vo.filter
 import com.wdkl.ncs.android.lib.widget.OnegoGridLayoutManager
@@ -23,7 +23,10 @@ import com.wdkl.ncs.android.middleware.logic.contract.callingdoor.MainFragmentCo
 import com.wdkl.ncs.android.middleware.logic.presenter.callingdoor.MainFragmentPresenter
 import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO
 import com.wdkl.ncs.android.middleware.model.vo.FrameRoomVO
+import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
+import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
 import com.wdkl.ncs.android.middleware.tcp.enums.DeviceTypeEnum
+import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction
 import com.wdkl.ncs.android.middleware.utils.CommonUtils
 import kotlinx.android.synthetic.main.main_view_layout.*
 import org.greenrobot.eventbus.EventBus
@@ -66,51 +69,18 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
 
     override fun showRoomInfo(roomInfo: FrameRoomVO) {
         if (roomInfo.frameBedList != null) {
-            var count = 0
-            var simulateBed = false
             bedList.clear()
             bedList.addAll(roomInfo.frameBedList)
             roomAdpter.setData(bedList)
             Utils.setInBedVos(bedList)
             rv_bed_view.itemAnimator = DefaultItemAnimator()
-            if (bedList.size > 3) {
+            if (bedList.size > 2) {
                 //自动滚动显示
                 rv_bed_view.start()
             } else {
                 //静止显示
                 rv_bed_view.stop()
             }
-
-            if (bedList.size > 0) {
-                for (bed in bedList) {
-                    if (!TextUtils.isEmpty(bed.customerName)) {
-                        count++
-                    }
-
-                    //判断是否有模拟分机
-                    if (bed.bedDeviceType == DeviceTypeEnum.SIMULATE_BED_DEVICE.value()) {
-                        simulateBed = true
-                    }
-                }
-            }
-
-            Constant.bedCustomIn = count > 0
-            //如果当前在护理中则不操作门灯,如果不在护理中则重置门灯
-            if (!Constant.inNursing && !Constant.sosOn) {
-                if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
-                    DoorLightHelper.resetDoorLight()
-                }
-            }
-
-            //var bedNames = ""
-            //val bedSize = bedList.size
-            //if (bedSize == 1) {
-            //    bedNames = CommonUtils.subStringAfter(bedList[0].frameBed.fullName, "-")
-            //} else if (bedList.size > 1) {
-            //    bedNames = CommonUtils.subStringAfter(bedList[0].frameBed.fullName, "-") + " - " + CommonUtils.subStringAfter(bedList[bedSize-1].frameBed.fullName, "-")
-            //}
-
-            //EventBus.getDefault().post(MessageEvent(bedNames, Constant.EVENT_UPDATE_BEDS))
         }
     }
 
@@ -165,6 +135,23 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
             Constant.EVENT_UPDATE_CUSTOM -> {
                 updateInfo()
             }
+
+            Constant.EVENT_TCP_MSG -> {
+                val tcpModel = messageEvent.message as TcpModel
+                if (tcpModel.action == TcpAction.SideAction.SHOW || tcpModel.action == TcpAction.SideAction.CLEAR) {
+                    val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
+                    val bedName = CommonUtils.subStringAfter(interactionVO.fromFrameFullName, "-")
+                    if (tcpModel.action == TcpAction.SideAction.SHOW) {
+                        roomAdpter.addFlickBedItem(bedName)
+                    } else {
+                        roomAdpter.removeFlickBedItem(bedName)
+                    }
+                }
+            }
+
+            Constant.EVENT_CLEAR_CALLS -> {
+                roomAdpter.resetFlickBedItems()
+            }
         }
     }
 }

+ 1 - 5
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/helper/DoorLightHelper.java

@@ -40,11 +40,7 @@ public class DoorLightHelper {
         if (Constant.inNursing) {
             SerialPortHelper.setDoorLight(1, Constant.nursingColor); //绿色
         } else {
-            if (Constant.bedCustomIn) {
-                SerialPortHelper.setDoorLight(1, "111"); //白色
-            } else {
-                SerialPortHelper.setDoorLight(0, "000"); //关闭
-            }
+            SerialPortHelper.setDoorLight(1, "111"); //白色
         }
     }
 }

+ 12 - 0
callingdoor/src/main/res/drawable/shape_bed_item_bg.xml

@@ -0,0 +1,12 @@
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:left="-2dp"
+        android:right="-2dp"
+        android:top="-2dp">
+        <shape>
+            <stroke
+                android:width="2px"
+                android:color="@color/main_color"/>
+        </shape>
+    </item>
+</layer-list>

+ 47 - 45
callingdoor/src/main/res/layout/callingdoor_main_lay.xml

@@ -3,45 +3,58 @@
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="#EAF2F9">
+        android:background="@mipmap/bg_main">
 
         <include
             android:id="@+id/activity_calling_door_layout_title"
             layout="@layout/view_title_layout"/>
 
+        <TextView
+            android:id="@+id/app_version"
+            android:layout_width="148dp"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_alignParentRight="true"
+            android:layout_marginTop="10dp"
+            android:layout_marginBottom="10dp"
+            android:gravity="center"
+            android:paddingTop="10dp"
+            android:paddingBottom="10dp"
+            android:text="--"
+            android:textColor="@color/black"
+            android:textSize="20sp" />
+
         <LinearLayout
             android:id="@+id/ll_room_name"
             android:layout_width="match_parent"
-            android:layout_height="100dp"
+            android:layout_height="140dp"
+            android:layout_marginLeft="20dp"
+            android:layout_marginRight="20dp"
             android:layout_below="@id/activity_calling_door_layout_title">
-            <LinearLayout
+            <com.wdkl.ncs.android.lib.widget.MarqueeTextView
+                android:id="@+id/tv_room_name"
                 android:layout_width="0dp"
                 android:layout_height="match_parent"
-                android:layout_weight="3"
+                android:layout_marginTop="-10dp"
+                android:layout_weight="2.4"
                 android:paddingLeft="20dp"
-                android:paddingRight="20dp">
-                <com.wdkl.ncs.android.lib.widget.MarqueeTextView
-                    android:id="@+id/tv_room_name"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:text="--"
-                    android:textColor="@color/main_color"
-                    android:textSize="88sp"
-                    android:textStyle="bold"
-                    android:ellipsize="marquee"
-                    android:focusable="true"
-                    android:focusableInTouchMode="true"
-                    android:marqueeRepeatLimit="-1"
-                    android:singleLine="true"/>
-            </LinearLayout>
+                android:paddingRight="20dp"
+                android:gravity="center"
+                android:text="--"
+                android:textColor="@color/white"
+                android:textSize="112sp"
+                android:textStyle="bold"
+                android:singleLine="true"
+                android:ellipsize="marquee"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:marqueeRepeatLimit="marquee_forever"/>
 
             <ViewFlipper
                 android:id="@+id/view_flipper"
                 android:layout_width="0dp"
                 android:layout_height="match_parent"
-                android:layout_weight="2"
-                android:paddingRight="10dp"
-                android:paddingLeft="10dp"
+                android:layout_weight="1"
                 android:autoStart="true"
                 android:flipInterval="5000"
                 android:inAnimation="@anim/slide_down_in"
@@ -57,26 +70,12 @@
             </ViewFlipper>
         </LinearLayout>
 
-        <TextView
-            android:id="@+id/app_version"
-            android:layout_width="132dp"
-            android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_alignParentRight="true"
-            android:layout_marginTop="10dp"
-            android:layout_marginBottom="10dp"
-            android:gravity="center"
-            android:paddingTop="10dp"
-            android:paddingBottom="10dp"
-            android:text="--"
-            android:textColor="@color/main_color"
-            android:textSize="20sp" />
-
         <!--右侧按钮区域-->
         <ScrollView
             android:id="@+id/room_actions"
-            android:layout_width="132dp"
+            android:layout_width="148dp"
             android:layout_height="match_parent"
+            android:layout_marginTop="10dp"
             android:layout_below="@id/ll_room_name"
             android:layout_above="@id/app_version"
             android:layout_alignParentRight="true">
@@ -84,7 +83,6 @@
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:layout_marginRight="10dp"
                 android:orientation="vertical">
 
@@ -103,7 +101,8 @@
                     android:ellipsize="end"
                     android:text="@string/str_call_bed"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
-                    android:textSize="20sp" />
+                    android:textSize="20sp"
+                    android:visibility="gone"/>
 
                 <TextView
                     android:id="@+id/room_action_call"
@@ -119,13 +118,15 @@
                     android:ellipsize="end"
                     android:text="@string/str_call_nurse"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
-                    android:textSize="20sp" />
+                    android:textSize="20sp"
+                    android:visibility="gone"/>
 
                 <TextView
                     android:id="@+id/room_cancel_call"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginBottom="30dp"
+                    android:layout_marginTop="50dp"
+                    android:layout_marginBottom="40dp"
                     android:background="@mipmap/bg_bottom_btn"
                     android:drawableLeft="@mipmap/ic_call"
                     android:drawablePadding="6dp"
@@ -141,7 +142,7 @@
                     android:id="@+id/room_action_support"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginBottom="30dp"
+                    android:layout_marginBottom="40dp"
                     android:background="@mipmap/bg_bottom_btn"
                     android:drawableLeft="@mipmap/ic_support"
                     android:drawablePadding="6dp"
@@ -157,7 +158,7 @@
                     android:id="@+id/room_action_nurse"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginBottom="30dp"
+                    android:layout_marginBottom="40dp"
                     android:background="@mipmap/bg_bottom_btn"
                     android:drawableLeft="@drawable/ic_nursing"
                     android:drawablePadding="6dp"
@@ -181,7 +182,8 @@
                     android:ellipsize="end"
                     android:text="@string/language_set_title"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
-                    android:textSize="20sp" />
+                    android:textSize="20sp"
+                    android:visibility="gone"/>
 
                 <TextView
                     android:id="@+id/room_action_power_reset"

+ 72 - 253
callingdoor/src/main/res/layout/item_bed.xml

@@ -1,304 +1,123 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="290dp"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/ll_item_bed"
+    android:layout_width="418dp"
     android:layout_height="match_parent"
-    android:paddingLeft="4dp"
-    android:orientation="vertical">
+    android:layout_margin="4dp"
+    android:background="@drawable/shape_bed_item_bg"
+    android:orientation="vertical"
+    android:gravity="center_horizontal">
+
+    <com.wdkl.ncs.android.lib.widget.MarqueeTextView
+        android:id="@+id/tv_bed_name_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="--"
+        android:textColor="@color/bed_text_color"
+        android:textSize="56sp"
+        android:textStyle="bold"
+        android:singleLine="true"
+        android:ellipsize="marquee"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:marqueeRepeatLimit="marquee_forever"/>
 
     <LinearLayout
-        android:layout_width="match_parent"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content">
         <TextView
-            android:id="@+id/tv_bed_name_title"
+            android:id="@+id/bed_customer_name"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_weight="2"
-            android:padding="4dp"
-            android:singleLine="true"
-            android:ellipsize="end"
+            android:gravity="center"
             android:text="--"
-            android:textColor="@color/main_color"
-            android:textSize="36sp"
-            android:textStyle="bold"/>
+            android:textColor="@color/black"
+            android:textSize="32sp" />
+
         <TextView
-            android:id="@+id/tv_bed_card_no"
+            android:id="@+id/bed_customer_age"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:textColor="#B4B4B4"
-            android:textSize="16sp"/>
+            android:layout_marginLeft="20dp"
+            android:gravity="center"
+            android:textColor="@color/black"
+            android:text="--"
+            android:textSize="24sp" />
     </LinearLayout>
 
+    <TextView
+        android:id="@+id/tv_bed_card_no"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="@color/black"
+        android:textSize="20sp"
+        android:text="--"/>
+
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:baselineAligned="false">
+        android:layout_marginTop="8dp">
 
-        <!--护理项-->
         <LinearLayout
-            android:id="@+id/ll_nurse_configs"
             android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_weight="1.2"
-            android:baselineAligned="false"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="center"
             android:orientation="vertical">
-
-            <RelativeLayout
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/nurse_config_item_height"
-                android:layout_marginTop="10dp">
-                <View
-                    android:id="@+id/nurse_config_item_color1"
-                    android:layout_width="10dp"
-                    android:layout_height="match_parent"
-                    android:background="@color/nursing_default_color"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_name1"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color1"
-                    android:paddingLeft="4dp"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/default_nurse_config_name"
-                    android:textColor="@color/text_name_color"
-                    android:textSize="18sp"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_value1"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color1"
-                    android:layout_alignParentBottom="true"
-                    android:paddingRight="4dp"
-                    android:gravity="right"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/str_empty"
-                    android:textColor="@color/main_color"
-                    android:textSize="20sp"/>
-            </RelativeLayout>
-
-            <RelativeLayout
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/nurse_config_item_height"
-                android:layout_marginTop="@dimen/nurse_config_margin">
-                <View
-                    android:id="@+id/nurse_config_item_color2"
-                    android:layout_width="10dp"
-                    android:layout_height="match_parent"
-                    android:background="@color/nursing_default_color"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_name2"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color2"
-                    android:paddingLeft="4dp"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/default_nurse_config_name"
-                    android:textColor="@color/text_name_color"
-                    android:textSize="18sp"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_value2"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color2"
-                    android:layout_alignParentBottom="true"
-                    android:paddingRight="4dp"
-                    android:gravity="right"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/str_empty"
-                    android:textColor="@color/main_color"
-                    android:textSize="20sp"/>
-            </RelativeLayout>
-
-            <RelativeLayout
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/nurse_config_item_height"
-                android:layout_marginTop="@dimen/nurse_config_margin">
-                <View
-                    android:id="@+id/nurse_config_item_color3"
-                    android:layout_width="10dp"
-                    android:layout_height="match_parent"
-                    android:background="@color/nursing_default_color"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_name3"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color3"
-                    android:paddingLeft="4dp"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/default_nurse_config_name"
-                    android:textColor="@color/text_name_color"
-                    android:textSize="18sp"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_value3"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color3"
-                    android:layout_alignParentBottom="true"
-                    android:paddingRight="4dp"
-                    android:gravity="right"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/str_empty"
-                    android:textColor="@color/main_color"
-                    android:textSize="20sp"/>
-            </RelativeLayout>
-
-            <RelativeLayout
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/nurse_config_item_height"
-                android:layout_marginTop="@dimen/nurse_config_margin">
-                <View
-                    android:id="@+id/nurse_config_item_color4"
-                    android:layout_width="10dp"
-                    android:layout_height="match_parent"
-                    android:background="@color/nursing_default_color"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_name4"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color4"
-                    android:paddingLeft="4dp"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/default_nurse_config_name"
-                    android:textColor="@color/text_name_color"
-                    android:textSize="18sp"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_value4"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color4"
-                    android:layout_alignParentBottom="true"
-                    android:paddingRight="4dp"
-                    android:gravity="right"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/str_empty"
-                    android:textColor="@color/main_color"
-                    android:textSize="20sp"/>
-            </RelativeLayout>
-
-            <RelativeLayout
-                android:layout_width="match_parent"
-                android:layout_height="@dimen/nurse_config_item_height"
-                android:layout_marginTop="@dimen/nurse_config_margin">
-                <View
-                    android:id="@+id/nurse_config_item_color5"
-                    android:layout_width="10dp"
-                    android:layout_height="match_parent"
-                    android:background="@color/nursing_default_color"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_name5"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color5"
-                    android:paddingLeft="4dp"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/default_nurse_config_name"
-                    android:textColor="@color/text_name_color"
-                    android:textSize="18sp"/>
-                <TextView
-                    android:id="@+id/nurse_config_item_value5"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_toRightOf="@id/nurse_config_item_color5"
-                    android:layout_alignParentBottom="true"
-                    android:paddingRight="4dp"
-                    android:gravity="right"
-                    android:singleLine="true"
-                    android:ellipsize="end"
-                    android:text="@string/str_empty"
-                    android:textColor="@color/main_color"
-                    android:textSize="20sp"/>
-            </RelativeLayout>
-
-        </LinearLayout>
-
-        <!--入住信息-->
-        <LinearLayout
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_weight="0.8"
-            android:layout_marginTop="10dp"
-            android:baselineAligned="false"
-            android:orientation="vertical"
-            android:gravity="center_horizontal">
-
-            <TextView
-                android:id="@+id/bed_customer_name"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:drawableTop="@mipmap/ic_custom_male"
-                android:gravity="center"
-                android:text="--"
-                android:textColor="@color/black"
-                android:textSize="24sp"/>
-
-            <TextView
-                android:id="@+id/bed_customer_age"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:drawableLeft="@mipmap/ic_gender_male"
-                android:drawablePadding="4dp"
-                android:text="--"
-                android:textSize="20sp"/>
-
             <ImageView
                 android:id="@+id/bed_doctor_icon"
-                android:layout_width="48dp"
-                android:layout_height="48dp"
-                android:layout_marginTop="20dp"
-                android:src="@mipmap/ic_doctor_default"/>
+                android:layout_width="160dp"
+                android:layout_height="160dp"
+                android:scaleType="fitXY"
+                android:src="@mipmap/doctor_default" />
 
             <TextView
                 android:id="@+id/bed_doctor_title"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:text="@string/doctor_title"
-                android:textColor="@color/text_name_color"
-                android:textSize="14sp"/>
+                android:layout_marginTop="6dp"
+                android:text="责任医生"
+                android:textColor="@color/black"
+                android:textSize="18sp" />
 
             <TextView
                 android:id="@+id/bed_doctor_name"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="@string/str_empty"
+                android:text="暂无"
                 android:textColor="@color/black"
-                android:textSize="14sp"/>
+                android:textSize="22sp" />
+        </LinearLayout>
 
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="center"
+            android:orientation="vertical">
             <ImageView
                 android:id="@+id/bed_nurse_icon"
-                android:layout_width="48dp"
-                android:layout_height="48dp"
-                android:layout_marginTop="10dp"
-                android:src="@mipmap/ic_nurse_default"/>
+                android:layout_width="160dp"
+                android:layout_height="160dp"
+                android:scaleType="fitXY"
+                android:src="@mipmap/nurse_default" />
 
             <TextView
                 android:id="@+id/bed_nurse_title"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
-                android:text="@string/nurse_title"
-                android:textColor="@color/text_name_color"
-                android:textSize="14sp"/>
+                android:layout_marginTop="6dp"
+                android:text="责任护士"
+                android:textColor="@color/black"
+                android:textSize="18sp" />
 
             <TextView
                 android:id="@+id/bed_nurse_name"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="@string/str_empty"
+                android:text="暂无"
                 android:textColor="@color/black"
-                android:textSize="14sp"/>
-
+                android:textSize="22sp" />
         </LinearLayout>
 
     </LinearLayout>

BIN
callingdoor/src/main/res/mipmap-mdpi/bg_main.png


BIN
callingdoor/src/main/res/mipmap-mdpi/doctor_default.jpg


BIN
callingdoor/src/main/res/mipmap-mdpi/nurse_default.jpg


+ 3 - 1
callingdoor/src/main/res/values/colors.xml

@@ -94,5 +94,7 @@
     <color name="right_item_bg">#3CA2E0</color>
     <color name="right_item_select">#B1DAF3</color>
 
-    <color name="nursing_color">#FFA5A5</color>
+    <color name="nursing_color">#FF4040</color>
+    <color name="bed_light_color">#44f29200</color>
+    <color name="bed_text_color">#0070ff</color>
 </resources>

+ 59 - 0
common/src/main/code/com/wdkl/ncs/android/lib/utils/DensityUtils.java

@@ -0,0 +1,59 @@
+package com.wdkl.ncs.android.lib.utils;
+
+import android.content.Context;
+import android.util.TypedValue;
+
+public class DensityUtils {
+    private DensityUtils() {
+          /* cannot be instantiated */
+        throw new UnsupportedOperationException("cannot be instantiated");
+    }
+
+    /**
+     * dp转px
+     *
+     * @param context
+     * @return
+     */
+    public static int   dp2px(Context context, float dpVal) {
+        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+                dpVal, context.getResources().getDisplayMetrics());
+
+    }
+
+    /**
+     * sp转px
+     *
+     * @param context
+     * @return
+     */
+
+    public static int sp2px(Context context, float spVal) {
+        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
+                spVal, context.getResources().getDisplayMetrics());
+    }
+
+
+    /**
+     * px转dp
+     *
+     * @param context
+     * @param pxVal
+     * @return
+     */
+
+    public static float px2dp(Context context, float pxVal) {
+        final float scale = context.getResources().getDisplayMetrics().density;
+        return (pxVal / scale);
+    }
+
+
+    /**
+     * px转sp
+     *
+     * @return
+     */
+    public static float px2sp(Context context, float pxVal) {
+        return (pxVal / context.getResources().getDisplayMetrics().scaledDensity);
+    }
+}

+ 1 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/common/Constant.java

@@ -205,4 +205,5 @@ public class Constant {
     public static final int EVENT_EXIT_TEST = 0x12;
     public static final int EVENT_UPDATE_BEDS = 0x13;
     public static final int EVENT_REMOVE_CALL_BED = 0x14;
+    public static final int EVENT_CLEAR_CALLS = 0x15;
 }

+ 28 - 1
middleware/src/main/code/com/wdkl/ncs/android/middleware/model/vo/FrameBedVO.java

@@ -12,7 +12,7 @@ import java.util.List;
  * @create: 2021/03/03 12:01
  */
 
-public class FrameBedVO{
+public class FrameBedVO {
 
     private FrameDO frameBed;
     private Integer deviceCount;
@@ -33,10 +33,13 @@ public class FrameBedVO{
 
     private Integer doctorId;
     private String doctorName;
+    private String doctorFace;
     private Integer nurseId;
     private String nurseName;
+    private String nurseFace;
     private Integer workerId;
     private String workerName;
+    private String workerFace;
     private String cardNo;
 
     private List<NurseConfigDto> nurseConfigDtos;
@@ -219,6 +222,30 @@ public class FrameBedVO{
         this.workerName = workerName;
     }
 
+    public String getDoctorFace() {
+        return doctorFace;
+    }
+
+    public void setDoctorFace(String doctorFace) {
+        this.doctorFace = doctorFace;
+    }
+
+    public String getNurseFace() {
+        return nurseFace;
+    }
+
+    public void setNurseFace(String nurseFace) {
+        this.nurseFace = nurseFace;
+    }
+
+    public String getWorkerFace() {
+        return workerFace;
+    }
+
+    public void setWorkerFace(String workerFace) {
+        this.workerFace = workerFace;
+    }
+
     public String getCardNo() {
         return cardNo;
     }

+ 2 - 1
middleware/src/main/code/com/wdkl/ncs/android/middleware/utils/CommonUtils.java

@@ -16,11 +16,12 @@ public class CommonUtils {
 
     //默认ip端口
     //private static final String DEFAULT_URL = "8.129.220.143";
-    private static final String DEFAULT_URL = "172.28.100.100";
+    //private static final String DEFAULT_URL = "172.28.100.100";
     //private static final String DEFAULT_URL = "192.168.9.200";
     //private static final String DEFAULT_URL = "192.168.8.5";
     //private static final String DEFAULT_URL = "192.168.101.1";  //潼南
     //private static final String DEFAULT_URL = "172.18.0.33";  //益阳妇幼
+    private static final String DEFAULT_URL = "111.111.0.34";  //祁阳
     private static final String DEFAULT_URL_PORT = "8006";
     private static final String DEFAULT_SIP_PORT = "8188";
 

+ 1 - 1
resource/src/main/res/values-zh/strings.xml

@@ -127,7 +127,7 @@
     <string name="str_more">更多</string>
     <string name="str_support">请求增援</string>
     <string name="str_call">呼叫</string>
-    <string name="str_cancel_call">取消呼叫</string>
+    <string name="str_cancel_call">清除呼叫</string>
     <string name="str_call_nurse">呼叫护士</string>
     <string name="str_call_bed">呼叫床位</string>