Pārlūkot izejas kodu

分机
修改为30秒自动熄屏
测试模式修改,增加屏幕触摸测试 ,防水按钮测试,门灯测试
门口机
测试模式修改,增加屏幕触摸测试 ,防水按钮测试,门灯测试

xunchuanzhi 6 mēneši atpakaļ
vecāks
revīzija
64d12a809c
22 mainītis faili ar 996 papildinājumiem un 181 dzēšanām
  1. 21 2
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/AppTextActivity.kt
  2. 1 1
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedActivity.kt
  3. 1 1
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedDormitoryActivity.kt
  4. 6 7
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/TextActivity.kt
  5. 8 8
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DromMianFragment.kt
  6. 2 0
      android_bed/src/main/res/layout-land/callingbed_main_dorm.xml
  7. 144 136
      android_bed/src/main/res/layout/test_lay.xml
  8. 4 0
      android_bed/src/main/sharedUserId/AndroidManifest.xml
  9. 4 6
      build.gradle
  10. 4 0
      callingdoor/src/main/AndroidManifest.xml
  11. 321 0
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/AppTextActivity.kt
  12. 60 4
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivationActivity.kt
  13. 3 1
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt
  14. 14 0
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/TextActivity.kt
  15. 1 0
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/di/CallingdoorComponent.kt
  16. 102 0
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/dialog/SystemDialogHelper2.java
  17. 63 0
      callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/helper/DrawingView.java
  18. 30 5
      callingdoor/src/main/res/layout-land/callingdoor_test_main.xml
  19. 34 9
      callingdoor/src/main/res/layout/callingdoor_test_main.xml
  20. 172 0
      callingdoor/src/main/res/layout/test_lay.xml
  21. BIN
      callingdoor/src/main/res/mipmap-mdpi/integ_arrow_icon.png
  22. 1 1
      common/src/main/code/com/wdkl/ncs/android/lib/utils/AppTool.kt

+ 21 - 2
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/AppTextActivity.kt

@@ -39,6 +39,7 @@ class AppTextActivity :BaseActivity<BedTextActivityPresenter, TestLayBinding>(),
     var testButton3 = false
 
     var sosState = 0
+    var doorState = 0
     var netOff = false
 
     private var mCamera: Camera? = null
@@ -73,7 +74,7 @@ class AppTextActivity :BaseActivity<BedTextActivityPresenter, TestLayBinding>(),
         tv_test_info.movementMethod = ScrollingMovementMethod.getInstance()
         tv_ip.text = "IP:" + NetHelper.getInstance().localIP
 
-        startCameraPreview()
+//        startCameraPreview()
 
 
     }
@@ -122,6 +123,25 @@ class AppTextActivity :BaseActivity<BedTextActivityPresenter, TestLayBinding>(),
                 SerialPortHelper.setSosLight("0")
             }
         }
+        btn_door_test.setOnClickListener {
+            if (doorState == 0) {
+                doorState = 1
+                //绿色
+                SerialPortHelper.setDoorLight(1, "001")
+            } else if (doorState == 1) {
+                doorState = 2
+                //白色
+                SerialPortHelper.setDoorLight(1, "111")
+            } else  if (doorState == 2){
+                doorState = 3
+                //红色闪烁
+                SerialPortHelper.setDoorLight(1, "200")
+            } else  if (doorState == 3){
+                doorState = 0
+                //关闭
+                SerialPortHelper.setDoorLight(1, "000")
+            }
+        }
     }
     private fun startTest() {
         is_startTest=true
@@ -286,7 +306,6 @@ class AppTextActivity :BaseActivity<BedTextActivityPresenter, TestLayBinding>(),
     }
 
 
-
 //    override fun onTouch(v: View?, event: MotionEvent?): Boolean {
 //        when (event?.action) {
 //            MotionEvent.ACTION_DOWN -> {

+ 1 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedActivity.kt

@@ -349,7 +349,7 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
         Utils.setStatusBarDisable(activity, Utils.STATUS_BAR_DISABLE_EXPAND)
 
         //保持屏幕常亮
-        AppTool.Setting.setScreenOffTimeOut(applicationContext, 35000)
+        AppTool.Setting.setScreenOffTimeOut(applicationContext, 35)
 
         presenter.loadServerInfo()
 

+ 1 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedDormitoryActivity.kt

@@ -289,7 +289,7 @@ class CallingbedDormitoryActivity :BaseActivity<BedCallingbedActivityPresenter,
 //        Utils.setStatusBarDisable(activity, Utils.STATUS_BAR_DISABLE_EXPAND)
 //
 //        //保持屏幕常亮
-        AppTool.Setting.setScreenOffTimeOut(applicationContext, 5)
+        AppTool.Setting.setScreenOffTimeOut(applicationContext, 30)
 
         presenter.loadServerInfo()
 

+ 6 - 7
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/TextActivity.kt

@@ -64,7 +64,6 @@ class TextActivity : BaseActivity<BedTextActivityPresenter, CallingbedTestMainBi
         RecordHelper.getInstance().init()
         if (SettingConfig.getSipEnabled(this)) {
             ll_sip_config_view.visibility = View.VISIBLE
-
             linphoneManager = LinphoneManager.getInstance(BaseApplication.appContext)
             LinphoneManager.sipTesting = true
 
@@ -148,20 +147,20 @@ class TextActivity : BaseActivity<BedTextActivityPresenter, CallingbedTestMainBi
         sos_img.visibility=View.INVISIBLE
         lycs_button.setBackgroundResource(R.drawable.shape_main_hos_txt_bg)
         lycs_img.visibility=View.INVISIBLE
-        if (BuildConfig.FLAVOR.equals("rk3128")){
-            text_ll_2.visibility =View.GONE
-            loar_button.text = "其他测试"
-        }else if (BuildConfig.FLAVOR.equals("dch_7")){
-            text_ll_4.visibility =View.GONE
-        }
         if (BuildConfig.device_type == "4"){
             text_sbaj_button.text = "按键1测试"
             text_sbqx_button.text = "按键2测试"
             mbhj_button.text = "按键3测试"
             mbhjqx_button.text = "SOS按键测试"
             sos_button.text = "相机测试"
+        }else if (BuildConfig.FLAVOR.equals("dch_7")){
+            text_ll_4.visibility =View.GONE
+        }else {
+            text_ll_2.visibility =View.GONE
+            loar_button.text = "其他测试"
         }
 
+
         //网络图标
         if ( Constant.network_state == 1){
             view_title_layout_iv_wifi.visibility = View.VISIBLE

+ 8 - 8
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DromMianFragment.kt

@@ -53,14 +53,14 @@ class DromMianFragment: BaseFragment<BedMomMianFragmentPresenter, MainView4Layou
     override fun bindEvent() {
         //智能家居
         main_view4_1_ll.setOnClickListener {
-            showMessage("暂未开通,敬请期待")
-//            val time = System.currentTimeMillis()
-//            if (time - clickBtnTime > 3000) {
-//                clickBtnTime = time
-//                (activity as CallingbedDormitoryActivity).showSmartHomeFragment()
-//            } else {
-//                showMessage(R.string.wait_moment)
-//            }
+//            showMessage("暂未开通,敬请期待")
+            val time = System.currentTimeMillis()
+            if (time - clickBtnTime > 3000) {
+                clickBtnTime = time
+                (activity as CallingbedDormitoryActivity).showSmartHomeFragment()
+            } else {
+                showMessage(R.string.wait_moment)
+            }
         }
 
         //交互历史

+ 2 - 0
android_bed/src/main/res/layout-land/callingbed_main_dorm.xml

@@ -27,6 +27,7 @@
                 android:layout_above="@+id/dorm_call_but"
                 android:layout_centerInParent="true"
                 android:layout_marginBottom="@dimen/d30"
+                android:visibility="gone"
                 android:background="@mipmap/d_main_dial" />
 
             <ImageButton
@@ -36,6 +37,7 @@
                 android:layout_above="@+id/dorm_sos_but"
                 android:layout_centerInParent="true"
                 android:layout_marginBottom="@dimen/d30"
+                android:visibility="gone"
                 android:background="@mipmap/d_main_call" />
 
             <ImageButton

+ 144 - 136
android_bed/src/main/res/layout/test_lay.xml

@@ -1,162 +1,170 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout>
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    android:background="@color/white">
-
     <RelativeLayout
-        android:id="@+id/text_top"
+        xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="match_parent"
-        android:layout_height="50dp"
-        android:background="@color/main_color">
-        <LinearLayout
-            android:id="@+id/view_title_layout_img"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:gravity="center"
-            android:clickable="true">
-        <ImageView
-            android:layout_width="15dp"
-            android:layout_height="25dp"
-            android:layout_marginLeft="30dp"
-            android:clickable="true"
-            android:background="@mipmap/integ_arrow_icon"
-            android:layout_centerVertical="true" />
-        </LinearLayout>
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textSize="28sp"
-            android:text="测试界面"
-            android:layout_centerHorizontal="true"
-            android:layout_centerVertical="true"
-            android:textColor="@color/white"/>
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:background="@color/white">
 
-    </RelativeLayout>
+        <RelativeLayout
+            android:id="@+id/text_top"
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:background="@color/main_color">
+            <LinearLayout
+                android:id="@+id/view_title_layout_img"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:clickable="true">
+                <ImageView
+                    android:layout_width="15dp"
+                    android:layout_height="25dp"
+                    android:layout_marginLeft="30dp"
+                    android:clickable="true"
+                    android:background="@mipmap/integ_arrow_icon"
+                    android:layout_centerVertical="true" />
+            </LinearLayout>
 
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="28sp"
+                android:text="测试界面"
+                android:layout_centerHorizontal="true"
+                android:layout_centerVertical="true"
+                android:textColor="@color/white"/>
 
+        </RelativeLayout>
 
-    <com.wdkl.app.ncs.callingbed.helper.DrawingView
-        android:id="@+id/slayout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@color/white"
-        android:visibility="gone" />
 
-    <View
-        android:id="@+id/color_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@color/black"
-        android:clickable="true"
-        android:visibility="gone" />
 
-    <LinearLayout
-        android:id="@+id/text_mian"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical"
-        android:layout_below="@+id/text_top">
-        <RelativeLayout
+        <com.wdkl.app.ncs.callingbed.helper.DrawingView
+            android:id="@+id/slayout"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content">
+            android:layout_height="match_parent"
+            android:background="@color/white"
+            android:visibility="gone" />
 
-            <SurfaceView
-                android:id="@+id/camera_preview_surface"
-                android:layout_width="240dp"
-                android:layout_height="240dp" />
+        <View
+            android:id="@+id/color_view"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@color/black"
+            android:clickable="true"
+            android:visibility="gone" />
 
-            <Button
-                android:id="@+id/btn_sos_test"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_margin="10dp"
-                android:layout_toRightOf="@id/camera_preview_surface"
-                android:text="SOS"
-                android:visibility="gone"
-                android:textSize="28sp"/>
-
-            <Button
-                android:id="@+id/btn_reset"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_margin="10dp"
-                android:layout_toRightOf="@id/btn_sos_test"
-                android:text="重置"
-                android:visibility="gone"
-                android:textSize="28sp"/>
-
-            <Button
-                android:id="@+id/btn_net_off"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_margin="10dp"
-                android:layout_toRightOf="@id/btn_reset"
-                android:text="网络开关"
-                android:visibility="gone"
-                android:textSize="28sp"/>
-
-            <Button
-                android:id="@+id/btn_color"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_margin="10dp"
-                android:layout_toRightOf="@id/btn_net_off"
-                android:text="屏幕颜色"
-                android:textSize="28sp"/>
+        <LinearLayout
+            android:id="@+id/text_mian"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:layout_below="@+id/text_top">
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <SurfaceView
+                    android:id="@+id/camera_preview_surface"
+                    android:layout_width="240dp"
+                    android:layout_height="240dp" />
+
+                <Button
+                    android:id="@+id/btn_sos_test"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:layout_toRightOf="@id/camera_preview_surface"
+                    android:text="卫生间灯"
+                    android:textSize="28sp"/>
+
+                <Button
+                    android:id="@+id/btn_door_test"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:layout_toRightOf="@id/btn_sos_test"
+                    android:text="门灯"
+                    android:textSize="28sp"/>
+
+                <Button
+                    android:id="@+id/btn_reset"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:layout_toRightOf="@id/btn_door_test"
+                    android:text="重置"
+                    android:visibility="gone"
+                    android:textSize="28sp"/>
+
+                <Button
+                    android:id="@+id/btn_net_off"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:layout_toRightOf="@id/btn_reset"
+                    android:text="网络开关"
+                    android:visibility="gone"
+                    android:textSize="28sp"/>
+
+                <Button
+                    android:id="@+id/btn_color"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:layout_toRightOf="@id/btn_net_off"
+                    android:text="屏幕颜色"
+                    android:textSize="28sp"/>
+
+                <Button
+                    android:id="@+id/btn_cm"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:layout_toRightOf="@id/btn_color"
+                    android:text="屏幕触摸"
+                    android:textSize="28sp"/>
+
+                <TextView
+                    android:id="@+id/tv_ip"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="10dp"
+                    android:layout_toRightOf="@id/camera_preview_surface"
+                    android:layout_below="@id/btn_cm"
+                    android:textSize="20sp"
+                    android:text="IP:"/>
+            </RelativeLayout>
 
-            <Button
-                android:id="@+id/btn_cm"
+            <TextView
+                android:id="@+id/tv_camera"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_margin="10dp"
-                android:layout_toRightOf="@id/btn_color"
-                android:text="屏幕触摸"
-                android:textSize="28sp"/>
+                android:layout_marginTop="10dp"
+                android:textSize="20sp"
+                android:visibility="gone"/>
 
             <TextView
-                android:id="@+id/tv_ip"
+                android:id="@+id/tv_test_info"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="10dp"
-                android:layout_toRightOf="@id/camera_preview_surface"
-                android:layout_below="@id/btn_cm"
-                android:textSize="20sp"
-                android:text="IP:"/>
-        </RelativeLayout>
+                android:layout_marginTop="10dp"
+                android:textSize="24sp"/>
+        </LinearLayout>
 
-        <TextView
-            android:id="@+id/tv_camera"
+        <Button
+            android:id="@+id/btn_fist"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="10dp"
-            android:textSize="20sp"
+            android:padding="10dp"
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:textColor="@color/white"
+            android:text="退出测试"
+            android:background="@drawable/shape_main_hos_txt_bg"
+            android:textSize="28sp"
             android:visibility="gone"/>
 
-        <TextView
-            android:id="@+id/tv_test_info"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="10dp"
-            android:textSize="24sp"/>
-    </LinearLayout>
-
-    <Button
-        android:id="@+id/btn_fist"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:padding="10dp"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:textColor="@color/white"
-        android:text="退出测试"
-        android:background="@drawable/shape_main_hos_txt_bg"
-        android:textSize="28sp"
-        android:visibility="gone"/>
-
-</RelativeLayout>
+    </RelativeLayout>
 </layout>

+ 4 - 0
android_bed/src/main/sharedUserId/AndroidManifest.xml

@@ -214,6 +214,10 @@
             android:turnScreenOn="true"
             android:screenOrientation="nosensor"
             android:launchMode="singleTask"/>
+        <activity android:name="com.wdkl.app.ncs.callingbed.activity.AppTextActivity"
+            android:turnScreenOn="true"
+            android:screenOrientation="nosensor"
+            android:launchMode="singleTask"/>
 
         <service android:name="com.wdkl.app.ncs.callingbed.bt_gateway.BluetoothService"/>
         <service android:name="com.wdkl.app.ncs.callingbed.sleep.SleepService"/>

+ 4 - 6
build.gradle

@@ -47,8 +47,8 @@ buildscript {
     /**
      * 配置要打包的模块
      */
-    ext.callingdoor = true
-    ext.android_bed = false
+    ext.callingdoor = false
+    ext.android_bed = true
     ext.android_host = false
     ext.android_mobile = false
     ext.android_visiting = false
@@ -65,13 +65,13 @@ buildscript {
     ext.open_433 = false
 
     //设备类型  0 医院 1 月子中心 2 养老院 3 公寓 4 宿舍
-    ext.device_type = "0"
+    ext.device_type = 4
 
     //睡眠设备类型  0 4g 1 串口 2 蓝牙 3 wifi
     ext.sleep_type = "3"
 
     //功能板  0 不带k6 k7 旧版本   1 带k6 k7 新版本
-    ext.feature_type = "0"
+    ext.feature_type = "1"
 
     //护士主机——声网探视
     ext.is_agora = false
@@ -85,8 +85,6 @@ buildscript {
         //门口机
         ext.app_version_code =118
         ext.app_version = "1.4.8"
-//        ext.app_version_code = 106
-//        ext.app_version = "1.3.6"
     } else if (android_bed) {
         //分机
         ext.app_version_code =118

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

@@ -70,6 +70,10 @@
             android:turnScreenOn="true"
             android:screenOrientation="nosensor"
             android:launchMode="singleTask"/>
+        <activity android:name="com.wdkl.app.ncs.callingdoor.activity.AppTextActivity"
+            android:turnScreenOn="true"
+            android:screenOrientation="nosensor"
+            android:launchMode="singleTask"/>
         <provider
             android:name="androidx.core.content.FileProvider"
             android:authorities="${applicationId}.provider"

+ 321 - 0
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/AppTextActivity.kt

@@ -0,0 +1,321 @@
+package com.wdkl.app.ncs.callingdoor.activity
+
+import android.graphics.Color
+import android.hardware.Camera
+import android.os.Bundle
+import android.text.method.ScrollingMovementMethod
+import android.view.SurfaceHolder
+import android.view.View
+import com.enation.javashop.android.jrouter.external.annotation.Router
+import com.enation.javashop.net.engine.model.NetState
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.databinding.TestLayBinding
+import com.wdkl.app.ncs.callingdoor.helper.*
+import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
+import com.wdkl.ncs.android.lib.base.BaseActivity
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.lib.vo.filter
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.common.MessageEvent
+import com.wdkl.ncs.android.middleware.logic.contract.callingbed.BedTextActivityContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingbed.BedTextActivityPresenter
+import kotlinx.android.synthetic.main.test_lay.*
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+
+@Router(path = "/callingbed/text")
+class AppTextActivity :BaseActivity<BedTextActivityPresenter, TestLayBinding>(), BedTextActivityContract.View{
+    private val TAG = "AppTextActivity"
+
+    var info = ""
+    var buttonTest = false
+    var is_startTest = false
+    var testButton1 = false
+    var testButton2 = false
+    var testButton3 = false
+
+    var sosState = 0
+    var doorState = 0
+    var netOff = false
+
+    private var mCamera: Camera? = null
+    val colors = arrayOf(
+            Color.BLACK,
+            Color.WHITE,
+            Color.RED,
+            Color.parseColor("#FFA500"), // 橙色
+            Color.YELLOW,
+            Color.GREEN,
+            Color.CYAN,
+            Color.BLUE,
+            Color.MAGENTA
+    )
+    var colorIndex = 0
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+    }
+
+    override fun getLayId(): Int {
+        return R.layout.test_lay
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        Constant.isText=true
+        tv_test_info.movementMethod = ScrollingMovementMethod.getInstance()
+        tv_ip.text = "IP:" + NetHelper.getInstance().localIP
+
+//        startCameraPreview()
+
+
+    }
+    private var red = 0
+    var is_cm = false
+    override fun bindEvent() {
+        view_title_layout_img.setOnClickListener {
+            finish()
+        }
+        btn_fist.setOnClickListener {
+            slayout.visibility = View.GONE
+            btn_fist.visibility = View.GONE
+            color_view.visibility = View.GONE
+
+        }
+
+        btn_color.setOnClickListener {
+            SoundPoolManager.getInstance().playSound(6, 1.0f, 1.0f, 0)
+            color_view.bringToFront()
+            color_view.visibility = View.VISIBLE
+            btn_fist.visibility = View.VISIBLE
+
+        }
+        color_view.setOnClickListener {
+            btn_fist.visibility = View.VISIBLE
+            color_view.setBackgroundColor(colors[colorIndex])
+            colorIndex = (colorIndex + 1) % colors.size
+        }
+        btn_cm.setOnClickListener {
+            SoundPoolManager.getInstance().playSound(7, 1.0f, 1.0f, 0)
+            is_cm=true
+            slayout.bringToFront()
+            slayout.visibility = View.VISIBLE
+            btn_fist.visibility = View.VISIBLE
+        }
+
+        btn_sos_test.setOnClickListener {
+            if (sosState == 0) {
+                sosState = 1
+                SerialPortHelper.setSosLight("1")
+            } else if (sosState == 1) {
+                sosState = 2
+                SerialPortHelper.setSosLight("2")
+            } else {
+                sosState = 0
+                SerialPortHelper.setSosLight("0")
+            }
+        }
+        btn_door_test.setOnClickListener {
+            if (doorState == 0) {
+                doorState = 1
+                //绿色
+                SerialPortHelper.setDoorLight(1, "001")
+            } else if (doorState == 1) {
+                doorState = 2
+                //白色
+                SerialPortHelper.setDoorLight(1, "111")
+            } else  if (doorState == 2){
+                doorState = 3
+                //红色闪烁
+                SerialPortHelper.setDoorLight(1, "200")
+            } else  if (doorState == 3){
+                doorState = 0
+                //关闭
+                SerialPortHelper.setDoorLight(1, "000")
+            }
+        }
+    }
+    private fun startTest() {
+        is_startTest=true
+        Thread {
+            info += "\r\n--> 麦克风测试:\r\n"
+            showInfo(info)
+            SoundPoolManager.getInstance().playSound(3, 1.0f, 1.0f, 0)
+            Thread.sleep(2000)
+            info += "开始录音...\r\n"
+            showInfo(info)
+            RecordHelper.getInstance().recordTestStart()
+            Thread.sleep(2500)
+            RecordHelper.getInstance().recordTestStop()
+            Thread.sleep(500)
+            info += "播放录音...\r\n"
+            showInfo(info)
+            MediaPlayHelper.getInstance().playUrlMusic(RecordHelper.getInstance().audiofilePath, 1.0f, false)
+
+            Thread.sleep(3000)
+            RecordHelper.getInstance().deleteAudioFile()
+
+            info += "--> 指示灯测试\r\n"
+            showInfo(info)
+            SerialPortHelper.setCallStatus("1")
+            Thread.sleep(2000)
+            SerialPortHelper.setCallStatus("0")
+
+            info += "===测试结束!===\r\n"
+            showInfo(info)
+            is_startTest=false
+        }.start()
+    }
+
+    private fun showInfo(text: String) {
+        activity.runOnUiThread {
+            if (tv_test_info != null) {
+                tv_test_info.text = text
+            }
+        }
+    }
+
+    private fun startCameraPreview() {
+        val num = Camera.getNumberOfCameras()
+        if (num > 0) {
+            val info = Camera.CameraInfo()
+            for (i in 0 until num) {
+                Camera.getCameraInfo(i, info)
+                if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
+                    try {
+                        mCamera = Camera.open(i)
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    }
+                    break
+                }
+            }
+
+            if (mCamera == null) {
+                try {
+                    mCamera = Camera.open()
+                } catch (e: Exception) {
+                    showMessage(R.string.str_open_camera_failed)
+                    e.printStackTrace()
+                }
+            }
+
+            camera_preview_surface.getHolder().addCallback(object : SurfaceHolder.Callback {
+                override fun surfaceCreated(holder: SurfaceHolder) {
+                    /**
+                     * The SurfaceHolder must already contain a surface when this method is called.
+                     * If you are using SurfaceView, you will need to register a SurfaceHolder.Callback
+                     * with SurfaceHolder#addCallback(SurfaceHolder.Callback) and wait for
+                     * SurfaceHolder.Callback#surfaceCreated(SurfaceHolder) before
+                     * calling setPreviewDisplay() or starting preview.
+                     * 相机的预览必须在surfaceCreated后调用,否则黑屏且没有任何提示哦
+                     */
+
+                    try {
+                        mCamera?.setPreviewDisplay(camera_preview_surface.getHolder())
+                        mCamera?.startPreview()
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    }
+                }
+
+                override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
+                    //
+                }
+
+                override fun surfaceDestroyed(holder: SurfaceHolder) {
+                    //
+                }
+            })
+        } else {
+            showMessage(R.string.str_no_camera)
+        }
+    }
+
+    override fun onStart() {
+        EventBus.getDefault().register(this)
+        super.onStart()
+    }
+
+    override fun onStop() {
+        EventBus.getDefault().unregister(this)
+        Constant.isText=false
+        super.onStop()
+    }
+
+    override fun destory() {
+        if (mCamera != null) {
+            mCamera!!.stopPreview()
+            mCamera!!.release()
+            mCamera = null
+        }
+        Constant.isText=false
+    }
+
+    override fun onResume() {
+        super.onResume()
+//        camera_preview.onResume(this)
+
+    }
+
+    override fun onPause() {
+//        camera_preview.onPause()
+        super.onPause()
+
+    }
+
+
+
+    override fun onError(message: String, type: Int) {
+        //
+    }
+
+    override fun complete(message: String, type: Int) {
+    }
+
+    override fun start() {
+    }
+
+    override fun networkMonitor(state: NetState) {
+        state.filter(onWifi = {
+
+        }, onMobile = {
+
+        }, offline = {
+
+        })
+    }
+
+
+
+
+
+
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+
+    }
+
+
+
+//    override fun onTouch(v: View?, event: MotionEvent?): Boolean {
+//        when (event?.action) {
+//            MotionEvent.ACTION_DOWN -> {
+//                if (is_cm){
+//                    v?.setBackgroundColor(Color.RED)
+//                }
+//                return true
+//            }
+//            MotionEvent.ACTION_MOVE -> {}
+//            MotionEvent.ACTION_UP -> {}
+//        }
+//        return false
+//    }
+}

+ 60 - 4
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivationActivity.kt

@@ -18,6 +18,7 @@ import com.wdkl.app.ncs.callingdoor.R
 import com.wdkl.app.ncs.callingdoor.databinding.CallingdoorActivationBinding
 import com.wdkl.app.ncs.callingdoor.dialog.ServicesDialogHelper
 import com.wdkl.app.ncs.callingdoor.dialog.SystemDialogHelper
+import com.wdkl.app.ncs.callingdoor.dialog.SystemDialogHelper2
 import com.wdkl.app.ncs.callingdoor.hardware.HardWareFactroy
 import com.wdkl.app.ncs.callingdoor.helper.*
 import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
@@ -41,8 +42,12 @@ import com.wdkl.ncs.android.middleware.utils.CommonUtils
 import kotlinx.android.synthetic.main.callingdoor_activation.*
 import okhttp3.OkHttpClient
 import okhttp3.Request
+import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
+import serialporttest.utils.SerialPortUtil
+import serialporttest.utils.SerialPortUtil433
+import serialporttest.utils.SerialPortUtilLoar
 import java.util.*
 import java.util.concurrent.TimeUnit
 
@@ -50,7 +55,7 @@ import java.util.concurrent.TimeUnit
   * 激活页面
   * */
  @Router(path = "/callingdoor/activation")
-class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresenter, CallingdoorActivationBinding>(), CallingdoorActivationContract.View {
+class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresenter, CallingdoorActivationBinding>(),  SerialPortUtil.ISerialPortBedOnclickEvent, SerialPortUtil.ISerialPortBedOnclickString,CallingdoorActivationContract.View {
 
     private val TAG = "CallingdoorActivationActivity"
     val QR_CODE_PATH = "http://m.wdklian.com/care/apk/care.user?type=NCS_DEVICE"
@@ -61,6 +66,8 @@ class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresent
     private var serverSuccess = false
     //是否重启
     private var cancelRestart = false
+    //是否是出厂测试模式
+    private var  isFactoryTxt= false
 
     private var clickTime: Long = 0
     private var clickTimes: Int = 1
@@ -118,6 +125,8 @@ class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresent
         showui()
 
         checkServer()
+
+        setSerialListener()
     }
 
     override fun bindEvent() {
@@ -128,7 +137,15 @@ class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresent
 
         //系统设置
         activation_system_button.setOnClickListener {
-            SystemDialogHelper.showDialog(activity,1)
+
+            SystemDialogHelper2.showDialog(activity, object : SystemDialogHelper2.ClickListener {
+                override fun onClick() {
+                    isFactoryTxt = true
+                    val intent = Intent()
+                    intent.setClass(activity, SystemActivity::class.java)
+                    activity.startActivity(intent)
+                }
+            })
         }
 
         //服务器设置
@@ -162,7 +179,15 @@ class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresent
     }
 
     override fun destory() {
-
+        if (isFactoryTxt ){
+            //主要是用了新的功能板
+            SerialPortUtil.getInstance().closeSerialPort()
+            if (BuildConfig.device_type == "4") {
+                SerialPortUtilLoar.getInstance().closeSerialPort()
+            } else {
+                SerialPortUtil433.getInstance().closeSerialPort()
+            }
+        }
     }
 
     private fun showui(){
@@ -245,7 +270,7 @@ class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresent
 
     private fun checkServer() {
         Thread {
-            while (!serverSuccess) {
+            while (!serverSuccess && !isFactoryTxt) {
                 val okHttpClient = OkHttpClient().newBuilder()
                         .connectTimeout(15 * 1000L, TimeUnit.MILLISECONDS)
                         .readTimeout(15 * 1000L, TimeUnit.MILLISECONDS)
@@ -289,7 +314,12 @@ class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresent
         }.start()
     }
 
+    //设置串口监听
+    fun setSerialListener() {
+        SerialPortUtil.getInstance().setOnDataReceiveListener(this)
+        SerialPortUtil.getInstance().setOnDataReceiveStringListener(this)
 
+    }
     private fun checkServerInfo(info: ThirdServerInfo?) {
         //检查获取到的服务器ip是否可用,可用则重启app重新初始化,不可用则什么都不做,等待下次重新获取服务器ip
         if (info != null) {
@@ -411,4 +441,30 @@ class CallingdoorActivationActivity  : BaseActivity<CallingdoorActivationPresent
     @Subscribe(threadMode = ThreadMode.MAIN)
     fun onMoonEvent(messageEvent: MessageEvent) {
     }
+
+    override fun serialPortBedOnclick(buffer: ByteArray) {
+        //测试模式
+        if (Constant.isText) {
+            if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2 || buffer[5].toInt() == 1 || buffer[5].toInt() == 2) {
+                EventBus.getDefault().post(MessageEvent("call", Constant.EVENT_SERIAL_TEST))
+            }else  if (buffer[7].toInt() == 1 || buffer[7].toInt() == 0) {
+                //紧急按钮
+                EventBus.getDefault().post(MessageEvent("call_sos", Constant.EVENT_SERIAL_TEST))
+            }
+            return
+        }
+
+    }
+
+    override fun serialPortBedOnclick2(status: String?) {
+
+    }
+
+    override fun serialPortSOSCall(status: String?) {
+
+    }
+
+    override fun serialPortBedOnclickString(str: String?) {
+
+    }
 }

+ 3 - 1
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt

@@ -1033,8 +1033,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
         Log.d("serialPortBedOnclick", "面板按键: " + buffer[0]+"紧急按钮"+buffer[7] + ", key[5]: " + buffer[5])
         //测试模式
         if (Constant.isText|| Constant.NursingTitle .equals("进入护理")) {
-            if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2) {
+            if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2 || buffer[5].toInt() == 1 || buffer[5].toInt() == 2) {
                 EventBus.getDefault().post(MessageEvent("call", Constant.EVENT_SERIAL_TEST))
+            }else if (buffer[7].toInt() == 1 || buffer[7].toInt() == 2|| buffer[7].toInt() == 0){
+                EventBus.getDefault().post(MessageEvent("call_sos", Constant.EVENT_SERIAL_TEST))
             }
             return
         }

+ 14 - 0
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/TextActivity.kt

@@ -1,6 +1,8 @@
 package com.wdkl.app.ncs.callingdoor.activity
 
+import android.content.Intent
 import android.hardware.Camera
+import android.util.Log
 import android.view.SurfaceHolder
 import android.view.View
 import android.widget.Toast
@@ -88,6 +90,12 @@ class TextActivity : BaseActivity<TextActivityPresenter, CallingdoorTestMainBind
             finish()
         }
 
+        qt_button.setOnClickListener {
+            finish()
+            val intent = Intent()
+            intent.setClass(activity, AppTextActivity::class.java)
+            activity.startActivity(intent)
+        }
     }
 
     override fun destory() {
@@ -233,6 +241,7 @@ class TextActivity : BaseActivity<TextActivityPresenter, CallingdoorTestMainBind
     fun onMoonEvent(messageEvent: MessageEvent) {
         if (Constant.EVENT_SERIAL_TEST == messageEvent.type) {
                 val message = messageEvent.message as String
+            Log.d("SerialPortUtil", "message==$message")
                 if (message == "call") {
                     mbhj_button.setBackgroundResource(R.drawable.shape_reinforcements_dialog_bt_bg)
                     mbh_img.visibility=View.VISIBLE
@@ -249,6 +258,11 @@ class TextActivity : BaseActivity<TextActivityPresenter, CallingdoorTestMainBind
                     //录音中
                     lycs_button.setText(R.string.str_recording)
 
+                }else if(message == "call_sos"){
+                    //紧急按钮
+                    sos_button.setBackgroundResource(R.drawable.shape_reinforcements_dialog_bt_bg)
+                    sos_img.visibility=View.VISIBLE
+                    SerialPortHelper.setSosLight("2")
                 }
         }else if (Constant.EVENT_FINISHh == messageEvent.type) {
             finish()

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

@@ -41,5 +41,6 @@ interface CallingdoorComponent {
 
 
     fun inject(activity: DeviceSystemActivity)
+    fun inject(activity: AppTextActivity)
 
 }

+ 102 - 0
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/dialog/SystemDialogHelper2.java

@@ -0,0 +1,102 @@
+package com.wdkl.app.ncs.callingdoor.dialog;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.zhyl.ZhylManager;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.provider.Settings;
+import android.util.DisplayMetrics;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.app.ncs.callingdoor.helper.Utils;
+
+import static com.wdkl.ncs.android.lib.utils.ExtendMethodsKt.showMessage;
+/**
+ * 激活页面-进入系统设置
+ * */
+public class SystemDialogHelper2 {
+
+    private static AlertDialog alertDialog;
+
+
+
+    public static void showDialog(Activity activity, ClickListener clickListener) {
+
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.main_password_dialog, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+
+        LinearLayout layout = contentView.findViewById(R.id.ll_password_view);
+        Button password_cancel_button = contentView.findViewById(R.id.password_cancel_button);
+        Button password_determine_button = contentView.findViewById(R.id.password_determine_button);
+        EditText password_ed = contentView.findViewById(R.id.password_ed);
+
+        layout.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                try {
+                    Utils.hideInputKeyboard(alertDialog.getWindow().getDecorView().getWindowToken());
+                } catch (Exception e) {
+                    //
+                }
+            }
+        });
+
+        password_cancel_button.setOnClickListener(v -> {
+            if (alertDialog != null && alertDialog.isShowing()) {
+                alertDialog.dismiss();
+            }
+        });
+        password_determine_button.setOnClickListener(v -> {
+            if (alertDialog != null && alertDialog.isShowing()) {
+                String passwprd =password_ed.getText().toString();
+                if (passwprd.equals("888")){
+                    if (clickListener != null) {
+
+                        clickListener.onClick();
+                    }
+
+
+                } else {
+                    showMessage(R.string.invalid_password);
+                }
+                alertDialog.dismiss();
+            }
+        });
+        alertDialog = builder.create();
+        alertDialog.setCanceledOnTouchOutside(true);
+        alertDialog.setCancelable(true);
+        alertDialog.show();
+
+        DisplayMetrics metrics = new DisplayMetrics();
+        activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+        int screenWidth = metrics.widthPixels;
+        int orientation = activity.getResources().getConfiguration().orientation;
+        if (orientation == Configuration.ORIENTATION_PORTRAIT && screenWidth>600) {
+            try {
+                Window window = alertDialog.getWindow();
+                WindowManager.LayoutParams lp = window.getAttributes();
+                lp.width = 800;
+                lp.height = 650;
+                lp.gravity = Gravity.CENTER;
+                window.setAttributes(lp);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public interface ClickListener{
+        void onClick( );
+    }
+}

+ 63 - 0
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/helper/DrawingView.java

@@ -0,0 +1,63 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+
+public class DrawingView extends View {
+    private Paint paint;
+    private Path path;
+
+    public DrawingView(Context context) {
+        super(context);
+        init();
+    }
+
+    public DrawingView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        init();
+    }
+
+    private void init() {
+        paint = new Paint();
+        paint.setColor(Color.RED);
+        paint.setStyle(Paint.Style.STROKE);
+        paint.setStrokeWidth(20);
+
+        path = new Path();
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+        canvas.drawPath(path, paint);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        float x = event.getX();
+        float y = event.getY();
+
+        switch (event.getAction()) {
+            case MotionEvent.ACTION_DOWN:
+                path.moveTo(x, y);
+                break;
+            case MotionEvent.ACTION_MOVE:
+                path.lineTo(x, y);
+                break;
+            case MotionEvent.ACTION_UP:
+                // 可以在此处进行一些额外的操作
+                break;
+        }
+
+        invalidate(); // 刷新视图
+
+        return true;
+    }
+}
+

+ 30 - 5
callingdoor/src/main/res/layout-land/callingdoor_test_main.xml

@@ -24,7 +24,7 @@
             android:layout_width="@dimen/d475"
             android:layout_height="match_parent"
             android:background="@drawable/shape_bed_bg"
-            android:layout_marginTop="@dimen/d63"
+            android:layout_marginTop="@dimen/d20"
             android:layout_marginLeft="@dimen/d24"
             android:layout_marginBottom="@dimen/d50"
             android:gravity="center_horizontal"
@@ -34,7 +34,7 @@
                 android:layout_width="@dimen/d88"
                 android:layout_height="@dimen/d88"
                 android:src="@mipmap/hedimg"
-                android:layout_marginTop="@dimen/d66" />
+                android:layout_marginTop="@dimen/d40" />
 
             <TextView
                 android:layout_width="match_parent"
@@ -86,7 +86,7 @@
             android:layout_width="@dimen/d491"
             android:layout_height="match_parent"
             android:background="@drawable/shape_bed_bg"
-            android:layout_marginTop="@dimen/d63"
+            android:layout_marginTop="@dimen/d20"
             android:layout_marginRight="@dimen/d28"
             android:layout_marginLeft="@dimen/d16"
             android:layout_marginBottom="@dimen/d50"
@@ -96,7 +96,7 @@
             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="66dp"
+                android:layout_marginTop="20dp"
                 android:text="@string/test_peripheral"
                 android:textColor="@color/black"
                 android:textStyle="bold"
@@ -213,8 +213,8 @@
                     android:background="@mipmap/gou"
                     android:visibility="invisible" />
             </LinearLayout>
-            <LinearLayout
 
+            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
@@ -242,6 +242,31 @@
                     android:layout_marginLeft="@dimen/d8"
                     />
             </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:gravity="center"
+                android:layout_marginTop="@dimen/d16"
+                >
+                <Button
+                    android:id="@+id/qt_button"
+                    android:layout_width="@dimen/d383"
+                    android:layout_height="@dimen/d48"
+                    android:gravity="center"
+                    android:background="@drawable/shape_main_hos_txt_bg"
+                    android:text="@string/test_peripheral"
+                    android:textSize="16sp"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"/>
+                <ImageView
+                    android:id="@+id/qt_img"
+                    android:layout_width="@dimen/d16"
+                    android:layout_height="@dimen/d16"
+                    android:background="@mipmap/gou"
+                    android:visibility="invisible"
+                    android:layout_marginLeft="@dimen/d8"
+                    />
+            </LinearLayout>
 
         </LinearLayout>
 

+ 34 - 9
callingdoor/src/main/res/layout/callingdoor_test_main.xml

@@ -35,7 +35,7 @@
                 android:layout_width="@dimen/d88"
                 android:layout_height="@dimen/d88"
                 android:src="@mipmap/hedimg"
-                android:layout_marginTop="@dimen/d66" />
+                android:layout_marginTop="@dimen/d20" />
 
             <TextView
                 android:layout_width="match_parent"
@@ -87,7 +87,7 @@
             android:layout_width="@dimen/d491"
             android:layout_height="wrap_content"
             android:background="@drawable/shape_bed_bg"
-            android:layout_marginTop="@dimen/d20"
+            android:layout_marginTop="@dimen/d5"
             android:layout_marginRight="@dimen/d28"
             android:layout_marginLeft="@dimen/d16"
             android:layout_below="@+id/text_ll_1"
@@ -98,7 +98,7 @@
             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="46dp"
+                android:layout_marginTop="26dp"
                 android:text="@string/test_peripheral"
                 android:textColor="@color/black"
                 android:textStyle="bold"
@@ -118,7 +118,7 @@
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:gravity="center"
-                android:layout_marginTop="@dimen/d23"
+                android:layout_marginTop="@dimen/d10"
                 >
                 <Button
                     android:id="@+id/text_sbaj_button"
@@ -144,7 +144,7 @@
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:gravity="center"
-                android:layout_marginTop="@dimen/d16"
+                android:layout_marginTop="@dimen/d10"
                 >
                 <Button
                     android:id="@+id/mbhj_button"
@@ -170,7 +170,7 @@
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:gravity="center"
-                android:layout_marginTop="@dimen/d16"
+                android:layout_marginTop="@dimen/d10"
                 >
                 <Button
                     android:id="@+id/mbhjqx_button"
@@ -195,7 +195,7 @@
                 android:id="@+id/text_ll_5"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="@dimen/d16"
+                android:layout_marginTop="@dimen/d10"
                 android:gravity="center"
                 android:orientation="horizontal">
 
@@ -223,8 +223,7 @@
                 android:layout_height="wrap_content"
                 android:orientation="horizontal"
                 android:gravity="center"
-                android:layout_marginTop="@dimen/d16"
-                android:paddingBottom="@dimen/d20"
+                android:layout_marginTop="@dimen/d10"
                 >
                 <Button
                     android:id="@+id/lycs_button"
@@ -247,6 +246,32 @@
                     android:layout_marginLeft="@dimen/d8"
                     />
             </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:gravity="center"
+                android:layout_marginTop="@dimen/d10"
+                android:layout_marginBottom="@dimen/d20"
+                >
+                <Button
+                    android:id="@+id/qt_button"
+                    android:layout_width="@dimen/d383"
+                    android:layout_height="@dimen/d48"
+                    android:gravity="center"
+                    android:background="@drawable/shape_main_hos_txt_bg"
+                    android:text="@string/test_peripheral"
+                    android:textSize="16sp"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"/>
+                <ImageView
+                    android:id="@+id/qt_img"
+                    android:layout_width="@dimen/d16"
+                    android:layout_height="@dimen/d16"
+                    android:background="@mipmap/gou"
+                    android:visibility="invisible"
+                    android:layout_marginLeft="@dimen/d8"
+                    />
+            </LinearLayout>
 
         </LinearLayout>
 

+ 172 - 0
callingdoor/src/main/res/layout/test_lay.xml

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:background="@color/white">
+
+    <RelativeLayout
+        android:id="@+id/text_top"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:background="@color/main_color">
+        <LinearLayout
+            android:id="@+id/view_title_layout_img"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:clickable="true">
+        <ImageView
+            android:layout_width="15dp"
+            android:layout_height="25dp"
+            android:layout_marginLeft="30dp"
+            android:clickable="true"
+            android:background="@mipmap/integ_arrow_icon"
+            android:layout_centerVertical="true" />
+        </LinearLayout>
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="28sp"
+            android:text="测试界面"
+            android:layout_centerHorizontal="true"
+            android:layout_centerVertical="true"
+            android:textColor="@color/white"/>
+
+    </RelativeLayout>
+
+
+
+    <com.wdkl.app.ncs.callingdoor.helper.DrawingView
+        android:id="@+id/slayout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/white"
+        android:visibility="gone" />
+
+    <View
+        android:id="@+id/color_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/black"
+        android:clickable="true"
+        android:visibility="gone" />
+
+    <LinearLayout
+        android:id="@+id/text_mian"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:layout_below="@+id/text_top">
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <SurfaceView
+                android:id="@+id/camera_preview_surface"
+                android:layout_width="240dp"
+                android:layout_height="240dp" />
+
+            <Button
+                android:id="@+id/btn_sos_test"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/camera_preview_surface"
+                android:text="卫生间灯"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_door_test"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_sos_test"
+                android:text="门灯"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_reset"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_door_test"
+                android:text="重置"
+                android:visibility="gone"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_net_off"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_reset"
+                android:text="网络开关"
+                android:visibility="gone"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_color"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_below="@+id/btn_sos_test"
+                android:layout_toRightOf="@id/camera_preview_surface"
+                android:text="屏幕颜色"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_cm"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_color"
+                android:layout_below="@+id/btn_sos_test"
+                android:text="屏幕触摸"
+                android:textSize="28sp"/>
+
+            <TextView
+                android:id="@+id/tv_ip"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:layout_toRightOf="@id/camera_preview_surface"
+                android:layout_below="@id/btn_cm"
+                android:textSize="20sp"
+                android:text="IP:"/>
+        </RelativeLayout>
+
+        <TextView
+            android:id="@+id/tv_camera"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:textSize="20sp"
+            android:visibility="gone"/>
+
+        <TextView
+            android:id="@+id/tv_test_info"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:textSize="24sp"/>
+    </LinearLayout>
+
+    <Button
+        android:id="@+id/btn_fist"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="10dp"
+        android:layout_alignParentBottom="true"
+        android:layout_centerHorizontal="true"
+        android:textColor="@color/white"
+        android:text="退出测试"
+        android:background="@drawable/shape_main_hos_txt_bg"
+        android:textSize="28sp"
+        android:visibility="gone"/>
+
+</RelativeLayout>
+</layout>

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


+ 1 - 1
common/src/main/code/com/wdkl/ncs/android/lib/utils/AppTool.kt

@@ -290,7 +290,7 @@ object AppTool {
                 if (!"rk3128".equals(Build.MODEL) && !"rk3368".equals(Build.MODEL)) {
                     Settings.System.putInt(
                             context.contentResolver,
-                            Settings.System.SCREEN_OFF_TIMEOUT, timeout*60*1000
+                            Settings.System.SCREEN_OFF_TIMEOUT, timeout*1000
                     )
                 }
             } catch (e: java.lang.Exception) {