소스 검색

门口机增加月子中心主题

weizhengliang 1 년 전
부모
커밋
c9b9e487d5
42개의 변경된 파일751개의 추가작업 그리고 50개의 파일을 삭제
  1. 1 0
      android_door/build.gradle
  2. 121 21
      android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt
  3. 69 0
      android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/adapter/BabyItemAdapter.kt
  4. 2 0
      android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/di/CallingdoorComponent.kt
  5. 5 0
      android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/fragment/MainFragment.kt
  6. 7 0
      android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/fragment/QrCodeFragment.kt
  7. 224 0
      android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/fragment/YzMainFragment.kt
  8. 2 0
      android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/helper/AppUpdateHelper.java
  9. 6 0
      android_door/src/main/h10_3128/res/drawable/shape_bottom_bg_blue.xml
  10. 6 0
      android_door/src/main/h10_3128/res/drawable/shape_bottom_bg_red.xml
  11. 6 0
      android_door/src/main/h10_3128/res/drawable/shape_desc_bg_blue.xml
  12. 6 0
      android_door/src/main/h10_3128/res/drawable/shape_desc_bg_red.xml
  13. 6 6
      android_door/src/main/h10_3128/res/layout/callingdoor_main_lay.xml
  14. 38 0
      android_door/src/main/h10_3128/res/layout/item_baby.xml
  15. 7 7
      android_door/src/main/h10_3128/res/layout/qr_code_lay.xml
  16. 5 5
      android_door/src/main/h10_3128/res/layout/view_title_layout.xml
  17. 132 0
      android_door/src/main/h10_3128/res/layout/yz_main_view_layout.xml
  18. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/ic_daylight_red.png
  19. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/ic_ethernet_success_red.png
  20. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/ic_night_red.png
  21. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/ic_nurse_1.png
  22. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/ic_nurse_2.png
  23. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/ic_tcp_success_red.png
  24. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/ic_wifi_success_red.png
  25. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/main_bg_boy.png
  26. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/main_bg_double.png
  27. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/main_bg_girl.png
  28. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/room_bg_boy.jpg
  29. BIN
      android_door/src/main/h10_3128/res/mipmap-mdpi/room_bg_girl.jpg
  30. 18 0
      android_door/src/main/h10_3128/res/values/styles.xml
  31. 13 0
      android_door/src/main/h10_3128_chile/res/values/styles.xml
  32. 12 0
      android_door/src/main/h10_a133_chile/res/values/styles.xml
  33. 1 1
      app/src/main/AndroidManifest.xml
  34. 1 1
      app/src/main/code/com/wdkl/app/ncs/application/Application.kt
  35. 1 1
      app/src/main/sharedUserId/AndroidManifest.xml
  36. 3 0
      build.gradle
  37. 8 0
      common/src/main/res/values/attrs.xml
  38. 5 0
      common/src/main/res/values/colors.xml
  39. 3 0
      middleware/src/main/code/com/wdkl/ncs/android/middleware/api/DoorDeviceApi.kt
  40. 8 0
      middleware/src/main/code/com/wdkl/ncs/android/middleware/common/Constant.java
  41. 5 0
      middleware/src/main/code/com/wdkl/ncs/android/middleware/logic/contract/callingdoor/MainFragmentContract.kt
  42. 30 8
      middleware/src/main/code/com/wdkl/ncs/android/middleware/logic/presenter/callingdoor/MainFragmentPresenter.kt

+ 1 - 0
android_door/build.gradle

@@ -37,6 +37,7 @@ android {
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
         buildConfigField "String", "APP_DEVICE_TYPE", "\""+app_device_type+"\""
+        buildConfigField 'String', 'UI_TYPE', "\"${project.rootProject.ext.ui_type}\""
     }
 
     sourceSets {

+ 121 - 21
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt

@@ -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.tv_room_name
 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.view_bed_name.*
 import kotlinx.android.synthetic.main.view_title_layout.*
@@ -146,6 +148,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     private var netErrCount : Int = 0
 
     override fun getLayId(): Int {
+        if (BuildConfig.UI_TYPE == "mom") {
+            setTheme(R.style.MomAppTheme)
+        }
+
         if ("rk3288".equals(Build.MODEL)) {
             return R.layout.callingdoor_main_lay_rk3288
         } else {
@@ -249,6 +255,15 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
             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()
         //注册广播
         regReceiver()
@@ -585,7 +600,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
         } else {
             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() {
@@ -596,14 +613,20 @@ 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))
+        if (BuildConfig.UI_TYPE != "mom") {
+            tv_room_name.setTextColor(resources.getColor(R.color.main_color))
+        }
     }
 
     override fun bindEvent() {
         room_action_home.setOnClickListener {
             if (mainFragment != curFragment) {
                 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 {
                     showMessage(R.string.data_empty)
                 }
@@ -1031,7 +1054,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     override fun showDeviceInfo(deviceInfo: DeviceRoomInfoVO) {
         //显示床位信息界面
         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) {
@@ -1060,10 +1087,14 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
         }
         if (Constant.DEVICE_STATUS == 0) {
             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 {
             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) {
@@ -1599,6 +1630,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                 switchFragment(R.id.callingdoor_main_frame, QrCodeFragment(), qrFragment)
             }
 
+            Constant.EVENT_UPDATE_TITLE -> {
+                updateMomTitle()
+            }
+
             /*Constant.EVENT_REMOVE_CALL_BED -> {
                 room_action_call_bed.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) {
         this.runOnUiThread {
             when (state) {
@@ -1788,18 +1858,34 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     }
 
     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 {
-            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() {
         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)
         } else {
             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.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) {
@@ -1890,14 +1985,19 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
             if (Constant.day_state != 1 || forceSet) {
                 //设置晚上亮度
                 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{
                     ScreenManagerUtil().setScreenBrightness(this, Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt())
                 }
                 //设置晚上系统音量和响铃音
                 VoiceManagerUtil.setSystemVoice(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) {

+ 69 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/adapter/BabyItemAdapter.kt

@@ -0,0 +1,69 @@
+package com.wdkl.app.ncs.callingdoor.adapter
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.ncs.android.lib.utils.TimeHandle
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.model.vo.FrameBedRelativeVO
+
+class BabyItemAdapter(private var data: ArrayList<FrameBedRelativeVO>) : RecyclerView.Adapter<BabyItemAdapter.BabyViewHolder>() {
+
+    override fun onCreateViewHolder(p0: ViewGroup, p1: Int): BabyViewHolder {
+        val view = LayoutInflater.from(p0.context).inflate(R.layout.item_baby, p0, false)
+        return BabyViewHolder(view)
+    }
+
+    override fun onBindViewHolder(p0: BabyViewHolder, p1: Int) {
+        try {
+            val pos = p1
+
+            if (data[pos].relativeMemberName != null) {
+                p0.babyName.text = data[pos].relativeMemberName
+            }
+
+            if (data[pos].relativeSex != null) {
+                if (data[pos].relativeSex == 1) {
+                    p0.babyGender.text = "男"
+                    p0.babyGender.setBackgroundResource(R.drawable.shape_desc_bg_blue)
+                    p0.babyName.setTextColor(Constant.colorBoy)
+                } else {
+                    p0.babyGender.text = "女"
+                    p0.babyGender.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                    p0.babyName.setTextColor(Constant.colorGirl)
+                }
+            } else {
+                p0.babyGender.text = ""
+                p0.babyGender.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                p0.babyName.setTextColor(Constant.colorGirl)
+            }
+
+            if (data[pos].relativeBirthday != null) {
+                val birthday = TimeHandle.getDateTime(data[pos].relativeBirthday*1000, "MM月dd日")
+                p0.babyBirthday.text = "出生日期: " + birthday
+            }
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    }
+
+    override fun getItemCount(): Int {
+        return data.size
+    }
+
+    fun updateData(data: ArrayList<FrameBedRelativeVO>) {
+        this.data = data
+        notifyDataSetChanged()
+    }
+
+
+    class BabyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
+        var babyName : TextView = itemView.findViewById(R.id.tv_baby_name)
+        var babyGender : TextView = itemView.findViewById(R.id.tv_baby_gender)
+        var babyBirthday : TextView = itemView.findViewById(R.id.tv_baby_birthday)
+    }
+}

+ 2 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/di/CallingdoorComponent.kt

@@ -20,4 +20,6 @@ interface CallingdoorComponent {
     fun inject(fragment: QrCodeFragment)
 
     fun inject(fragment: TestFragment)
+
+    fun inject(fragment: YzMainFragment)
 }

+ 5 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/fragment/MainFragment.kt

@@ -6,6 +6,7 @@ import androidx.recyclerview.widget.DefaultItemAnimator
 import androidx.recyclerview.widget.GridLayoutManager
 import com.enation.javashop.net.engine.model.NetState
 import com.google.gson.Gson
+import com.google.gson.JsonObject
 import com.wdkl.app.ncs.callingdoor.R
 import com.wdkl.app.ncs.callingdoor.adapter.FrameRoomAdapter
 import com.wdkl.app.ncs.callingdoor.databinding.MainViewLayoutBinding
@@ -119,6 +120,10 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
         }
     }
 
+    override fun showClerkInfo(data: JsonObject) {
+
+    }
+
     override fun onError(message: String, type: Int) {
         //errorLog("error",message)
         showMessage(message)

+ 7 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/fragment/QrCodeFragment.kt

@@ -83,6 +83,13 @@ class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrCodeLayBinding>()
         if (Constant.POWER_RESET) {
             tv_btn_power_reset.visibility = View.VISIBLE
         }
+
+        if (BuildConfig.UI_TYPE == "mom") {
+            tv_btn_power_reset.visibility = View.GONE
+            tv_language_set.visibility = View.GONE
+            tv_nursing_timing.visibility = View.GONE
+            ll_nursing_color_set.visibility = View.GONE
+        }
     }
 
     override fun bindEvent() {

+ 224 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/fragment/YzMainFragment.kt

@@ -0,0 +1,224 @@
+package com.wdkl.app.ncs.callingdoor.fragment
+
+import androidx.recyclerview.widget.GridLayoutManager
+import com.enation.javashop.net.engine.model.NetState
+import com.google.gson.JsonObject
+import com.wdkl.app.ncs.callingdoor.BuildConfig
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.activity.CallingdoorActivity
+import com.wdkl.app.ncs.callingdoor.adapter.BabyItemAdapter
+import com.wdkl.app.ncs.callingdoor.databinding.MainViewLayoutBinding
+import com.wdkl.app.ncs.callingdoor.helper.AppInfoDialogHelper
+import com.wdkl.app.ncs.callingdoor.helper.AppUpdateHelper
+import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
+import com.wdkl.ncs.android.lib.base.BaseApplication
+import com.wdkl.ncs.android.lib.base.BaseFragment
+import com.wdkl.ncs.android.lib.utils.TimeHandle
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.lib.vo.filter
+import com.wdkl.ncs.android.lib.widget.OnegoGridLayoutManager
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.common.MessageEvent
+import com.wdkl.ncs.android.middleware.logic.contract.callingdoor.MainFragmentContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingdoor.MainFragmentPresenter
+import com.wdkl.ncs.android.middleware.model.vo.FrameBedRelativeVO
+import com.wdkl.ncs.android.middleware.model.vo.FrameRoomVO
+import com.wdkl.ncs.android.middleware.utils.AppUtil
+import com.wdkl.ncs.android.middleware.utils.CommonUtils
+import kotlinx.android.synthetic.main.yz_main_view_layout.*
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+class YzMainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>(), MainFragmentContract.View {
+    val TAG = "YzMainFragment"
+
+    private lateinit var gridLayoutManager: OnegoGridLayoutManager
+    private lateinit var babyAdapter: BabyItemAdapter
+    private var babyItems = ArrayList<FrameBedRelativeVO>()
+
+    override fun getLayId(): Int {
+        return R.layout.yz_main_view_layout
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        gridLayoutManager = OnegoGridLayoutManager(activity, 1, GridLayoutManager.VERTICAL, false)
+        babyAdapter = BabyItemAdapter(babyItems)
+        baby_list_view.layoutManager = gridLayoutManager
+        baby_list_view.adapter = babyAdapter
+
+        tv_version_no.text = "V" + CommonUtils.getAppVersionName(BaseApplication.appContext) + "_" + CommonUtils.getAppVersionCode(BaseApplication.appContext)
+        //updateInfo()
+    }
+
+    override fun bindEvent() {
+        tv_version_no.setOnLongClickListener {
+            AppInfoDialogHelper.showAppDialog(activity,
+                { dialog, which -> AppUpdateHelper.reboot(activity) },
+                { dialog, which ->
+                    Constant.silentUpdate = false
+                    (activity as CallingdoorActivity).checkAppVersion()
+                }, { dialog, which ->
+                    showMessage("开启调试")
+                    AppUtil.openNetworkDebug()
+                })
+
+            return@setOnLongClickListener true
+        }
+    }
+
+    override fun destory() {
+    }
+
+    override fun showRoomInfo(roomInfo: FrameRoomVO) {
+        if (roomInfo.frameBedList != null && roomInfo.frameBedList.size > 0) {
+            val bedVO = roomInfo.frameBedList[0]
+            //加载责护
+            if (bedVO.customerId != null) {
+                presenter.loadClerk(bedVO.customerId)
+            }
+
+            if (bedVO.frameBedRelativeVos != null && bedVO.frameBedRelativeVos.size > 0) {
+                if (bedVO.frameBedRelativeVos.size > 1) {
+                    //多胞胎
+                    Constant.babyGirl = true
+                    //红色主题
+                    rl_date_view.setBackgroundResource(R.drawable.shape_bottom_bg_red)
+                    yz_main_view.setBackgroundResource(R.mipmap.main_bg_double)
+                    tv_in_date.setTextColor(Constant.colorGirl)
+                    tv_out_date.setTextColor(Constant.colorGirl)
+                    tv_mother_name.setTextColor(Constant.colorGirl)
+                    tv_desc.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                    img_nurse_icon.setImageResource(R.mipmap.ic_nurse_2)
+                    tv_nurse_name.setTextColor(Constant.colorGirl)
+                } else {
+                    //单胎
+                    if (bedVO.frameBedRelativeVos[0].relativeSex == 1) {
+                        //男孩
+                        Constant.babyGirl = false
+                        //蓝色主题
+                        rl_date_view.setBackgroundResource(R.drawable.shape_bottom_bg_blue)
+                        yz_main_view.setBackgroundResource(R.mipmap.main_bg_boy)
+                        tv_in_date.setTextColor(Constant.colorBoy)
+                        tv_out_date.setTextColor(Constant.colorBoy)
+                        tv_mother_name.setTextColor(Constant.colorBoy)
+                        tv_desc.setBackgroundResource(R.drawable.shape_desc_bg_blue)
+                        img_nurse_icon.setImageResource(R.mipmap.ic_nurse_1)
+                        tv_nurse_name.setTextColor(Constant.colorBoy)
+                    } else {
+                        //女孩
+                        Constant.babyGirl = true
+                        //红色主题
+                        rl_date_view.setBackgroundResource(R.drawable.shape_bottom_bg_red)
+                        yz_main_view.setBackgroundResource(R.mipmap.main_bg_girl)
+                        tv_in_date.setTextColor(Constant.colorGirl)
+                        tv_out_date.setTextColor(Constant.colorGirl)
+                        tv_mother_name.setTextColor(Constant.colorGirl)
+                        tv_desc.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                        img_nurse_icon.setImageResource(R.mipmap.ic_nurse_2)
+                        tv_nurse_name.setTextColor(Constant.colorGirl)
+                    }
+                }
+
+                babyItems.clear()
+                babyItems.addAll(bedVO.frameBedRelativeVos)
+                babyAdapter.updateData(babyItems)
+            } else {
+                //女孩
+                Constant.babyGirl = true
+                //红色主题
+                rl_date_view.setBackgroundResource(R.drawable.shape_bottom_bg_red)
+                yz_main_view.setBackgroundResource(R.mipmap.main_bg_girl)
+                tv_in_date.setTextColor(Constant.colorGirl)
+                tv_out_date.setTextColor(Constant.colorGirl)
+                tv_mother_name.setTextColor(Constant.colorGirl)
+                tv_desc.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                img_nurse_icon.setImageResource(R.mipmap.ic_nurse_2)
+                tv_nurse_name.setTextColor(Constant.colorGirl)
+
+                babyItems.clear()
+                babyAdapter.updateData(babyItems)
+            }
+
+            if (bedVO.customerInDate != null) {
+                val inDate = TimeHandle.getDateTime(bedVO.customerInDate*1000, "yyyy年MM月dd日")
+                tv_in_date.setText("入住时间: " + inDate)
+            } else {
+                tv_in_date.setText("入住时间:")
+            }
+
+            if (bedVO.customerOutDate != null) {
+                val outDate = TimeHandle.getDateTime(bedVO.customerOutDate*1000, "yyyy年MM月dd日")
+                tv_out_date.setText("出所时间: " + outDate)
+            } else {
+                tv_out_date.setText("出所时间:")
+            }
+
+            tv_mother_name.text = bedVO.customerName
+            tv_desc.text = bedVO.customerIllnessDesc
+
+            EventBus.getDefault().post(MessageEvent("updateTitle", Constant.EVENT_UPDATE_TITLE))
+        }
+    }
+
+    override fun showClerkInfo(data: JsonObject) {
+        tv_nurse_name.text = data.get("clerk_name").asString
+    }
+
+    override fun onError(message: String, type: Int) {
+        showMessage(message)
+    }
+
+    override fun onNoNet() {
+        showMessage("没有网络")
+    }
+
+    override fun complete(message: String, type: Int) {
+    }
+
+    override fun start() {
+    }
+
+    override fun networkMonitor(state: NetState) {
+        state.filter(onWifi = {
+
+        },onMobile = {
+
+        },offline = {
+
+        })
+    }
+
+    override fun onStart() {
+        if (!EventBus.getDefault().isRegistered(this)) {
+            EventBus.getDefault().register(this)
+        }
+        super.onStart()
+    }
+
+    override fun onStop() {
+        if (EventBus.getDefault().isRegistered(this)) {
+            EventBus.getDefault().unregister(this)
+        }
+        super.onStop()
+    }
+
+    private fun updateInfo() {
+        if (Constant.FRAME_ID != -1 && Constant.DEVICE_STATUS == 1) {
+            presenter.loadRoomFrameInfo(Constant.FRAME_ID)
+        }
+    }
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+        when (messageEvent.type) {
+            Constant.EVENT_UPDATE_CUSTOM -> {
+                updateInfo()
+            }
+        }
+    }
+}

+ 2 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/helper/AppUpdateHelper.java

@@ -268,6 +268,8 @@ public class AppUpdateHelper {
             }
         } else if ("mk_h10_a133_1".equals(BuildConfig.APP_DEVICE_TYPE)) {
             ZhylManager.getInstance(BaseApplication.appContext).sys_setReboot();
+        } else {
+            restartApp(context);
         }
     }
 

+ 6 - 0
android_door/src/main/h10_3128/res/drawable/shape_bottom_bg_blue.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#B1DAF3"/>
+    <corners
+        android:radius="40dp" />
+</shape>

+ 6 - 0
android_door/src/main/h10_3128/res/drawable/shape_bottom_bg_red.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FBE5E8"/>
+    <corners
+        android:radius="40dp" />
+</shape>

+ 6 - 0
android_door/src/main/h10_3128/res/drawable/shape_desc_bg_blue.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#0090ff"/>
+    <corners
+        android:radius="10dp" />
+</shape>

+ 6 - 0
android_door/src/main/h10_3128/res/drawable/shape_desc_bg_red.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FF3B30"/>
+    <corners
+        android:radius="10dp" />
+</shape>

+ 6 - 6
android_door/src/main/h10_3128/res/layout/callingdoor_main_lay.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout>
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/rl_activity_main_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="#EAF2F9">
+        android:background="?attr/listBgColor">
 
         <include
             android:id="@+id/activity_calling_door_layout_title"
@@ -19,7 +20,7 @@
             android:paddingTop="10dp"
             android:paddingBottom="10dp"
             android:text="--"
-            android:textColor="@color/main_color"
+            android:textColor="?attr/myBackgroundColor"
             android:textSize="20sp" />
 
         <!--右侧按钮区域-->
@@ -202,6 +203,7 @@
             </LinearLayout>
 
             <LinearLayout
+                android:id="@+id/ll_call_view"
                 android:layout_width="0dp"
                 android:layout_height="match_parent"
                 android:layout_weight="1"
@@ -244,10 +246,8 @@
             android:id="@+id/callingdoor_main_frame"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:layout_marginBottom="10dp"
-            android:layout_marginLeft="20dp"
-            android:layout_marginRight="20dp"
-            android:padding="10dp"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp"
             android:layout_below="@id/ll_room_name"
             android:layout_toLeftOf="@id/room_actions"/>
 

+ 38 - 0
android_door/src/main/h10_3128/res/layout/item_baby.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="106dp"
+    android:layout_marginBottom="20dp"
+    android:gravity="center"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/tv_baby_gender"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:background="@drawable/shape_desc_bg_red"
+        android:paddingLeft="28dp"
+        android:paddingRight="28dp"
+        android:text="-"
+        android:textColor="@color/white"
+        android:textSize="20sp"/>
+
+    <TextView
+        android:id="@+id/tv_baby_birthday"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="8dp"
+        android:text="出生日期:"
+        android:textSize="16sp"
+        android:textStyle="bold"/>
+
+    <TextView
+        android:id="@+id/tv_baby_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="8dp"
+        android:text="宝宝"
+        android:textColor="@color/text_color_girl"
+        android:textSize="22sp" />
+
+</LinearLayout>

+ 7 - 7
android_door/src/main/h10_3128/res/layout/qr_code_lay.xml

@@ -127,7 +127,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:padding="10dp"
-                    android:background="@color/main_color"
+                    android:background="?attr/myBackgroundColor"
                     android:gravity="center_horizontal"
                     android:text="@string/reboot_device"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
@@ -139,7 +139,7 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="10dp"
                     android:padding="10dp"
-                    android:background="@color/main_color"
+                    android:background="?attr/myBackgroundColor"
                     android:gravity="center_horizontal"
                     android:text="@string/check_update"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
@@ -152,7 +152,7 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="10dp"
                     android:padding="10dp"
-                    android:background="@color/main_color"
+                    android:background="?attr/myBackgroundColor"
                     android:gravity="center_horizontal"
                     android:text="@string/server_config"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
@@ -163,7 +163,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_marginTop="20dp"
-                    android:background="@color/main_color"
+                    android:background="?attr/myBackgroundColor"
                     android:gravity="center_horizontal"
                     android:padding="10dp"
                     android:text="@string/power_reset"
@@ -177,7 +177,7 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="10dp"
                     android:padding="10dp"
-                    android:background="@color/main_color"
+                    android:background="?attr/myBackgroundColor"
                     android:gravity="center_horizontal"
                     android:text="@string/test_mode"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
@@ -189,7 +189,7 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="10dp"
                     android:padding="10dp"
-                    android:background="@color/main_color"
+                    android:background="?attr/myBackgroundColor"
                     android:gravity="center_horizontal"
                     android:text="@string/language_set_title"
                     android:textColor="@drawable/selector_bottom_btn_text_color"
@@ -201,7 +201,7 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="10dp"
                     android:padding="10dp"
-                    android:background="@color/main_color"
+                    android:background="?attr/myBackgroundColor"
                     android:gravity="center_horizontal"
                     android:text="@string/str_nurse_timing"
                     android:textColor="@drawable/selector_bottom_btn_text_color"

+ 5 - 5
android_door/src/main/h10_3128/res/layout/view_title_layout.xml

@@ -25,18 +25,19 @@
         android:layout_marginLeft="20dp"
         android:layout_toRightOf="@+id/view_title_layout_tv_point"
         android:text="----"
-        android:textColor="@color/main_color"
+        android:textColor="?attr/myTextColor"
         android:textSize="@dimen/font_size_20" />
 
     <!--日期时间-->
     <TextClock
+        android:id="@+id/view_title_clock"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_centerHorizontal="true"
         android:layout_centerVertical="true"
         android:format12Hour="yyyy-MM-dd HH:mm EEEE"
         android:format24Hour="yyyy-MM-dd HH:mm EEEE"
-        android:textColor="@color/main_color"
+        android:textColor="?attr/myTextColor"
         android:textSize="@dimen/font_size_20" />
 
     <!--设备号-->
@@ -48,7 +49,7 @@
         android:layout_marginRight="10dp"
         android:layout_toLeftOf="@+id/view_title_layout_ll_right"
         android:text="ID:"
-        android:textColor="@color/main_color"
+        android:textColor="?attr/myTextColor"
         android:textSize="@dimen/font_size_20" />
 
     <!--状态图标-->
@@ -99,8 +100,7 @@
             android:layout_height="20dp"
             android:layout_gravity="center_vertical"
             android:layout_marginLeft="4dp"
-            android:layout_marginRight="4dp"
-            android:src="@mipmap/ic_daylight"/>
+            android:layout_marginRight="4dp" />
 
     </LinearLayout>
 </RelativeLayout>

+ 132 - 0
android_door/src/main/h10_3128/res/layout/yz_main_view_layout.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:id="@+id/yz_main_view"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="3.8"
+        android:background="@mipmap/main_bg_girl">
+
+        <RelativeLayout
+            android:id="@+id/rl_date_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_marginLeft="20dp"
+            android:layout_marginRight="20dp"
+            android:layout_marginBottom="10dp"
+            android:background="@drawable/shape_bottom_bg_red">
+            <TextView
+                android:id="@+id/tv_in_date"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:padding="10dp"
+                android:text="入住时间:"
+                android:textSize="24sp"
+                android:textColor="@color/text_color_girl"/>
+
+            <TextView
+                android:id="@+id/tv_out_date"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="10dp"
+                android:padding="10dp"
+                android:text="出所时间:"
+                android:textSize="24sp"
+                android:textColor="@color/text_color_girl"/>
+        </RelativeLayout>
+
+        <LinearLayout
+            android:layout_width="180dp"
+            android:layout_height="match_parent"
+            android:layout_above="@id/rl_date_view"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/tv_mother_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="--"
+                android:textColor="@color/text_color_girl"
+                android:textSize="32sp"
+                android:textStyle="bold"/>
+
+            <TextView
+                android:id="@+id/tv_desc"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/shape_desc_bg_red"
+                android:layout_marginTop="10dp"
+                android:paddingLeft="20dp"
+                android:paddingRight="20dp"
+                android:text="--"
+                android:textColor="@color/white"
+                android:textSize="24sp"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="180dp"
+            android:layout_height="match_parent"
+            android:layout_above="@id/rl_date_view"
+            android:layout_alignParentRight="true"
+            android:gravity="bottom">
+
+            <com.wdkl.ncs.android.lib.widget.AutoPollRecyclerView
+                android:id="@+id/baby_list_view"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:overScrollMode="never"
+                android:paddingLeft="2dp"
+                android:paddingRight="2dp"/>
+
+        </LinearLayout>
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1.2"
+        android:layout_marginStart="10dp"
+        android:background="@color/white"
+        android:orientation="vertical">
+
+        <ImageView
+            android:id="@+id/img_nurse_icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="60dp"
+            android:layout_centerHorizontal="true"
+            android:src="@mipmap/ic_nurse_2"/>
+
+        <TextView
+            android:id="@+id/tv_nurse_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:layout_below="@id/img_nurse_icon"
+            android:layout_centerHorizontal="true"
+            android:text="责护"
+            android:textSize="24sp"
+            android:textColor="@color/text_color_girl"/>
+
+        <TextView
+            android:id="@+id/tv_version_no"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_alignParentRight="true"
+            android:padding="10dp"
+            android:text="V--"/>
+
+    </RelativeLayout>
+
+</LinearLayout>
+</layout>

BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/ic_daylight_red.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/ic_ethernet_success_red.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/ic_night_red.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/ic_nurse_1.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/ic_nurse_2.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/ic_tcp_success_red.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/ic_wifi_success_red.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/main_bg_boy.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/main_bg_double.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/main_bg_girl.png


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/room_bg_boy.jpg


BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/room_bg_girl.jpg


+ 18 - 0
android_door/src/main/h10_3128/res/values/styles.xml

@@ -8,4 +8,22 @@
         <item name="colorAccent">@color/colorAccent</item>
     </style>
 
+    <!--默认主题-->
+    <style name="WdklAppTheme" parent="MyAppTheme">
+        <item name="myBackgroundColor">@color/main_color</item>
+        <item name="myStatusBarColor">#FFFFFF</item>
+        <item name="myTextColor">@color/main_color</item>
+        <item name="listBgColor">#EAF2F9</item>
+        <item name="selectImgColor">@color/main_color</item>
+    </style>
+
+    <!--月子中心项目主题-->
+    <style name="MomAppTheme" parent="MyAppTheme">
+        <item name="myBackgroundColor">@color/main_bg_color_girl</item>
+        <item name="myStatusBarColor">#FFFFFF</item>
+        <item name="myTextColor">@color/text_color_girl</item>
+        <item name="listBgColor">@color/main_bg_color_girl</item>
+        <item name="selectImgColor">@color/main_bg_color_girl</item>
+    </style>
+
 </resources>

+ 13 - 0
android_door/src/main/h10_3128_chile/res/values/styles.xml

@@ -8,4 +8,17 @@
         <item name="colorAccent">@color/colorAccent</item>
     </style>
 
+    <!--默认主题-->
+    <style name="WdklAppTheme" parent="MyAppTheme">
+        <item name="myBackgroundColor">@color/main_color</item>
+        <item name="myStatusBarColor">#FFFFFF</item>
+        <item name="myTextColor">@color/main_color</item>
+        <item name="listBgColor">#87CEFA</item>
+        <item name="selectImgColor">@color/main_color</item>
+    </style>
+
+    <!--月子中心项目主题-->
+    <style name="MomAppTheme" parent="MyAppTheme">
+    </style>
+
 </resources>

+ 12 - 0
android_door/src/main/h10_a133_chile/res/values/styles.xml

@@ -8,4 +8,16 @@
         <item name="colorAccent">@color/colorAccent</item>
     </style>
 
+    <!--默认主题-->
+    <style name="WdklAppTheme" parent="MyAppTheme">
+        <item name="myBackgroundColor">@color/main_color</item>
+        <item name="myStatusBarColor">#FFFFFF</item>
+        <item name="myTextColor">@color/main_color</item>
+        <item name="listBgColor">#87CEFA</item>
+        <item name="selectImgColor">@color/main_color</item>
+    </style>
+
+    <!--月子中心项目主题-->
+    <style name="MomAppTheme" parent="MyAppTheme">
+    </style>
 </resources>

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

@@ -39,7 +39,7 @@
         tools:remove="android:requestLegacyExternalStorage"
         android:networkSecurityConfig="@xml/network_security_config"
         android:name="com.wdkl.app.ncs.application.Application"
-        android:theme="@style/MyAppTheme">
+        android:theme="@style/WdklAppTheme">
         <meta-data
             android:name="com.enation.javashop.imagepluin.cache.MyGlideModule"
             android:value="GlideModule" />

+ 1 - 1
app/src/main/code/com/wdkl/app/ncs/application/Application.kt

@@ -82,7 +82,7 @@ class Application : BaseApplication() {
      * @return rx观察者
      */
     private fun initFrame() {
-        BaseConfig.getInstance().addActivity("WelcomeActivity", "AppUpdateActivity","CallingdoorActivity")
+        BaseConfig.getInstance().addActivity("WelcomeActivity", "AppUpdateActivity", "CallingdoorActivity", "AppTextActivity")
 
         NetEngineConfig.init(baseContext)
                 .openLogger()

+ 1 - 1
app/src/main/sharedUserId/AndroidManifest.xml

@@ -37,7 +37,7 @@
         tools:remove="android:requestLegacyExternalStorage"
         android:networkSecurityConfig="@xml/network_security_config"
         android:name="com.wdkl.app.ncs.application.Application"
-        android:theme="@style/MyAppTheme">
+        android:theme="@style/WdklAppTheme">
         <meta-data
             android:name="com.enation.javashop.imagepluin.cache.MyGlideModule"
             android:value="GlideModule" />

+ 3 - 0
build.gradle

@@ -46,6 +46,9 @@ buildscript {
 
     ext.app_device_type = "mk_h10_z_3128_1"
 
+    //UI版本: default, mom
+    ext.ui_type = "default"
+
     if (app_device_type == "mk_h10_z_3128_1") {
         //rk3128 10寸门口机
         ext.app_version_code = 60

+ 8 - 0
common/src/main/res/values/attrs.xml

@@ -97,4 +97,12 @@
             <enum name="CW270" value="270" />
         </attr>
     </declare-styleable>
+
+
+    <!--UI主题-->
+    <attr name="myBackgroundColor" format="color"/>
+    <attr name="myStatusBarColor" format="color"/>
+    <attr name="myTextColor" format="color"/>
+    <attr name="listBgColor" format="color"/>
+    <attr name="selectImgColor" format="color"/>
 </resources>

+ 5 - 0
common/src/main/res/values/colors.xml

@@ -11,4 +11,9 @@
     <color name="color_pop_header">#878a8a</color>
 
     <color name="color_main">#2F9DF1</color>
+
+    <color name="main_bg_color_girl">#FFBDC3</color>
+    <color name="main_bg_color_boy">#EAF2F9</color>
+    <color name="text_color_girl">#FD3B30</color>
+    <color name="text_color_boy">#0090ff</color>
 </resources>

+ 3 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/api/DoorDeviceApi.kt

@@ -28,4 +28,7 @@ interface DoorDeviceApi {
     //获取APP版本信息
     @POST("/deviceRoom/get_app_version")
     fun getAppVersion(@Query("part_id") part_id:Int, @Query("device_type") device_type:Int): Observable<ResponseBody>
+
+    @GET("/deviceRoom/get_clerk_by_customer_id/{customer_id}")
+    fun getClerkInfo(@Path("customer_id") customer_id: Int):Observable<ResponseBody>
 }

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

@@ -1,5 +1,7 @@
 package com.wdkl.ncs.android.middleware.common;
 
+import android.graphics.Color;
+
 import com.wdkl.ncs.android.middleware.tcp.enums.DeviceTypeEnum;
 
 public class Constant {
@@ -177,6 +179,10 @@ public class Constant {
     //是否静默升级
     public static boolean silentUpdate = true;
 
+    public static boolean babyGirl = true;
+    public static int colorGirl = Color.parseColor("#FD3B30");
+    public static int colorBoy = Color.parseColor("#0090ff");
+
     /**
      * Sip注册状态
      */
@@ -235,4 +241,6 @@ public class Constant {
     public static final int SIP_CONNECTED = 0x17;
 
     public static final int EVENT_END_CALL = 0x18;
+
+    public static final int EVENT_UPDATE_TITLE = 0x19;
 }

+ 5 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/logic/contract/callingdoor/MainFragmentContract.kt

@@ -1,5 +1,6 @@
 package com.wdkl.ncs.android.middleware.logic.contract.callingdoor
 
+import com.google.gson.JsonObject
 import com.wdkl.ncs.android.lib.base.BaseContract
 import com.wdkl.ncs.android.middleware.model.vo.FrameRoomVO
 
@@ -9,6 +10,8 @@ interface MainFragmentContract {
 
         fun showRoomInfo(roomInfo: FrameRoomVO)
 
+        fun showClerkInfo(data: JsonObject)
+
         fun onNoNet()
     }
 
@@ -17,5 +20,7 @@ interface MainFragmentContract {
         //获取房间床位信息
         fun loadRoomFrameInfo(frameId: Int)
 
+        //获取管床责护
+        fun loadClerk(customer_id: Int)
     }
 }

+ 30 - 8
middleware/src/main/code/com/wdkl/ncs/android/middleware/logic/presenter/callingdoor/MainFragmentPresenter.kt

@@ -6,6 +6,7 @@ import com.enation.javashop.net.engine.plugin.exception.ExceptionHandle
 import com.enation.javashop.net.engine.utils.ThreadFromUtils
 import com.google.gson.FieldNamingPolicy
 import com.google.gson.GsonBuilder
+import com.google.gson.JsonObject
 import com.wdkl.ncs.android.lib.base.RxPresenter
 import com.wdkl.ncs.android.lib.utils.*
 import com.wdkl.ncs.android.middleware.api.DoorDeviceApi
@@ -32,7 +33,16 @@ class MainFragmentPresenter @Inject constructor() : RxPresenter<MainFragmentCont
 
         override fun onNextWithConnection(result: Any, connectionQuality: ConnectionQuality) {
             providerView().complete("")
-            providerView().showRoomInfo(result as FrameRoomVO)
+
+            when (result) {
+                is FrameRoomVO -> {
+                    providerView().showRoomInfo(result)
+                }
+
+                is JsonObject -> {
+                    providerView().showClerkInfo(result)
+                }
+            }
         }
 
         override fun onErrorWithConnection(error: ExceptionHandle.ResponeThrowable, connectionQuality: ConnectionQuality) {
@@ -57,13 +67,25 @@ class MainFragmentPresenter @Inject constructor() : RxPresenter<MainFragmentCont
 
     override fun loadRoomFrameInfo(frameId: Int) {
         doorDeviceApi.getFrameInfo(frameId)
-                .map {
-                    val gson = GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create()
-                    val customerInfoVO = gson.fromJson(it.getJsonString(), FrameRoomVO::class.java)
+            .map {
+                val gson = GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create()
+                val customerInfoVO = gson.fromJson(it.getJsonString(), FrameRoomVO::class.java)
 
-                    return@map customerInfoVO
-                }
-                .compose(ThreadFromUtils.defaultSchedulers())
-                .subscribe(observer)
+                return@map customerInfoVO
+            }
+            .compose(ThreadFromUtils.defaultSchedulers())
+            .subscribe(observer)
+    }
+
+    override fun loadClerk(customer_id: Int) {
+        doorDeviceApi.getClerkInfo(customer_id)
+            .map {
+                val gson = GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create()
+                val data = gson.fromJson(it.getJsonString(), JsonObject::class.java)
+
+                return@map data
+            }
+            .compose(ThreadFromUtils.defaultSchedulers())
+            .subscribe(observer)
     }
 }