Bläddra i källkod

志合主板A133门口机初始化上传

weizhengliang 2 år sedan
förälder
incheckning
97f19e5279
100 ändrade filer med 11651 tillägg och 0 borttagningar
  1. 4 0
      android_door/build.gradle
  2. 36 0
      android_door/src/main/h10_a133_chile/AndroidManifest.xml
  3. 178 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/activity/AppUpdateActivity.kt
  4. 1748 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt
  5. 90 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/BedItemAdapter.java
  6. 96 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/CostItemAdapter.kt
  7. 445 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/FrameRoomAdapter.kt
  8. 56 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/NumAdapter.java
  9. 60 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/NurseConfigAdpter.kt
  10. 17 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/agreement/CallingdoorAgreement.kt
  11. 20 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/di/CallingdoorComponent.kt
  12. 22 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/entity/HandleEntity.java
  13. 163 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/BaseCallFragment.kt
  14. 171 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/MainFragment.kt
  15. 213 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/QrCodeFragment.kt
  16. 620 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/SkyCallFragment.kt
  17. 227 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/TestFragment.kt
  18. 228 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/AnrFcExceptionUtil.java.bak
  19. 47 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/AppInfoDialogHelper.java
  20. 243 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/AppUpdateHelper.java
  21. 189 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/AsyncPlayer.java
  22. 83 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/CallDialogHelper.java
  23. 85 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/CallbedDialogHelper.java
  24. 50 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/DoorLightHelper.java
  25. 188 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/HttpHelper.java
  26. 140 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/LanguageSetDialogHelper.java
  27. 80 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/LocaleMangerUtils.java
  28. 219 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/MediaPlayHelper.java
  29. 496 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/NetHelper.java
  30. 127 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/PasswordDialogHelper.java
  31. 126 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/RecordHelper.java
  32. 22 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/RingPlayHelper.java
  33. 63 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/SOSHelper.java
  34. 81 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/ScreenManagerUtil.kt
  35. 69 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/SerialPortHelper.java
  36. 159 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/ServerConfigDialogHelper.java
  37. 86 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/SoundPoolManager.java
  38. 101 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/UpdateTipsDialogHelper.java
  39. 59 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/Utils.java
  40. 184 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/VoiceManagerUtil.java
  41. 50 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/WarningDialogHelper.java
  42. 242 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/XCrashUtils.java
  43. 20 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/launch/CallingdoorLaunch.kt
  44. 362 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/settings/SettingConfig.java
  45. 579 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/sip/SipHelper.java.bak
  46. 17 0
      android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/sip/SipStatus.java.bak
  47. 7 0
      android_door/src/main/h10_a133_chile/res/anim/slide_down_in.xml
  48. 7 0
      android_door/src/main/h10_a133_chile/res/anim/slide_left_in.xml
  49. 7 0
      android_door/src/main/h10_a133_chile/res/anim/slide_right_out.xml
  50. 7 0
      android_door/src/main/h10_a133_chile/res/anim/slide_up_out.xml
  51. 34 0
      android_door/src/main/h10_a133_chile/res/drawable-v24/ic_launcher_foreground.xml
  52. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_answer.png
  53. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_answer_normal.png
  54. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_answer_press.png
  55. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/ic_door_launch.xml
  56. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_hangup.png
  57. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_hangup_normal.png
  58. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_hangup_press.png
  59. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/ic_language.xml
  60. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/ic_language2.xml
  61. 170 0
      android_door/src/main/h10_a133_chile/res/drawable/ic_launcher_background.xml
  62. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_nurse.png
  63. BIN
      android_door/src/main/h10_a133_chile/res/drawable/ic_nurse_call.png
  64. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/ic_nursing.xml
  65. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/ic_nursing2.xml
  66. 8 0
      android_door/src/main/h10_a133_chile/res/drawable/radiobutton_background_checked.xml
  67. 8 0
      android_door/src/main/h10_a133_chile/res/drawable/radiobutton_background_unchecked.xml
  68. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_action_button_bg.xml
  69. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_action_button_text_color.xml
  70. 6 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_bottom_btn_text_color.xml
  71. 7 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_button_bg_color.xml
  72. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_call_answer.xml
  73. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_call_end.xml
  74. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_call_hangup.xml
  75. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_main.xml
  76. 5 0
      android_door/src/main/h10_a133_chile/res/drawable/selector_record_btn.xml
  77. 7 0
      android_door/src/main/h10_a133_chile/res/drawable/shape_frame_bg.xml
  78. 50 0
      android_door/src/main/h10_a133_chile/res/layout/adapter_call_bed.xml
  79. 137 0
      android_door/src/main/h10_a133_chile/res/layout/adapter_call_records_item.xml
  80. 22 0
      android_door/src/main/h10_a133_chile/res/layout/call_bed_dialog_lay.xml
  81. 67 0
      android_door/src/main/h10_a133_chile/res/layout/call_dialog_lay.xml
  82. 238 0
      android_door/src/main/h10_a133_chile/res/layout/callingdoor_main_lay.xml
  83. 246 0
      android_door/src/main/h10_a133_chile/res/layout/callingdoor_main_lay_rk3288.xml
  84. 14 0
      android_door/src/main/h10_a133_chile/res/layout/cost_view_lay.xml
  85. 17 0
      android_door/src/main/h10_a133_chile/res/layout/digital_item.xml
  86. 33 0
      android_door/src/main/h10_a133_chile/res/layout/item_action_view.xml
  87. 291 0
      android_door/src/main/h10_a133_chile/res/layout/item_bed.xml
  88. 325 0
      android_door/src/main/h10_a133_chile/res/layout/item_bed_rk3288.xml
  89. 325 0
      android_door/src/main/h10_a133_chile/res/layout/item_bed_rk3288_800.xml
  90. 39 0
      android_door/src/main/h10_a133_chile/res/layout/item_cost_detail.xml
  91. 38 0
      android_door/src/main/h10_a133_chile/res/layout/item_cost_main_view.xml
  92. 38 0
      android_door/src/main/h10_a133_chile/res/layout/item_nurse_config.xml
  93. 83 0
      android_door/src/main/h10_a133_chile/res/layout/language_set_dialog.xml
  94. 18 0
      android_door/src/main/h10_a133_chile/res/layout/main_view_layout.xml
  95. 65 0
      android_door/src/main/h10_a133_chile/res/layout/password_dialog_lay.xml
  96. 256 0
      android_door/src/main/h10_a133_chile/res/layout/qr_code_lay.xml
  97. 189 0
      android_door/src/main/h10_a133_chile/res/layout/server_config_dialog_lay.xml
  98. 135 0
      android_door/src/main/h10_a133_chile/res/layout/sky_voice_call_layout.xml
  99. 136 0
      android_door/src/main/h10_a133_chile/res/layout/sky_voice_call_layout_rk3288.xml
  100. 0 0
      android_door/src/main/h10_a133_chile/res/layout/spinner_item.xml

+ 4 - 0
android_door/build.gradle

@@ -47,6 +47,10 @@ android {
             main.java.srcDirs += 'src/main/h10_3128_chile/java'
             main.res.srcDirs += 'src/main/h10_3128_chile/res'
             main.manifest.srcFile 'src/main/h10_3128_chile/AndroidManifest.xml'
+        } else if (app_device_type == "mk_h10_w_a133_1_chile") {
+            main.java.srcDirs += 'src/main/h10_a133_chile/java'
+            main.res.srcDirs += 'src/main/h10_a133_chile/res'
+            main.manifest.srcFile 'src/main/h10_a133_chile/AndroidManifest.xml'
         }
     }
 

+ 36 - 0
android_door/src/main/h10_a133_chile/AndroidManifest.xml

@@ -0,0 +1,36 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    package="com.wdkl.app.ncs.callingdoor">
+
+    <uses-permission android:name="android.permission.INTERNET"/>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
+    <uses-permission android:name="android.permission.BLUETOOTH"/>
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
+
+    <application
+        android:allowBackup="true"
+        android:label="@string/javashop_app_name"
+        android:supportsRtl="true" >
+
+        <activity android:name="com.wdkl.app.ncs.callingdoor.activity.CallingdoorActivity"
+            android:screenOrientation="landscape"
+            android:launchMode="singleInstance"/>
+
+        <activity android:name="com.wdkl.app.ncs.callingdoor.activity.AppUpdateActivity"
+            android:screenOrientation="landscape"
+            android:launchMode="singleTask"/>
+
+        <provider
+            android:name="android.support.v4.content.FileProvider"
+            android:authorities="${applicationId}.provider"
+            tools:replace="android:authorities"
+            android:grantUriPermissions="true"
+            android:exported="false">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/file_paths" />
+        </provider>
+    </application>
+</manifest>

+ 178 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/activity/AppUpdateActivity.kt

@@ -0,0 +1,178 @@
+package com.wdkl.app.ncs.callingdoor.activity
+
+import android.content.Intent
+import android.os.Build
+import android.text.TextUtils
+import android.util.Log
+import com.enation.javashop.android.jrouter.external.annotation.Router
+import com.enation.javashop.net.engine.model.NetState
+import com.example.yf_rk3288_api.YF_RK3288_API_Manager
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.databinding.UpdateLayBinding
+import com.wdkl.app.ncs.callingdoor.helper.AppUpdateHelper
+import com.wdkl.app.ncs.callingdoor.helper.HttpHelper
+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.api.UrlManager
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.logic.contract.callingdoor.AppUpdateContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingdoor.AppUpdatePresenter
+import kotlinx.android.synthetic.main.update_lay.*
+import java.io.File
+
+@Router(path = "/callingdoor/update")
+class AppUpdateActivity :BaseActivity<AppUpdatePresenter, UpdateLayBinding>(), AppUpdateContract.View {
+    private val TAG = "AppUpdateActivity"
+
+    private val urlManager = UrlManager.build()
+
+    override fun getLayId(): Int {
+        return R.layout.update_lay
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        Constant.APP_UPDATING = true
+        if (!TextUtils.isEmpty(Constant.APP_PATH)) {
+            val downloadPath = urlManager.base + Constant.APP_PATH
+            Log.e(TAG, "start download: $downloadPath")
+            downLoadAPK(downloadPath)
+        } else {
+            showMessage(R.string.download_error)
+            finish()
+        }
+    }
+
+    /**
+     * 下载APK包
+     */
+    fun downLoadAPK(url: String) {
+        Log.d(TAG, "downLoadAPK  url==$url")
+        activity_appupdate_dialog_progressview.setCurProgress(0)
+        activity_update_version.setText(Constant.APP_PATH.substringAfterLast("/"))
+        activity_update_version.setOnLongClickListener {
+            Log.d(TAG, "downLoadAPK cancel...")
+            HttpHelper.cancelRequestByTag(TAG)
+            activity.finish()
+
+            return@setOnLongClickListener true
+        }
+
+        HttpHelper.download(url, TAG, object : HttpHelper.DownloadListener {
+            override fun onDownloadSuccess() {
+                Log.d("download", "onDownloadSuccess==")
+                if (Constant.silentUpdate) {
+                    runOnUiThread {
+                        activity_update_text_download.setText(R.string.updating)
+                    }
+                    if ("rk3288".equals(Build.MODEL)) {
+                        installApkForRk3288()
+                    } else {
+                        startInstallApk()
+                    }
+                } else {
+                    if ("rk3288".equals(Build.MODEL)) {
+                        runOnUiThread {
+                            activity_update_text_download.setText(R.string.updating)
+                        }
+                        installApkForRk3288()
+                    } else if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+                        startInstallApk()
+                    } else {
+                        AppUpdateHelper.installAPK(activity)
+                    }
+                }
+            }
+
+            override fun onDownloading(progress: Int) {
+                runOnUiThread {
+                    activity_appupdate_dialog_progressview.setCurProgress(progress)
+                }
+            }
+
+            override fun onDownloadFailed() {
+                Log.d("download", "onDownloadFailed==")
+                finish()
+            }
+        })
+    }
+
+    //静默升级
+    fun startInstallApk() {
+        Thread {
+            AppUpdateHelper.updateApp(this, object : AppUpdateHelper.UpdateCallBack {
+                override fun onFailed() {
+                    runOnUiThread {
+                        showMessage(R.string.update_fail)
+                        finish()
+                    }
+                }
+
+                override fun onSuccess() {
+                    runOnUiThread {
+                        showMessage(R.string.update_success)
+                        //finish()
+                        android.os.Process.killProcess(android.os.Process.myPid())
+                        System.exit(0)
+                    }
+                }
+            })
+        }.start()
+    }
+
+
+    fun installApkForRk3288() {
+        val path = AppUpdateHelper.FILE_APK_PATH + "/" + AppUpdateHelper.FILE_APK_NAME
+        if (File(path).exists()) {
+            //val yfRk3288ApiManager = YF_RK3288_API_Manager(activity)
+            //yfRk3288ApiManager.yfslientinstallapk(path)
+
+            val intent = Intent("com.android.yf_slient_install")
+            intent.putExtra("path", path)  //要静默安装的apk路径
+            intent.putExtra("isboot", true)  //安装完成后是否启动
+            sendBroadcast(intent)
+        } else {
+            showMessage(R.string.update_fail)
+            finish()
+        }
+    }
+
+    override fun bindEvent() {
+        //
+    }
+
+    override fun destory() {
+        Constant.APP_UPDATING = false
+    }
+
+    //数据加载错误
+    override fun onError(message: String, type: Int) {
+        //
+    }
+
+    //数据加载完成
+    override fun complete(message: String, type: Int) {
+        //
+    }
+
+    //开始获取数据
+    override fun start() {
+        //
+    }
+
+    //网络监听
+    override fun networkMonitor(state: NetState) {
+        state.filter(onMobile = {
+
+        },onWifi = {
+
+        },offline = {
+
+        })
+    }
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1748 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt


+ 90 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/BedItemAdapter.java

@@ -0,0 +1,90 @@
+package com.wdkl.app.ncs.callingdoor.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.ncs.android.middleware.common.Constant;
+import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO;
+import com.wdkl.ncs.android.middleware.utils.CommonUtils;
+
+import java.util.ArrayList;
+
+public class BedItemAdapter extends RecyclerView.Adapter<BedItemAdapter.BedViewHolder> {
+
+    private Context context;
+    private ArrayList<FrameBedVO> data;
+    private BedClickListener clickListener;
+
+    public BedItemAdapter(Context context, ArrayList<FrameBedVO> data) {
+        this.context = context;
+        this.data = data;
+    }
+
+    @Override
+    public BedViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.adapter_call_bed, viewGroup, false);
+        BedViewHolder viewHolder = new BedViewHolder(view);
+
+        return viewHolder;
+    }
+
+    @Override
+    public void onBindViewHolder(BedViewHolder bedViewHolder, int i) {
+        String name = CommonUtils.subStringAfter(data.get(i).getFrameBed().getFullName(), "-");
+        bedViewHolder.bedName.setText(name);
+        bedViewHolder.name.setText(data.get(i).getCustomerName());
+        if (Constant.supportCamera) {
+            bedViewHolder.videoCall.setVisibility(View.VISIBLE);
+        } else {
+            bedViewHolder.videoCall.setVisibility(View.GONE);
+        }
+
+        bedViewHolder.voiceCall.setOnClickListener(v -> {
+            if (clickListener != null) {
+                clickListener.onVoiceClick(data.get(bedViewHolder.getAdapterPosition()));
+            }
+        });
+
+        bedViewHolder.videoCall.setOnClickListener(v -> {
+            if (clickListener != null) {
+                clickListener.onVideoClick(data.get(bedViewHolder.getAdapterPosition()));
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return data.size();
+    }
+
+    public void setCallClickListener(BedClickListener listener) {
+        clickListener = listener;
+    }
+
+
+    class BedViewHolder extends RecyclerView.ViewHolder {
+        TextView bedName;
+        TextView name;
+        Button voiceCall;
+        Button videoCall;
+
+        BedViewHolder(View itemView) {
+            super(itemView);
+            bedName = itemView.findViewById(R.id.tv_call_bed_name);
+            name = itemView.findViewById(R.id.tv_call_name);
+            voiceCall = itemView.findViewById(R.id.btn_voice_call);
+            videoCall = itemView.findViewById(R.id.btn_video_call);
+        }
+    }
+
+    public interface BedClickListener{
+        void onVoiceClick(FrameBedVO bedVO);
+        void onVideoClick(FrameBedVO bedVO);
+    }
+}

+ 96 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/CostItemAdapter.kt

@@ -0,0 +1,96 @@
+package com.wdkl.app.ncs.callingdoor.adapter
+
+import android.content.Context
+import android.support.v7.widget.LinearLayoutManager
+import android.support.v7.widget.RecyclerView
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.ncs.android.middleware.model.vo.CustomerFeeConfigByGroupNameVO
+import com.wdkl.ncs.android.middleware.model.vo.CustomerFeeConfigVO
+import com.wdkl.ncs.android.middleware.utils.StringUtil
+
+class CostItemAdapter : RecyclerView.Adapter<CostItemAdapter.ParentViewHolder> {
+
+    private var context: Context
+    private var mainData: ArrayList<CustomerFeeConfigByGroupNameVO>
+
+    constructor(context: Context, data: ArrayList<CustomerFeeConfigByGroupNameVO>) {
+        this.context = context
+        this.mainData = data
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ParentViewHolder {
+        val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_cost_main_view, parent, false)
+        val viewHolder = ParentViewHolder(view)
+
+        return viewHolder
+    }
+
+    override fun onBindViewHolder(holder: ParentViewHolder?, position: Int) {
+        holder?.costGroupName?.text = mainData.get(position).feeGroupName
+        holder?.costGroupTotal?.text = StringUtil.getResString(R.string.subtotal) + mainData.get(position).subtotal
+
+        val layoutManager = LinearLayoutManager(context)
+        holder?.costDetail?.layoutManager = layoutManager
+        holder?.costDetail?.adapter = CostDetailAdapter(mainData.get(position).customerFeeConfigList)
+    }
+
+    override fun getItemCount(): Int {
+        return mainData.size
+    }
+
+    class ParentViewHolder : RecyclerView.ViewHolder {
+        var costGroupName : TextView
+        var costGroupTotal : TextView
+        var costDetail : RecyclerView
+
+        constructor(itemView: View): super(itemView) {
+            costGroupName = itemView.findViewById(R.id.tv_cost_group_name)
+            costGroupTotal = itemView.findViewById(R.id.tv_cost_group_total)
+            costDetail = itemView.findViewById(R.id.rv_cost_detail)
+        }
+    }
+
+    class CostDetailAdapter : RecyclerView.Adapter<CostDetailAdapter.ChildViewHolder> {
+        private var costData: List<CustomerFeeConfigVO>
+
+        constructor(data: List<CustomerFeeConfigVO>) {
+            costData = data
+        }
+
+        override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ChildViewHolder {
+            val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_cost_detail, parent, false)
+            val viewHolder = ChildViewHolder(view)
+
+            return viewHolder
+        }
+
+        override fun onBindViewHolder(holder: ChildViewHolder?, position: Int) {
+            holder?.costName?.text = costData.get(position).feeName
+            holder?.costValue?.text = "" + costData.get(position).feeValue
+            holder?.costId?.text = costData.get(position).keyCode
+            holder?.costUnit?.text = costData.get(position).unit
+        }
+
+        override fun getItemCount(): Int {
+            return costData.size
+        }
+
+        class ChildViewHolder : RecyclerView.ViewHolder {
+            var costName : TextView
+            var costValue : TextView
+            var costId : TextView
+            var costUnit : TextView
+
+            constructor(item : View) : super(item) {
+                costName = item.findViewById(R.id.tv_item_cost_name)
+                costValue = item.findViewById(R.id.tv_item_cost_value)
+                costId = item.findViewById(R.id.tv_item_cost_id)
+                costUnit = item.findViewById(R.id.tv_item_cost_unit)
+            }
+        }
+    }
+}

+ 445 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/FrameRoomAdapter.kt

@@ -0,0 +1,445 @@
+package com.wdkl.app.ncs.callingdoor.adapter
+
+import android.content.Context
+import android.graphics.Color
+import android.graphics.drawable.Drawable
+import android.os.Build
+import android.support.v7.widget.RecyclerView
+import android.text.TextUtils
+import android.util.Log
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageView
+import android.widget.LinearLayout
+import android.widget.TextView
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.ncs.android.lib.widget.FlickerTextView
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.model.dto.NurseConfigDto
+import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO
+import com.wdkl.ncs.android.middleware.utils.CommonUtils
+import com.wdkl.ncs.android.middleware.utils.StringUtil
+
+class FrameRoomAdapter : RecyclerView.Adapter<FrameRoomAdapter.BedViewHolder> {
+
+    private var context: Context
+    private var data: ArrayList<FrameBedVO>
+    private var configList = ArrayList<NurseConfigDto>()
+    private var callingFrameIds = ArrayList<Int>()
+
+    private var drawableMale: Drawable
+    private var drawableFemale: Drawable
+    private var drawableEmpty: Drawable
+    private var iconMale: Drawable
+    private var iconFemale: Drawable
+
+    constructor(context: Context, data: ArrayList<FrameBedVO>) {
+        this.context = context
+        this.data = data
+
+        if ("rk3288".equals(Build.MODEL)) {
+            drawableEmpty = context.resources.getDrawable(R.mipmap.ic_custom_empty2)
+            drawableEmpty.setBounds(0, 0, drawableEmpty.minimumWidth, drawableEmpty.minimumHeight)
+            drawableMale = context.resources.getDrawable(R.mipmap.ic_custom_male2)
+            drawableMale.setBounds(0, 0, drawableMale.minimumWidth, drawableMale.minimumHeight)
+            drawableFemale = context.resources.getDrawable(R.mipmap.ic_custom_female2)
+            drawableFemale.setBounds(0, 0, drawableFemale.minimumWidth, drawableFemale.minimumHeight)
+            iconMale = context.resources.getDrawable(R.mipmap.ic_gender_male2)
+            iconMale.setBounds(0, 0, iconMale.minimumWidth, iconMale.minimumHeight)
+            iconFemale = context.resources.getDrawable(R.mipmap.ic_gender_female2)
+            iconFemale.setBounds(0, 0, iconFemale.minimumWidth, iconFemale.minimumHeight)
+        } else {
+            drawableEmpty = context.resources.getDrawable(R.mipmap.ic_custom_empty)
+            drawableEmpty.setBounds(0, 0, drawableEmpty.minimumWidth, drawableEmpty.minimumHeight)
+            drawableMale = context.resources.getDrawable(R.mipmap.ic_custom_male)
+            drawableMale.setBounds(0, 0, drawableMale.minimumWidth, drawableMale.minimumHeight)
+            drawableFemale = context.resources.getDrawable(R.mipmap.ic_custom_female)
+            drawableFemale.setBounds(0, 0, drawableFemale.minimumWidth, drawableFemale.minimumHeight)
+            iconMale = context.resources.getDrawable(R.mipmap.ic_gender_male)
+            iconMale.setBounds(0, 0, iconMale.minimumWidth, iconMale.minimumHeight)
+            iconFemale = context.resources.getDrawable(R.mipmap.ic_gender_female)
+            iconFemale.setBounds(0, 0, iconFemale.minimumWidth, iconFemale.minimumHeight)
+        }
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): BedViewHolder {
+        if ("rk3288".equals(Build.MODEL)) {
+            if (Constant.DEVICE_HEIGHT == 1280 && Constant.DEVICE_WIDTH == 800) {
+                val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_bed_rk3288_800, parent, false)
+                return BedViewHolder(view)
+            } else {
+                val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_bed_rk3288, parent, false)
+                return BedViewHolder(view)
+            }
+        } else {
+            val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_bed, parent, false)
+            return BedViewHolder(view)
+        }
+    }
+
+    override fun onBindViewHolder(holder: BedViewHolder, position: Int) {
+        try {
+            initDefaultNursingConfigs()
+            val pos = position % data.size
+
+            if ("rk3288".equals(Build.MODEL)) {
+                showBedInfoRk3288(holder, data.get(pos))
+            } else {
+                showBedInfo(holder, data.get(pos))
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    }
+
+    override fun getItemCount(): Int {
+        if (data.size <= 3) {
+            return data.size
+        } else {
+            return Int.MAX_VALUE
+        }
+    }
+
+    fun setData(data: ArrayList<FrameBedVO>) {
+        this.data = data
+        callingFrameIds.clear()
+        notifyDataSetChanged()
+    }
+
+    private fun initDefaultNursingConfigs() {
+        //初始化默认护理项
+        configList.clear()
+        for (index in 1..5) {
+            var item = NurseConfigDto()
+            item.nurseConfigName = StringUtil.getResString(R.string.default_nurse_config_name)
+            item.nurseOptionName = StringUtil.getResString(R.string.str_empty)
+            item.nurseColorRbg = "D7D7D7"
+            configList.add(item)
+        }
+    }
+
+    private fun showBedInfo(holder: BedViewHolder, bedVO: FrameBedVO) {
+        val bedFrameName = CommonUtils.subStringAfter(bedVO.frameBed.fullName, "-")
+        holder.bedName.text = bedFrameName
+        holder.bedName.clearAnimation()
+
+        for (frameId in callingFrameIds) {
+            if (frameId == bedVO.frameBed.id) {
+                //有床位呼叫,闪烁
+                holder.bedName.text = context.getString(R.string.voice_call_speech, bedFrameName)
+                holder.bedName.startFlick()
+            }
+        }
+
+        if (TextUtils.isEmpty(bedVO.customerName)) {
+            //空床位
+            holder.customName.setText(R.string.str_empty)
+            holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
+            holder.customAge.visibility = View.GONE
+            holder.doctorIcon.visibility = View.GONE
+            holder.doctorTitle.visibility = View.GONE
+            holder.doctorName.visibility = View.GONE
+            holder.nurseIcon.visibility = View.GONE
+            holder.nurseTitle.visibility = View.GONE
+            holder.nurseName.visibility = View.GONE
+        } else {
+            //有入住
+            holder.customName.text = bedVO.customerName
+            holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
+            holder.customAge.visibility = View.VISIBLE
+            holder.customAge.text = "" + bedVO.customerAge + bedVO.customerAgeUnit
+            if (bedVO.customerSex == 0) {
+                holder.customName.setCompoundDrawables(null, drawableFemale, null, null)
+                holder.customAge.setCompoundDrawables(iconFemale, null, null, null)
+            } else if (bedVO.customerSex == 1) {
+                holder.customName.setCompoundDrawables(null, drawableMale, null, null)
+                holder.customAge.setCompoundDrawables(iconMale, null, null, null)
+            } else {
+                holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
+                holder.customAge.setCompoundDrawables(null, null, null, null)
+            }
+            holder.doctorName.text = bedVO.doctorName
+            holder.nurseName.text = bedVO.nurseName
+
+            if (!TextUtils.isEmpty(Constant.doctorTitle)) {
+                holder.doctorTitle.text = Constant.doctorTitle
+            } else {
+                holder.doctorTitle.setText(R.string.doctor_title)
+            }
+
+            if (!TextUtils.isEmpty(Constant.nurseTitle)) {
+                holder.nurseTitle.text = Constant.nurseTitle
+            } else {
+                holder.nurseTitle.setText(R.string.nurse_title)
+            }
+
+            if (Constant.doctorValid == 1) {
+                holder.doctorIcon.visibility = View.VISIBLE
+                holder.doctorTitle.visibility = View.VISIBLE
+                holder.doctorName.visibility = View.VISIBLE
+            } else {
+                holder.doctorIcon.visibility = View.GONE
+                holder.doctorTitle.visibility = View.GONE
+                holder.doctorName.visibility = View.GONE
+            }
+
+            if (Constant.nurseValid == 1) {
+                holder.nurseIcon.visibility = View.VISIBLE
+                holder.nurseTitle.visibility = View.VISIBLE
+                holder.nurseName.visibility = View.VISIBLE
+            } else {
+                holder.nurseIcon.visibility = View.GONE
+                holder.nurseTitle.visibility = View.GONE
+                holder.nurseName.visibility = View.GONE
+            }
+
+            val nursingConfigs = bedVO.nurseConfigDtos
+            if (nursingConfigs != null && nursingConfigs.size > 0) {
+                for ((index, e) in nursingConfigs.withIndex()) {
+                    if (index < configList.size) {
+                        configList.set(index, e)
+                    } else {
+                        configList.add(e)
+                    }
+                }
+            }
+        }
+
+        if (TextUtils.isEmpty(configList[0].nurseColorRbg)) {
+            holder.nursingColor1.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor1.setBackgroundColor(Color.parseColor("#" + configList[0].nurseColorRbg))
+        }
+        holder.nursingName1.setText(configList[0].nurseConfigName)
+        holder.nursingValue1.setText(configList[0].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[1].nurseColorRbg)) {
+            holder.nursingColor2.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor2.setBackgroundColor(Color.parseColor("#" + configList[1].nurseColorRbg))
+        }
+        holder.nursingName2.setText(configList[1].nurseConfigName)
+        holder.nursingValue2.setText(configList[1].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[2].nurseColorRbg)) {
+            holder.nursingColor3.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor3.setBackgroundColor(Color.parseColor("#" + configList[2].nurseColorRbg))
+        }
+        holder.nursingName3.setText(configList[2].nurseConfigName)
+        holder.nursingValue3.setText(configList[2].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[3].nurseColorRbg)) {
+            holder.nursingColor4.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor4.setBackgroundColor(Color.parseColor("#" + configList[3].nurseColorRbg))
+        }
+        holder.nursingName4.setText(configList[3].nurseConfigName)
+        holder.nursingValue4.setText(configList[3].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[4].nurseColorRbg)) {
+            holder.nursingColor5.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor5.setBackgroundColor(Color.parseColor("#" + configList[4].nurseColorRbg))
+        }
+        holder.nursingName5.setText(configList[4].nurseConfigName)
+        holder.nursingValue5.setText(configList[4].nurseOptionName)
+    }
+
+    private fun showBedInfoRk3288(holder: BedViewHolder, bedVO: FrameBedVO) {
+        val bedFrameName = CommonUtils.subStringAfter(bedVO.frameBed.fullName, "-")
+        holder.bedName.text = bedFrameName
+        holder.bedName.clearAnimation()
+
+        for (frameId in callingFrameIds) {
+            if (frameId == bedVO.frameBed.id) {
+                //有床位呼叫,闪烁
+                holder.bedName.text = context.getString(R.string.voice_call_speech, bedFrameName)
+                holder.bedName.startFlick()
+            }
+        }
+
+        if (TextUtils.isEmpty(bedVO.customerName)) {
+            //空床位
+            holder.customName.setText(R.string.str_empty)
+            holder.customName.setCompoundDrawables(drawableEmpty, null, null, null)
+            holder.customAge.visibility = View.GONE
+            holder.doctorIcon.visibility = View.GONE
+            holder.doctorTitle.visibility = View.GONE
+            holder.doctorName.visibility = View.GONE
+            holder.nurseIcon.visibility = View.GONE
+            holder.nurseTitle.visibility = View.GONE
+            holder.nurseName.visibility = View.GONE
+        } else {
+            //有入住
+            holder.customName.text = bedVO.customerName
+            holder.customName.setCompoundDrawables(null, drawableEmpty, null, null)
+            holder.customAge.visibility = View.VISIBLE
+            holder.customAge.text = "" + bedVO.customerAge + bedVO.customerAgeUnit
+            if (bedVO.customerSex == 0) {
+                holder.customName.setCompoundDrawables(drawableFemale, null, null, null)
+                holder.customAge.setCompoundDrawables(iconFemale, null, null, null)
+            } else if (bedVO.customerSex == 1) {
+                holder.customName.setCompoundDrawables(drawableMale, null, null, null)
+                holder.customAge.setCompoundDrawables(iconMale, null, null, null)
+            } else {
+                holder.customName.setCompoundDrawables(drawableEmpty, null, null, null)
+                holder.customAge.setCompoundDrawables(null, null, null, null)
+            }
+            holder.doctorName.text = bedVO.doctorName
+            holder.nurseName.text = bedVO.nurseName
+
+            if (!TextUtils.isEmpty(Constant.doctorTitle)) {
+                holder.doctorTitle.text = Constant.doctorTitle
+            } else {
+                holder.doctorTitle.setText(R.string.doctor_title)
+            }
+
+            if (!TextUtils.isEmpty(Constant.nurseTitle)) {
+                holder.nurseTitle.text = Constant.nurseTitle
+            } else {
+                holder.nurseTitle.setText(R.string.nurse_title)
+            }
+
+            if (Constant.doctorValid == 1) {
+                holder.doctorIcon.visibility = View.VISIBLE
+                holder.doctorTitle.visibility = View.VISIBLE
+                holder.doctorName.visibility = View.VISIBLE
+            } else {
+                holder.doctorIcon.visibility = View.GONE
+                holder.doctorTitle.visibility = View.GONE
+                holder.doctorName.visibility = View.GONE
+            }
+
+            if (Constant.nurseValid == 1) {
+                holder.nurseIcon.visibility = View.VISIBLE
+                holder.nurseTitle.visibility = View.VISIBLE
+                holder.nurseName.visibility = View.VISIBLE
+            } else {
+                holder.nurseIcon.visibility = View.GONE
+                holder.nurseTitle.visibility = View.GONE
+                holder.nurseName.visibility = View.GONE
+            }
+
+            val nursingConfigs = bedVO.nurseConfigDtos
+            if (nursingConfigs != null && nursingConfigs.size > 0) {
+                for ((index, e) in nursingConfigs.withIndex()) {
+                    if (index < configList.size) {
+                        configList.set(index, e)
+                    } else {
+                        configList.add(e)
+                    }
+                }
+            }
+        }
+
+        if (TextUtils.isEmpty(configList[0].nurseColorRbg)) {
+            holder.nursingColor1.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor1.setBackgroundColor(Color.parseColor("#" + configList[0].nurseColorRbg))
+        }
+        holder.nursingName1.setText(configList[0].nurseConfigName)
+        holder.nursingValue1.setText(configList[0].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[1].nurseColorRbg)) {
+            holder.nursingColor2.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor2.setBackgroundColor(Color.parseColor("#" + configList[1].nurseColorRbg))
+        }
+        holder.nursingName2.setText(configList[1].nurseConfigName)
+        holder.nursingValue2.setText(configList[1].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[2].nurseColorRbg)) {
+            holder.nursingColor3.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor3.setBackgroundColor(Color.parseColor("#" + configList[2].nurseColorRbg))
+        }
+        holder.nursingName3.setText(configList[2].nurseConfigName)
+        holder.nursingValue3.setText(configList[2].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[3].nurseColorRbg)) {
+            holder.nursingColor4.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor4.setBackgroundColor(Color.parseColor("#" + configList[3].nurseColorRbg))
+        }
+        holder.nursingName4.setText(configList[3].nurseConfigName)
+        holder.nursingValue4.setText(configList[3].nurseOptionName)
+
+        if (TextUtils.isEmpty(configList[4].nurseColorRbg)) {
+            holder.nursingColor5.setBackgroundColor(Color.parseColor("#D7D7D7"))
+        } else {
+            holder.nursingColor5.setBackgroundColor(Color.parseColor("#" + configList[4].nurseColorRbg))
+        }
+        holder.nursingName5.setText(configList[4].nurseConfigName)
+        holder.nursingValue5.setText(configList[4].nurseOptionName)
+    }
+
+    fun updateCallings(frameId: Int, flick: Boolean) {
+        if (flick) {
+            callingFrameIds.add(frameId)
+        } else {
+            callingFrameIds.remove(frameId)
+        }
+        notifyDataSetChanged()
+    }
+
+    class BedViewHolder: RecyclerView.ViewHolder {
+        var bedName : FlickerTextView
+        var nursingColor1 : View
+        var nursingName1 : TextView
+        var nursingValue1 : TextView
+        var nursingColor2 : View
+        var nursingName2 : TextView
+        var nursingValue2 : TextView
+        var nursingColor3 : View
+        var nursingName3 : TextView
+        var nursingValue3 : TextView
+        var nursingColor4 : View
+        var nursingName4 : TextView
+        var nursingValue4 : TextView
+        var nursingColor5 : View
+        var nursingName5 : TextView
+        var nursingValue5 : TextView
+        var nursingView : LinearLayout
+
+
+        var customName : TextView
+        var customAge : TextView
+        var doctorIcon : ImageView
+        var doctorTitle : TextView
+        var doctorName : TextView
+        var nurseIcon : ImageView
+        var nurseTitle : TextView
+        var nurseName : TextView
+
+        constructor(itemView: View): super(itemView) {
+            bedName = itemView.findViewById(R.id.tv_bed_name_title)
+            nursingColor1 = itemView.findViewById(R.id.nurse_config_item_color1)
+            nursingName1 = itemView.findViewById(R.id.nurse_config_item_name1)
+            nursingValue1 = itemView.findViewById(R.id.nurse_config_item_value1)
+            nursingColor2 = itemView.findViewById(R.id.nurse_config_item_color2)
+            nursingName2 = itemView.findViewById(R.id.nurse_config_item_name2)
+            nursingValue2 = itemView.findViewById(R.id.nurse_config_item_value2)
+            nursingColor3 = itemView.findViewById(R.id.nurse_config_item_color3)
+            nursingName3 = itemView.findViewById(R.id.nurse_config_item_name3)
+            nursingValue3 = itemView.findViewById(R.id.nurse_config_item_value3)
+            nursingColor4 = itemView.findViewById(R.id.nurse_config_item_color4)
+            nursingName4 = itemView.findViewById(R.id.nurse_config_item_name4)
+            nursingValue4 = itemView.findViewById(R.id.nurse_config_item_value4)
+            nursingColor5 = itemView.findViewById(R.id.nurse_config_item_color5)
+            nursingName5 = itemView.findViewById(R.id.nurse_config_item_name5)
+            nursingValue5 = itemView.findViewById(R.id.nurse_config_item_value5)
+            nursingView = itemView.findViewById(R.id.ll_nurse_configs)
+
+            customName = itemView.findViewById(R.id.bed_customer_name)
+            customAge = itemView.findViewById(R.id.bed_customer_age)
+            doctorIcon = itemView.findViewById(R.id.bed_doctor_icon)
+            doctorTitle = itemView.findViewById(R.id.bed_doctor_title)
+            doctorName = itemView.findViewById(R.id.bed_doctor_name)
+            nurseIcon = itemView.findViewById(R.id.bed_nurse_icon)
+            nurseTitle = itemView.findViewById(R.id.bed_nurse_title)
+            nurseName = itemView.findViewById(R.id.bed_nurse_name)
+        }
+    }
+}

+ 56 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/NumAdapter.java

@@ -0,0 +1,56 @@
+package com.wdkl.app.ncs.callingdoor.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.wdkl.app.ncs.callingdoor.R;
+
+public class NumAdapter extends BaseAdapter {
+    private String[] num;
+    private Context context;
+
+    public NumAdapter(String[] numbers, Context context) {
+        this.num = numbers;
+        this.context = context;
+    }
+
+
+    @Override
+    public int getCount() {
+        return num.length;
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return num[position];
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder viewHolder;
+        if (convertView == null) {
+            convertView = LayoutInflater.from(context).inflate(R.layout.digital_item, null);
+            viewHolder = new ViewHolder();
+            viewHolder.numTv = convertView.findViewById(R.id.tv_number);
+            convertView.setTag(viewHolder);
+        } else {
+            viewHolder = (ViewHolder) convertView.getTag();
+        }
+        viewHolder.numTv.setText(num[position]);
+
+        return convertView;
+    }
+
+    static class ViewHolder {
+        TextView numTv;
+    }
+}

+ 60 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/adapter/NurseConfigAdpter.kt

@@ -0,0 +1,60 @@
+package com.wdkl.app.ncs.callingdoor.adapter
+
+import android.content.Context
+import android.graphics.Color
+import android.support.v7.widget.RecyclerView
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.ncs.android.middleware.model.dto.NurseConfigDto
+import java.lang.Exception
+
+class NurseConfigAdpter : RecyclerView.Adapter<NurseConfigAdpter.ViewHolder> {
+    private var context: Context
+    private var data: ArrayList<NurseConfigDto>
+
+    constructor(context: Context, data: ArrayList<NurseConfigDto>) {
+        this.context = context
+        this.data = data
+    }
+
+    override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
+        val view = LayoutInflater.from(parent?.context).inflate(R.layout.item_nurse_config, parent, false)
+        val viewHolder = ViewHolder(view)
+
+        return viewHolder
+    }
+
+    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
+        try {
+            holder.nurseColor.setBackgroundColor(Color.parseColor("#"+data.get(position).nurseColorRbg))
+            holder.nurseName.setText(data.get(position).nurseConfigName)
+            holder.nurseValue.setText(data.get(position).nurseOptionName)
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    }
+
+    override fun getItemCount(): Int {
+        return data.size
+    }
+
+    fun updateData(data: ArrayList<NurseConfigDto>) {
+        this.data = data
+        notifyDataSetChanged()
+    }
+
+    class ViewHolder: RecyclerView.ViewHolder {
+        var nurseColor : TextView
+        var nurseName : TextView
+        var nurseValue : TextView
+
+        constructor(itemView: View): super(itemView) {
+            nurseColor = itemView.findViewById(R.id.tv_nurse_color)
+            nurseName = itemView.findViewById(R.id.tv_nurse_config_name)
+            nurseValue = itemView.findViewById(R.id.tv_nurse_config_value)
+        }
+    }
+}

+ 17 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/agreement/CallingdoorAgreement.kt

@@ -0,0 +1,17 @@
+package com.wdkl.app.ncs.callingdoor.agreement
+
+import com.wdkl.ncs.android.middleware.model.dto.NurseConfigDto
+
+interface CallingdoorAgreement {
+
+    //检查APP版本
+    fun checkAppVersion()
+
+    fun cancelRestart()
+
+    fun startCountDownSleep()
+
+    fun cancelSleep()
+
+    fun resetSleepTime()
+}

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

@@ -0,0 +1,20 @@
+package com.wdkl.app.ncs.callingdoor.di
+
+import com.wdkl.app.ncs.callingdoor.activity.AppUpdateActivity
+import com.wdkl.app.ncs.callingdoor.activity.CallingdoorActivity
+import com.wdkl.app.ncs.callingdoor.fragment.*
+import com.wdkl.ncs.android.middleware.di.ApplicationComponent
+import dagger.Component
+
+@Component(dependencies = arrayOf(ApplicationComponent::class))
+interface CallingdoorComponent {
+    fun inject(activity: CallingdoorActivity)
+
+    fun inject(activity: AppUpdateActivity)
+
+    fun inject(fragment: MainFragment)
+
+    fun inject(fragment: QrCodeFragment)
+
+    fun inject(fragment: TestFragment)
+}

+ 22 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/entity/HandleEntity.java

@@ -0,0 +1,22 @@
+package com.wdkl.app.ncs.callingdoor.entity;
+
+public class HandleEntity {
+    private String bedName;
+    private long time;
+
+    public String getBedName() {
+        return bedName;
+    }
+
+    public void setBedName(String bedName) {
+        this.bedName = bedName;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public void setTime(long time) {
+        this.time = time;
+    }
+}

+ 163 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/BaseCallFragment.kt

@@ -0,0 +1,163 @@
+package com.wdkl.app.ncs.callingdoor.fragment
+
+import android.os.Bundle
+import android.os.CountDownTimer
+import android.support.v4.app.Fragment
+import android.view.LayoutInflater
+import android.view.MotionEvent
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import com.enation.javashop.utils.base.tool.BaseToolActivity
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.helper.RingPlayHelper
+import com.wdkl.app.ncs.callingdoor.settings.SettingConfig
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.common.MessageEvent
+import com.wdkl.ncs.android.middleware.tcp.TcpClient
+import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
+import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
+import org.greenrobot.eventbus.EventBus
+
+abstract class BaseCallFragment: Fragment(), View.OnTouchListener {
+
+    private var layout: View? = null
+
+    protected lateinit var baseActivity: BaseToolActivity
+
+    //通话状态:0-呼叫主机, 1-来电, 2-呼叫分机
+    protected var callState : Int = 0
+    protected var tcpModel: TcpModel? = null
+    protected var bedId: Int = -1
+    protected var tid: String? = ""
+
+    //计时器
+    lateinit var countDownTimer: CountDownTimer
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        retainInstance = true
+        callState = arguments.getInt("call_state")
+        bedId = arguments.getInt("bed_id")
+        tid = arguments.getString("tcp_tid")
+        if (arguments.getSerializable("tcp_model") != null) {
+            tcpModel = arguments.getSerializable("tcp_model") as TcpModel
+        }
+    }
+
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
+        if (layout == null) {
+            layout = inflater.inflate(getLayId(), null)
+        }
+
+        /**初始化宿主Activity*/
+        baseActivity = getActivity() as BaseToolActivity
+
+        return layout
+    }
+
+    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
+        super.onViewCreated(view, savedInstanceState)
+
+        init()
+        bindEvent()
+
+        view!!.setOnTouchListener(this)
+    }
+
+    override fun onDestroyView() {
+        super.onDestroyView()
+        destroy()
+    }
+
+    override fun onStart() {
+        EventBus.getDefault().register(this)
+        super.onStart()
+    }
+
+    override fun onStop() {
+        EventBus.getDefault().unregister(this)
+        super.onStop()
+    }
+
+    protected abstract fun getLayId(): Int
+
+    protected abstract fun init()
+
+    protected abstract fun bindEvent()
+
+    protected abstract fun destroy()
+
+    protected abstract fun callEnd(handoff: Boolean)
+
+    override fun onTouch(v: View?, event: MotionEvent?): Boolean {
+        return true
+    }
+
+    //初始化计时器
+    protected fun initCountDownTimer(view: TextView) {
+        val overTime = SettingConfig.getSipOverTime(baseActivity) * 1000L
+        countDownTimer = object: CountDownTimer(overTime, 1000) {
+            override fun onTick(millisUntilFinished: Long) {
+                if (view != null) {
+                    val time = millisUntilFinished/1000
+                    val timeText = getString(R.string.countdown_time, time)
+                    view.setText(timeText)
+                }
+            }
+
+            override fun onFinish() {
+                //呼叫超时,返回到主界面
+                RingPlayHelper.stopRingTone()
+                showMessage(R.string.no_response)
+                Constant.CALL_STATE = Constant.CALL_STANDBY
+                if (callState == 0) {
+                    //VoiceUtil.cancelAudioCall(Constant.DEVICE_ID)
+                    voiceCancel()
+                } else if (callState == 2) {
+                    if (bedId != -1) {
+                        //VoiceUtil.cancelAudioCallBed(Constant.DEVICE_ID, bedId)
+                        voiceCancelBed()
+                    }
+                }
+                //backToMain()
+                callEnd(false)
+            }
+        }
+    }
+
+    //开始计时
+    protected fun startTimer() {
+        if (countDownTimer != null) {
+            countDownTimer.start()
+        }
+    }
+
+    //取消计时器
+    protected fun cancelTimer() {
+        if (countDownTimer != null) {
+            countDownTimer.cancel()
+        }
+    }
+
+    //返回主界面
+    protected fun backToMain() {
+        EventBus.getDefault().post(MessageEvent("BackCall", Constant.EVENT_REMOVE_CALL_FRAGMENT))
+    }
+
+    protected fun voiceCancel() {
+        if (Constant.DEVICE_ID != null && Constant.interactionId != null) {
+            val callTcp = VoiceUtil.voiceCancel(tid, Constant.DEVICE_ID, Constant.interactionId)
+            TcpClient.getInstance().sendMsg(callTcp.toJson())
+        }
+    }
+
+    protected fun voiceCancelBed() {
+        if (Constant.DEVICE_ID != null && Constant.interactionId != null) {
+            val callTcp = VoiceUtil.voiceCancelBed(tid, Constant.DEVICE_ID, bedId, Constant.interactionId)
+            TcpClient.getInstance().sendMsg(callTcp.toJson())
+        }
+    }
+}

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

@@ -0,0 +1,171 @@
+package com.wdkl.app.ncs.callingdoor.fragment
+
+import android.os.Build
+import android.support.v7.widget.DefaultItemAnimator
+import android.support.v7.widget.GridLayoutManager
+import android.text.TextUtils
+import com.enation.javashop.net.engine.model.NetState
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.adapter.FrameRoomAdapter
+import com.wdkl.app.ncs.callingdoor.databinding.MainViewLayoutBinding
+import com.wdkl.app.ncs.callingdoor.helper.DoorLightHelper
+import com.wdkl.app.ncs.callingdoor.helper.Utils
+import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
+import com.wdkl.app.ncs.callingdoor.settings.SettingConfig
+import com.wdkl.ncs.android.lib.base.BaseFragment
+import com.wdkl.ncs.android.lib.utils.errorLog
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.lib.vo.filter
+import com.wdkl.ncs.android.lib.widget.OnegoGridLayoutManager
+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.FrameBedVO
+import com.wdkl.ncs.android.middleware.model.vo.FrameRoomVO
+import com.wdkl.ncs.android.middleware.tcp.enums.DeviceTypeEnum
+import com.wdkl.ncs.android.middleware.utils.CommonUtils
+import kotlinx.android.synthetic.main.main_view_layout.*
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>(), MainFragmentContract.View {
+    val TAG = "MainFragment"
+
+    private lateinit var gridLayoutManager: OnegoGridLayoutManager
+    private lateinit var roomAdpter : FrameRoomAdapter
+    private var bedList = ArrayList<FrameBedVO>()
+
+    override fun getLayId(): Int {
+        return R.layout.main_view_layout
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        if ("rk3288".equals(Build.MODEL)) {
+            gridLayoutManager = OnegoGridLayoutManager(activity, 1, GridLayoutManager.VERTICAL, false)
+        } else {
+            gridLayoutManager = OnegoGridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false)
+        }
+        roomAdpter = FrameRoomAdapter(activity, bedList)
+        rv_bed_view.layoutManager = gridLayoutManager
+        rv_bed_view.adapter = roomAdpter
+
+        updateInfo()
+    }
+
+    override fun bindEvent() {
+    }
+
+    override fun destory() {
+    }
+
+    override fun showRoomInfo(roomInfo: FrameRoomVO) {
+        if (roomInfo.frameBedList != null) {
+            var count = 0
+            var simulateBed = false
+            bedList.clear()
+            bedList.addAll(roomInfo.frameBedList)
+            roomAdpter.setData(bedList)
+            Utils.setInBedVos(bedList)
+            rv_bed_view.itemAnimator = DefaultItemAnimator()
+            if (bedList.size > 3) {
+                //自动滚动显示
+                rv_bed_view.start()
+            } else {
+                //静止显示
+                rv_bed_view.stop()
+            }
+
+            if (bedList.size > 0) {
+                for (bed in bedList) {
+                    if (!TextUtils.isEmpty(bed.customerName)) {
+                        count++
+                    }
+
+                    //判断是否有模拟分机
+                    if (bed.bedDeviceType == DeviceTypeEnum.SIMULATE_BED_DEVICE.value()) {
+                        simulateBed = true
+                    }
+                }
+            }
+
+            Constant.bedCustomIn = count > 0
+            if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
+                DoorLightHelper.resetDoorLight()
+            }
+
+            if (simulateBed) {
+                EventBus.getDefault().post(MessageEvent("remove_call_bed", Constant.EVENT_REMOVE_CALL_BED))
+            }
+
+            //var bedNames = ""
+            //val bedSize = bedList.size
+            //if (bedSize == 1) {
+            //    bedNames = CommonUtils.subStringAfter(bedList[0].frameBed.fullName, "-")
+            //} else if (bedList.size > 1) {
+            //    bedNames = CommonUtils.subStringAfter(bedList[0].frameBed.fullName, "-") + " - " + CommonUtils.subStringAfter(bedList[bedSize-1].frameBed.fullName, "-")
+            //}
+
+            //EventBus.getDefault().post(MessageEvent(bedNames, Constant.EVENT_UPDATE_BEDS))
+        }
+    }
+
+    override fun onError(message: String, type: Int) {
+        //errorLog("error",message)
+        showMessage(message)
+    }
+
+    override fun onNoNet() {
+        showMessage("none network")
+    }
+
+    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()
+    }
+
+    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.getType()) {
+            Constant.EVENT_UPDATE_CUSTOM -> {
+                updateInfo()
+            }
+        }
+    }
+}

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

@@ -0,0 +1,213 @@
+package com.wdkl.app.ncs.callingdoor.fragment
+
+import android.graphics.BitmapFactory
+import android.os.Build
+import android.util.Log
+import com.enation.javashop.net.engine.model.NetState
+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.databinding.QrCodeLayBinding
+import com.wdkl.app.ncs.callingdoor.helper.AppUpdateHelper
+import com.wdkl.app.ncs.callingdoor.helper.NetHelper
+import com.wdkl.app.ncs.callingdoor.helper.PasswordDialogHelper
+import com.wdkl.app.ncs.callingdoor.helper.ServerConfigDialogHelper
+import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
+import com.wdkl.ncs.android.lib.base.BaseFragment
+import com.wdkl.ncs.android.lib.utils.*
+import com.wdkl.ncs.android.lib.vo.filter
+import com.wdkl.ncs.android.middleware.api.UrlManager
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.logic.contract.callingdoor.QrCodeFragmentContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingdoor.QrCodeFragmentPresenter
+import kotlinx.android.synthetic.main.qr_code_lay.*
+import java.lang.StringBuilder
+
+class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrCodeLayBinding>(), QrCodeFragmentContract.View {
+    val TAG = "QrCodeFragment"
+
+    val QR_CODE_PATH = "http://m.wdklian.com/care/apk/care.user?type=NCS_DEVICE"
+
+    override fun getLayId(): Int {
+        return R.layout.qr_code_lay
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        /*Thread{
+            //val logoBitmap = BitmapFactory.decodeResource(resources, R.mipmap.erlogo)
+            var builder = StringBuilder()
+            builder.append(QR_CODE_PATH)
+            builder.append("&code=")
+            builder.append(Constant.DEVICE_CODE)
+            builder.append("&mac=")
+            builder.append(Constant.DEVICE_REGISTER_ID)
+            builder.append("&model=")
+            builder.append(Constant.DEVICE_MODEL)
+            builder.append("&hard_ver=")
+            builder.append(Constant.DEVICE_HARD_VER)
+            builder.append("&soft_ver=")
+            builder.append(Constant.DEVICE_SOFT_VER)
+            builder.append("&device_type=")
+            builder.append(Constant.DEVICE_TYPE)
+            builder.append("&device_name=")
+            builder.append(Constant.DEVICE_NAME)
+            val code = EcodeHelper().createQRImage(builder.toString(),200, null)
+            activity.runOnUiThread {
+                view_qr_code.setImageBitmap(code)
+                tv_local_mac_id.text = Constant.DEVICE_REGISTER_ID
+            }
+        }.start()*/
+
+        //默认显示门口机二维码
+        rb_qr_code_main.isChecked = true
+        showQRCodeImg(R.id.rb_qr_code_main)
+
+        val macAddr = NetHelper.getInstance().macAddress
+        val ipAddr = NetHelper.getInstance().localIP
+        val buildUrl = UrlManager.build()
+        val serverIp =  buildUrl.buyer.substringAfterLast("//").substringBefore(":")
+
+        tv_device_id.text = "ID: " + Constant.DEVICE_ID
+        tv_local_ip.text = "IP: " + ipAddr
+        tv_server_ip.text = "Server: " + serverIp
+        tv_local_mac.text = "MAC: " + macAddr
+        tv_device_sn.text = "Identifier: " + Constant.DEVICE_SN
+        tv_app_version.text = "Version: V" + BuildConfig.VERSION_NAME + "_" + BuildConfig.VERSION_CODE + "_" + Build.MODEL
+        tv_mcu_version.text = "MCU: " + Constant.MCU_VERSION_NUMBER
+    }
+
+    override fun bindEvent() {
+        group_qr_code.setOnCheckedChangeListener { group, checkedId ->
+            showQRCodeImg(checkedId)
+        }
+
+        tv_btn_update_app.setOnClickListener {
+            (activity as CallingdoorActivity).resetSleepTime()
+            (activity as CallingdoorActivity).checkAppVersion()
+        }
+
+        tv_btn_reboot.setOnClickListener {
+            (activity as CallingdoorActivity).cancelRestart()
+            AppUpdateHelper.reboot(context)
+        }
+
+        tv_btn_server_config.setOnClickListener {
+            (activity as CallingdoorActivity).resetSleepTime()
+            (activity as CallingdoorActivity).cancelRestart()
+            ServerConfigDialogHelper.showPasswordDialog(activity)
+        }
+
+        tv_device_test.setOnClickListener {
+            (activity as CallingdoorActivity).resetSleepTime()
+            PasswordDialogHelper.showPasswordDialog(activity) {
+                (activity as CallingdoorActivity).startTestMode()
+            }
+        }
+    }
+
+    private fun showQRCodeImg(id: Int) {
+        val builder = StringBuilder()
+        if (id == R.id.rb_qr_code_main) {
+            //门口机二维码
+            builder.append(QR_CODE_PATH)
+            builder.append("&code=")
+            builder.append(Constant.DEVICE_CODE)
+            builder.append("&mac=")
+            builder.append(Constant.DEVICE_REGISTER_ID)
+            builder.append("&model=")
+            builder.append(Constant.DEVICE_MODEL)
+            builder.append("&hard_ver=")
+            builder.append(Constant.DEVICE_HARD_VER)
+            builder.append("&soft_ver=")
+            builder.append(Constant.DEVICE_SOFT_VER)
+            builder.append("&device_type=")
+            builder.append(Constant.DEVICE_TYPE)
+            builder.append("&device_name=")
+            builder.append(Constant.DEVICE_NAME)
+
+            tv_local_mac_id.text = Constant.DEVICE_REGISTER_ID
+        } else if (id == R.id.rb_qr_code_h1) {
+            //手柄1二维码
+            builder.append(QR_CODE_PATH)
+            builder.append("&code=")
+            builder.append(Constant.DEVICE_CODE)
+            builder.append("&mac=")
+            builder.append(Constant.DEVICE_REGISTER_ID)
+            builder.append(":H1")
+            builder.append("&model=")
+            builder.append(Constant.DEVICE_MODEL)
+            builder.append("&hard_ver=")
+            builder.append(Constant.DEVICE_HARD_VER)
+            builder.append("&soft_ver=")
+            builder.append(Constant.DEVICE_SOFT_VER)
+            builder.append("&device_type=")
+            builder.append(Constant.DEVICE_TYPE_BED)
+            builder.append("&device_name=")
+            builder.append(Constant.DEVICE_NAME_BED)
+
+            tv_local_mac_id.text = Constant.DEVICE_REGISTER_ID + ":H1"
+        } else if (id == R.id.rb_qr_code_h2) {
+            //手柄2二维码
+            builder.append(QR_CODE_PATH)
+            builder.append("&code=")
+            builder.append(Constant.DEVICE_CODE)
+            builder.append("&mac=")
+            builder.append(Constant.DEVICE_REGISTER_ID)
+            builder.append(":H2")
+            builder.append("&model=")
+            builder.append(Constant.DEVICE_MODEL)
+            builder.append("&hard_ver=")
+            builder.append(Constant.DEVICE_HARD_VER)
+            builder.append("&soft_ver=")
+            builder.append(Constant.DEVICE_SOFT_VER)
+            builder.append("&device_type=")
+            builder.append(Constant.DEVICE_TYPE_BED)
+            builder.append("&device_name=")
+            builder.append(Constant.DEVICE_NAME_BED)
+
+            tv_local_mac_id.text = Constant.DEVICE_REGISTER_ID + ":H2"
+        }
+
+        Thread{
+            val code = EcodeHelper().createQRImage(builder.toString(),200, null)
+            activity.runOnUiThread {
+                if (view_qr_code != null) {
+                    view_qr_code.setImageBitmap(code)
+                }
+                builder.clear()
+            }
+        }.start()
+    }
+
+    override fun destory() {
+    }
+
+    override fun onError(message: String, type: Int) {
+        //errorLog("error",message)
+        showMessage(message)
+    }
+
+    override fun complete(message: String, type: Int) {
+    }
+
+    override fun start() {
+    }
+
+    override fun networkMonitor(state: NetState) {
+        state.filter(onWifi = {
+
+        },onMobile = {
+
+        },offline = {
+
+        })
+    }
+
+    override fun setUrlString(url: String) {
+        //
+    }
+}

+ 620 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/SkyCallFragment.kt

@@ -0,0 +1,620 @@
+package com.wdkl.app.ncs.callingdoor.fragment
+
+import android.os.Build
+import android.os.Handler
+import android.os.Looper
+import android.os.SystemClock
+import android.text.TextUtils
+import android.util.Log
+import android.view.View
+import android.view.ViewGroup
+import com.alibaba.fastjson.JSONObject
+import com.google.gson.Gson
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.activity.CallingdoorActivity
+import com.wdkl.app.ncs.callingdoor.helper.DoorLightHelper
+import com.wdkl.app.ncs.callingdoor.helper.RingPlayHelper
+import com.wdkl.app.ncs.callingdoor.helper.SerialPortHelper
+import com.wdkl.app.ncs.callingdoor.settings.SettingConfig
+import com.wdkl.ncs.android.lib.utils.AppTool
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.common.MessageEvent
+import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
+import com.wdkl.ncs.android.middleware.tcp.TcpClient
+import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
+import com.wdkl.ncs.android.middleware.tcp.dto.TcpCallback
+import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
+import com.wdkl.ncs.android.middleware.tcp.enums.DeviceTypeEnum
+import com.wdkl.ncs.android.middleware.tcp.enums.RoleTypeEnum
+import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction
+import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
+import com.wdkl.ncs.janus.client.CallSessionCallback
+import com.wdkl.ncs.janus.client.JanusClient
+import com.wdkl.ncs.janus.client.VideoRoomCallback
+import com.wdkl.ncs.janus.entity.Room
+import com.wdkl.ncs.janus.rtc.WebRTCEngine
+import com.wdkl.ncs.janus.util.EnumType
+import com.wdkl.ncs.janus.util.JanusConstant
+import kotlinx.android.synthetic.main.sky_voice_call_layout.*
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+import org.webrtc.SurfaceViewRenderer
+import java.math.BigInteger
+
+class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
+    private val TAG = "SkyCallFragment"
+
+    //来电设备id
+    var fromId: Int = -1
+
+    private var interactionVO: InteractionVO? = null
+
+    private var janusClient: JanusClient? = null
+    private var room: Room?=null
+    private var videoRoomCallback: VideoRoomCallback? = null
+
+    private var localSurfaceView: SurfaceViewRenderer? = null
+    private var remoteSurfaceView: SurfaceViewRenderer? = null
+
+    private val handler = Handler(Looper.getMainLooper())
+
+    private var audioCall: Boolean = true
+
+    private var callEnded: Boolean = false
+
+    private var outGoing: Boolean = false
+
+    override fun getLayId(): Int {
+        if ("rk3288".equals(Build.MODEL)) {
+            return R.layout.sky_voice_call_layout_rk3288
+        } else {
+            return R.layout.sky_voice_call_layout
+        }
+    }
+
+    override fun init() {
+        //取消黑屏
+        (activity as CallingdoorActivity).cancelSleep()
+
+        //初始化计时器
+        initCountDownTimer(sky_voice_call_timeout)
+        //tcp参数
+        if (tcpModel != null) {
+            fromId = tcpModel!!.fromId
+            interactionVO = Gson().fromJson(tcpModel!!.data.toString(), InteractionVO::class.java)
+        }
+
+        //初始化 engine
+        if (Constant.CALL_TYPE == Constant.VIDEO_CALL) {
+            audioCall = false
+            WebRTCEngine.getInstance().init(false, this.context)
+        } else {
+            audioCall = true
+            WebRTCEngine.getInstance().init(true, this.context)
+        }
+
+        //初始化 janusClient
+        janusClient = JanusClient(JanusConstant.JANUS_URL, Constant.SIP_ID.toBigInteger())
+
+        when (callState) {
+            0 -> {
+                //发起通话
+                outGoing = true
+                janusClient!!.callState = EnumType.CallState.Outgoing
+                room = Room(Constant.SIP_ID.toBigInteger())
+                //呼叫主机
+                RingPlayHelper.playRingTone(baseActivity, R.raw.ring_back2, true)
+                if (!startOutgoing()) {
+                    AppTool.Time.delay(3000) {
+                        cancelCall()
+                    }
+                }
+            }
+
+            1 -> {
+                //来电
+                showIncomingCall()
+                RingPlayHelper.playRingTone(baseActivity, R.raw.ring_tone, true)
+
+                //如果是模拟分机呼叫则需要主机来创建房间发起通话
+                if (Constant.fromDeviceType == DeviceTypeEnum.SIMULATE_BED_DEVICE.value()) {
+                    outGoing = true
+                    janusClient!!.callState = EnumType.CallState.Outgoing
+                    room = Room(Constant.SIP_ID.toBigInteger())
+                } else {
+                    outGoing = false
+                    janusClient!!.callState = EnumType.CallState.Incoming
+                    room = Room(Constant.TARGET_SIP.toBigInteger())
+                }
+            }
+
+            2 -> {
+                //呼叫分机
+                outGoing = true
+                janusClient!!.callState = EnumType.CallState.Outgoing
+                room = Room(Constant.SIP_ID.toBigInteger())
+
+                RingPlayHelper.playRingTone(baseActivity, R.raw.ring_back2, true)
+                if (!startOutgoing()) {
+                    AppTool.Time.delay(3000) {
+                        cancelCall()
+                    }
+                }
+            }
+        }
+
+        videoRoomCallback = VideoRoomCallback(janusClient, room, Constant.SIP_ID.toBigInteger())
+        videoRoomCallback!!.callSessionCallback = this
+        janusClient!!.setJanusCallback(videoRoomCallback)
+    }
+
+    override fun bindEvent() {
+        //去电取消或通话挂断
+        sky_voice_call_hangup.setOnClickListener {
+            RingPlayHelper.stopRingTone()
+            if (Constant.CALL_STATE == Constant.CALL_CALLING) {
+                //结束sip通话
+                Constant.CALL_STATE = Constant.CALL_STANDBY
+                if (sky_voice_call_timer != null) {
+                    sky_voice_call_timer.stop()
+                }
+                callEnd(true)
+            } else {
+                Constant.CALL_STATE = Constant.CALL_STANDBY
+                if (callState == 0) {
+                    //VoiceUtil.cancelAudioCall(Constant.DEVICE_ID)
+                    voiceCancel()
+                } else if (callState == 2) {
+                    if (bedId != -1) {
+                        //VoiceUtil.cancelAudioCallBed(Constant.DEVICE_ID, bedId)
+                        voiceCancelBed()
+                    }
+                }
+                cancelCall()
+            }
+        }
+
+        //来电拒绝
+        sky_voice_call_ring_reject.setOnClickListener {
+            RingPlayHelper.stopRingTone()
+            Constant.CALL_STATE = Constant.CALL_STANDBY
+            //VoiceUtil.rejectAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
+            voiceReject()
+            callEnd(false)
+        }
+
+        //来电接听
+        sky_voice_call_ring_pickup_audio.setOnClickListener {
+            acceptCall()
+            RingPlayHelper.stopRingTone()
+            Constant.CALL_STATE = Constant.CALL_CALLING
+            //VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
+            voiceAccept()
+            janusClient!!.connect()
+        }
+    }
+
+    override fun destroy() {
+        cancelTimer()
+        Constant.CALL_STATE = Constant.CALL_STANDBY
+        if (sky_voice_call_timer != null) {
+            sky_voice_call_timer.stop()
+        }
+        RingPlayHelper.stopRingTone()
+
+        //如果当前在护理中则不操作门灯,如果不在护理中则重置门灯
+        if (("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) && !Constant.inNursing) {
+            //SerialPortHelper.setDoorLight(1, "111") //白色
+            if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
+                DoorLightHelper.resetDoorLight()
+            }
+        }
+
+        //恢复黑屏
+        (activity as CallingdoorActivity).startCountDownSleep()
+    }
+
+    private fun voiceAccept() {
+        val callTcp = VoiceUtil.voiceAccept(tid, Constant.DEVICE_ID, fromId, interactionVO?.id)
+        val transaction = object : TcpCallback(callTcp.tid) {
+            override fun onSuccess(jsonObject: JSONObject) {
+                //
+            }
+
+            override fun onFailed(jsonObject: JSONObject) {
+                // 这里写发送失败的方法
+                val callbackString = jsonObject.getString(CALLBACK)
+                handler.post {
+                    showMessage("accept fail: $callbackString")
+                }
+            }
+        }
+        TcpClient.getInstance().sendTcp(callTcp, false, transaction)
+    }
+
+    private fun voiceReject() {
+        val callTcp = VoiceUtil.voiceReject(tid, Constant.DEVICE_ID, fromId, interactionVO?.id)
+        TcpClient.getInstance().sendMsg(callTcp.toJson())
+    }
+
+    private fun startOutgoing(): Boolean {
+        var outCallTcp: TcpModel?
+        if (callState == 0) {
+            if (Constant.CALL_TYPE == Constant.VIDEO_CALL) {
+                //VoiceUtil.startVideoCall(Constant.DEVICE_ID)
+                outCallTcp = VoiceUtil.videoCall(Constant.DEVICE_ID, RoleTypeEnum.NURSE.name)
+            } else {
+                //VoiceUtil.startAudioCall(Constant.DEVICE_ID)
+                outCallTcp = VoiceUtil.voiceCall(Constant.DEVICE_ID, RoleTypeEnum.NURSE.name)
+            }
+
+            Constant.CALL_STATE = Constant.CALL_OUTGOING
+            sky_voice_call_outgoing.visibility = View.VISIBLE
+            sky_voice_call_incoming.visibility = View.GONE
+            sky_voice_call_timeout.visibility = View.VISIBLE
+            sky_voice_call_timer.visibility = View.GONE
+            startTimer()
+
+            val transaction: TcpCallback = object : TcpCallback(outCallTcp!!.tid) {
+                override fun onSuccess(jsonObject: JSONObject) {
+                    Constant.CALL_STATE = Constant.CALL_OUTGOING
+                }
+
+                override fun onFailed(jsonObject: JSONObject) {
+                    // 这里写发送失败的方法
+                    val callbackString = jsonObject.getString(CALLBACK)
+                    RingPlayHelper.stopRingTone()
+
+                    handler.post {
+                        cancelCall()
+                        showMessage("outgoing call failed: $callbackString")
+                    }
+                }
+            }
+            TcpClient.getInstance().sendTcp(outCallTcp, false, transaction)
+
+            return true
+        } else if (callState == 2) {
+            if (bedId != -1) {
+                if (Constant.CALL_TYPE == Constant.VIDEO_CALL) {
+                    //VoiceUtil.startVideoCallBed(Constant.DEVICE_ID, bedId)
+                    outCallTcp = VoiceUtil.videoCallBed(Constant.DEVICE_ID, bedId)
+                } else {
+                    //VoiceUtil.startAudioCallBed(Constant.DEVICE_ID, bedId)
+                    outCallTcp = VoiceUtil.voiceCallBed(Constant.DEVICE_ID, bedId)
+                }
+
+                Constant.CALL_STATE = Constant.CALL_OUTGOING
+                sky_voice_call_outgoing.visibility = View.VISIBLE
+                sky_voice_call_incoming.visibility = View.GONE
+                sky_voice_call_timeout.visibility = View.VISIBLE
+                sky_voice_call_timer.visibility = View.GONE
+                startTimer()
+
+                val transaction: TcpCallback = object : TcpCallback(outCallTcp!!.tid) {
+                    override fun onSuccess(jsonObject: JSONObject) {
+                        Constant.CALL_STATE = Constant.CALL_OUTGOING
+                    }
+
+                    override fun onFailed(jsonObject: JSONObject) {
+                        // 这里写发送失败的方法
+                        val callbackString = jsonObject.getString(CALLBACK)
+                        RingPlayHelper.stopRingTone()
+
+                        handler.post {
+                            cancelCall()
+                            showMessage("outgoing call failed: $callbackString")
+                        }
+                    }
+                }
+                TcpClient.getInstance().sendTcp(outCallTcp, false, transaction)
+
+                return true
+            } else {
+                showMessage("bed_id null")
+                Constant.CALL_STATE = Constant.CALL_STANDBY
+                return false
+            }
+        }
+
+        return false
+    }
+
+    //去电界面
+    private fun showOutgoingCall() {
+        sky_voice_call_calling_text.setText(R.string.call_success)
+
+        if (!audioCall) {
+            //显示视频画面
+            fullscreen_video_frame.visibility = View.VISIBLE
+            pip_video_frame.visibility = View.VISIBLE
+        }
+    }
+
+    //来电界面
+    private fun showIncomingCall() {
+        Constant.CALL_STATE = Constant.CALL_INCOMING
+        sky_voice_call_calling_text.setText(R.string.call_incoming)
+        sky_voice_call_outgoing.visibility = View.GONE
+        sky_voice_call_incoming.visibility = View.VISIBLE
+        sky_voice_call_timeout.visibility = View.GONE
+        sky_voice_call_timer.visibility = View.GONE
+        cancelTimer()
+    }
+
+    //开始接听
+    private fun acceptCall() {
+        sky_voice_call_calling_text.setText(R.string.call_connecting)
+        sky_voice_call_outgoing.visibility = View.VISIBLE
+        sky_voice_call_incoming.visibility = View.GONE
+        sky_voice_call_timeout.visibility = View.GONE
+        sky_voice_call_timer.visibility = View.GONE
+        cancelTimer()
+    }
+
+    //呼叫取消
+    private fun cancelCall() {
+        cancelTimer()
+        Constant.CALL_STATE = Constant.CALL_STANDBY
+        if (sky_voice_call_timer != null) {
+            sky_voice_call_timer.stop()
+        }
+        callEnd(false)
+    }
+
+    private fun showCalling(audioOnly: Boolean) {
+        if (callEnded) {
+            return
+        }
+
+        if (audioOnly) {
+            ll_voice_call.visibility = View.VISIBLE
+        } else {
+            //显示视频画面
+            fullscreen_video_frame.visibility = View.VISIBLE
+            pip_video_frame.visibility = View.VISIBLE
+            ll_voice_call.visibility = View.GONE
+        }
+
+        Constant.CALL_STATE = Constant.CALL_CALLING
+        sky_voice_call_calling_text.setText(R.string.call_in_call)
+        sky_voice_call_timeout.visibility = View.GONE
+        cancelTimer()
+        sky_voice_call_timer.visibility = View.VISIBLE
+        sky_voice_call_timer.base = SystemClock.elapsedRealtime()
+        sky_voice_call_timer.start()
+    }
+
+    //通话结束
+    override fun callEnd(handoff: Boolean) {
+        synchronized(this) {
+            RingPlayHelper.stopRingTone()
+            if (callEnded) {
+                return
+            }
+            callEnded = true
+            Constant.CALL_STATE = Constant.CALL_STANDBY
+            if (sky_voice_call_timer != null) {
+                sky_voice_call_timer.stop()
+            }
+
+            Log.e(TAG, "call end !!!!!!!!!!!!!!!!!!")
+
+            if (handoff) {
+                //VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, Constant.interactionId)
+                val callTcp = VoiceUtil.voiceHandoff(tid, Constant.DEVICE_ID, fromId, Constant.interactionId)
+                TcpClient.getInstance().sendMsg(callTcp.toJson())
+            }
+
+            if (janusClient!!.webSocketChannel != null) {
+                janusClient!!.callState = EnumType.CallState.Idle
+
+                if (outGoing){
+                    if (janusClient!!.currentHandleId !=null) {
+                        janusClient!!.destroyRoom(janusClient!!.currentHandleId, null)
+                    }
+                } else {
+                    janusClient!!.leaveRoom()
+                }
+
+                janusClient!!.setJanusCallback(null)
+                janusClient!!.disConnect()
+            }
+
+            backToMain()
+        }
+    }
+
+
+    /********************************************************
+     ********************* 通话回调 ********************
+     * 注意: 如涉及到UI更新的需要在主线程处理,务必注意
+     ********************************************************/
+    override fun didChangeState(var1: EnumType.CallState?) {
+        if (var1 == EnumType.CallState.Connected) {
+            RingPlayHelper.stopRingTone()
+            handler.post {
+                //更新界面显示
+                showCalling(audioCall)
+            }
+        }
+    }
+
+    override fun didDisconnected(userId: String?) {
+        Log.i(TAG, "disconnected user:" + userId + ",call user:" + Constant.TARGET_SIP)
+        if (userId.equals(Constant.TARGET_SIP)) {
+            Log.w(TAG, "didDisconnected: $userId")
+            handler.post {
+                showMessage("$userId disconnected")
+                callEnd(true)
+            }
+        }
+    }
+
+    override fun didCreateLocalVideoTrack() {
+        Log.e(TAG, "didCreateLocalVideoTrack")
+        handler.post {
+            if (!callEnded) {
+                if (localSurfaceView == null) {
+                    val surfaceView = WebRTCEngine.getInstance().startPreview(true)
+                    Log.e(TAG, "didCreateLocalVideoTrack surfaceView: " + surfaceView)
+                    if (surfaceView != null) {
+                        localSurfaceView = surfaceView as SurfaceViewRenderer
+                    } else {
+                        callEnd(true)
+                    }
+                } else {
+                    localSurfaceView!!.setZOrderMediaOverlay(true)
+                }
+
+                if (localSurfaceView!!.parent != null) {
+                    (localSurfaceView!!.parent as ViewGroup).removeView(localSurfaceView)
+                }
+
+                if (outGoing && remoteSurfaceView == null) {
+                    if (fullscreen_video_frame != null) {
+                        if (fullscreen_video_frame.getChildCount() != 0) {
+                            fullscreen_video_frame.removeAllViews()
+                        }
+                        fullscreen_video_frame.addView(localSurfaceView)
+                    }
+                } else {
+                    if (pip_video_frame != null) {
+                        if (pip_video_frame.getChildCount() != 0) {
+                            pip_video_frame.removeAllViews()
+                        }
+                        pip_video_frame.addView(localSurfaceView)
+                    }
+                }
+            }
+        }
+    }
+
+    override fun didError(error: String?) {
+        Log.e(TAG, "didError: $error")
+        handler.post {
+            showMessage(R.string.call_error)
+            callEnd(true)
+        }
+    }
+
+    override fun didHangUp(handlerId: BigInteger) {
+        Log.e("hangup", "socket hangup")
+        handler.post {
+            callEnd(true)
+        }
+    }
+
+    override fun didReceiveRemoteVideoTrack(userId: BigInteger?) {
+        Log.e(TAG, "didReceiveRemoteVideoTrack  userId: $userId")
+        handler.post {
+            if (!callEnded) {
+                //本地画面
+                Log.e(TAG, "didReceiveRemoteVideoTrack, local surfaceView = $localSurfaceView")
+                if (localSurfaceView != null) {
+                    localSurfaceView!!.setZOrderMediaOverlay(true)
+                    if (outGoing) {
+                        if (localSurfaceView!!.parent != null) {
+                            (localSurfaceView!!.parent as ViewGroup).removeView(localSurfaceView)
+                        }
+                        if (pip_video_frame != null) {
+                            pip_video_frame.addView(localSurfaceView)
+                        }
+                    }
+                }
+
+                //远端画面
+                val surfaceView = WebRTCEngine.getInstance().setupRemoteVideo(userId, false)
+                Log.e(TAG, "didReceiveRemoteVideoTrack, remote surfaceView = $surfaceView")
+                if (surfaceView != null && fullscreen_video_frame != null) {
+                    remoteSurfaceView = surfaceView as SurfaceViewRenderer
+                    fullscreen_video_frame.removeAllViews()
+                    if (remoteSurfaceView!!.parent != null) {
+                        (remoteSurfaceView!!.parent as ViewGroup).removeView(remoteSurfaceView)
+                    }
+                    fullscreen_video_frame.addView(remoteSurfaceView)
+                }
+            }
+        }
+    }
+
+
+    override fun didCallEndWithReason(var1: EnumType.CallEndReason?) {
+        handler.post {
+            callEnd(true)
+        }
+    }
+
+    override fun didChangeMode(isAudioOnly: Boolean) {
+
+    }
+
+    override fun didUserLeave(userId: BigInteger?) {
+        Log.w(TAG, "didUserLeave:"+userId)
+        handler.post {
+            callEnd(true)
+        }
+    }
+
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+        when (messageEvent.type) {
+            Constant.EVENT_TCP_MSG -> {
+                if (messageEvent.message is TcpModel) {
+                    val curTcpModel = messageEvent.message as TcpModel
+                    if (curTcpModel.getType() == TcpType.VOICE) {
+                        val curInteractionVO = Gson().fromJson(curTcpModel.data.toString(), InteractionVO::class.java)
+                        if (curTcpModel.getAction() == TcpAction.VoiceAction.ACCEPT) {
+                            //我方呼出,对方接受
+                            RingPlayHelper.stopRingTone()
+                            Constant.interactionId = curInteractionVO.id
+                            fromId = curTcpModel.fromId
+                            acceptCall()
+                        } else if (curTcpModel.getAction() == TcpAction.VoiceAction.REJECT) {
+                            //我方呼出,对方拒绝
+                            showMessage(R.string.call_reject)
+                            RingPlayHelper.stopRingTone()
+                            cancelCall()
+                        } else if (curTcpModel.getAction() == TcpAction.VoiceAction.CALLING) {
+                            //我方呼出,对方通话中
+                            showMessage(R.string.call_busy)
+                            AppTool.Time.delay(2000) {
+                                RingPlayHelper.stopRingTone()
+                                cancelCall()
+                            }
+                        } else if (curTcpModel.getAction() == TcpAction.VoiceAction.SUCCESS) {
+                            //呼叫成功
+                            //本机呼叫的时候tcpmodel为空,只有呼叫成功的时候才能获得对应tcp相关数据
+                            interactionVO = curInteractionVO
+                            fromId = curTcpModel.fromId
+                            tid = curTcpModel.tid
+                            Constant.interactionId = curInteractionVO.id
+                            showOutgoingCall()
+                            janusClient!!.connect()
+                        } else if (curTcpModel.getAction() == TcpAction.VoiceAction.FAILED) {
+                            //我方呼出,对方不在线,设备离线或其它错误
+                            showMessage(R.string.call_failed)
+                            AppTool.Time.delay(2000) {
+                                RingPlayHelper.stopRingTone()
+                                cancelCall()
+                            }
+                        } else if (curTcpModel.getAction() == TcpAction.VoiceAction.HANDOFF) {
+                            //对方挂断,不论我方呼出或呼入
+                            if (Constant.interactionId == curInteractionVO.id) {
+                                RingPlayHelper.stopRingTone()
+                                cancelCall()
+                            }
+                        } else if (curTcpModel.getAction() == TcpAction.VoiceAction.CANCEL) {
+                            //对方呼叫时取消
+                            RingPlayHelper.stopRingTone()
+                            cancelCall()
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+}

+ 227 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/fragment/TestFragment.kt

@@ -0,0 +1,227 @@
+package com.wdkl.app.ncs.callingdoor.fragment
+
+import android.hardware.Camera
+import android.text.TextUtils
+import android.view.SurfaceHolder
+import android.view.View
+import com.enation.javashop.net.engine.model.NetState
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.databinding.TestFragmentLayBinding
+import com.wdkl.app.ncs.callingdoor.helper.MediaPlayHelper
+import com.wdkl.app.ncs.callingdoor.helper.RecordHelper
+import com.wdkl.app.ncs.callingdoor.helper.SerialPortHelper
+import com.wdkl.app.ncs.callingdoor.helper.SoundPoolManager
+import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
+import com.wdkl.ncs.android.lib.base.BaseFragment
+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.callingdoor.QrCodeFragmentContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingdoor.QrCodeFragmentPresenter
+import kotlinx.android.synthetic.main.test_fragment_lay.*
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+class TestFragment : BaseFragment<QrCodeFragmentPresenter, TestFragmentLayBinding>(), QrCodeFragmentContract.View {
+    val TAG = "TestFragment"
+
+    var info = ""
+    var buttonTest = false
+    var testButton1 = false
+    var testButton2 = false
+
+    private var mCamera: Camera? = null
+
+    override fun getLayId(): Int {
+        return R.layout.test_fragment_lay
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        RecordHelper.getInstance().init()
+        //SoundPoolManager.getInstance().playSound(4, 1.0f, 1.0f, 0)
+
+        startCameraPreview()
+    }
+
+    override fun bindEvent() {
+        btn_test.setOnClickListener {
+            if ("start".equals(btn_test.text.toString(), true)) {
+                btn_test.isEnabled = false
+                //开始测试
+                startTest()
+            } else {
+                EventBus.getDefault().post(MessageEvent("exit", Constant.EVENT_EXIT_TEST))
+            }
+        }
+
+        tv_rgb_test.setOnClickListener {
+            val rgb = edit_rgb.text.toString()
+            if (!TextUtils.isEmpty(rgb) && TextUtils.isDigitsOnly(rgb)) {
+                SerialPortHelper.setDoorLight(1, rgb)
+            } else {
+                showMessage("非法值...")
+            }
+        }
+    }
+
+    private fun startTest() {
+        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)
+
+            activity.runOnUiThread {
+                if (btn_test != null) {
+                    btn_test.text = "back"
+                    btn_test.isEnabled = true
+                }
+            }
+        }.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) {
+            try {
+                mCamera = Camera.open()
+            } catch (e: Exception) {
+                tv_camera.visibility = View.VISIBLE
+                tv_camera.text = "摄像头打开失败"
+                e.printStackTrace()
+                return
+            }
+
+            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 {
+            tv_camera.visibility = View.VISIBLE
+            tv_camera.text = "没有摄像头"
+        }
+    }
+
+    override fun onStart() {
+        EventBus.getDefault().register(this)
+        super.onStart()
+    }
+
+    override fun onStop() {
+        EventBus.getDefault().unregister(this)
+        super.onStop()
+    }
+
+    override fun destory() {
+        if (mCamera != null) {
+            mCamera!!.stopPreview()
+            mCamera!!.release()
+            mCamera = null
+        }
+    }
+
+    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 = {
+
+        })
+    }
+
+    override fun setUrlString(url: String) {
+        //
+    }
+
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+        if (Constant.EVENT_SERIAL_TEST == messageEvent.type) {
+            if (!buttonTest) {
+                val message = messageEvent.message as String
+                if (message == "call" && !testButton1) {
+                    info += " ##面板按键## "
+                    testButton1 = true
+                } else if (message == "hookoff" && !testButton2) {
+                    info += " ##插簧按键按键## "
+                    testButton2 = true
+                }
+
+                showInfo(info)
+                //startTest()
+
+                if (testButton1 && testButton2) {
+                    buttonTest = true
+                }
+            }
+        }
+    }
+}

+ 228 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/AnrFcExceptionUtil.java.bak

@@ -0,0 +1,228 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.AlarmManager;
+import android.app.Application;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Build;
+import android.os.Environment;
+import android.util.Log;
+
+import com.github.anrwatchdog.ANRError;
+import com.github.anrwatchdog.ANRWatchDog;
+import com.wdkl.ncs.android.component.welcome.activity.WelcomeActivity;
+import com.wdkl.ncs.android.middleware.tcp.channel.DeviceChannel;
+import com.wdkl.skywebrtc.CallSession;
+import com.wdkl.skywebrtc.EnumType;
+import com.wdkl.skywebrtc.SkyEngineKit;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TimeZone;
+
+/**
+ * Created by dengzhe on 2018/4/2.
+ * //=========================FC&ANR异常处理类=========================//
+ */
+
+public class AnrFcExceptionUtil implements Thread.UncaughtExceptionHandler {
+
+    private static ANRWatchDog mANRWatchDog;
+    private Thread.UncaughtExceptionHandler mDefaultHandler;
+    public static final String TAG = "MyApplication";
+    private static Application application;
+
+    private static AnrFcExceptionUtil mAnrFcExceptionUtil;
+
+    /**
+     * 存储异常和参数信息
+     */
+    private Map<String, String> paramsMap = new HashMap<>();
+    /**
+     * 格式化时间
+     */
+    private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
+
+
+    public static AnrFcExceptionUtil getInstance(Application application) {
+        if (mAnrFcExceptionUtil == null) {
+            mAnrFcExceptionUtil = new AnrFcExceptionUtil(application);
+        }
+        return mAnrFcExceptionUtil;
+    }
+
+    private AnrFcExceptionUtil(Application application) {
+        //获取系统默认的UncaughtException处理器
+        mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
+        this.application = application;
+    }
+
+    @Override
+    public void uncaughtException(Thread thread, Throwable ex) {
+        if (!handleException(ex) && mDefaultHandler != null) {
+            //如果用户没有处理则让系统默认的异常处理器来处理
+            mDefaultHandler.uncaughtException(thread, ex);
+        } else {
+            try {
+                Thread.sleep(2000);
+            } catch (InterruptedException e) {
+                Log.e(TAG, "error : ", e);
+            }
+
+            restartApp();
+            //android.os.Process.killProcess(android.os.Process.myPid());
+            //System.exit(0);
+        }
+    }
+
+    /**
+     * 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成.
+     *
+     * @param ex
+     * @return true:如果处理了该异常信息;否则返回false.
+     */
+    private boolean handleException(Throwable ex) {
+        if (ex == null) {
+            return false;
+        }
+        //使用Toast来显示异常信息
+        /*new Thread() {
+            @Override
+            public void run() {
+                Looper.prepare();
+//                Toast.makeText(application.getApplicationContext(), "很抱歉,程序出现异常,即将重新启动.",
+//                        Toast.LENGTH_SHORT).show();
+                Looper.loop();
+            }
+        }.start();*/
+        saveCrashInfo2File(ex);
+        return true;
+    }
+
+    /**
+     * 保存错误信息到文件中
+     *
+     * @param ex
+     * @return 返回文件名称
+     */
+    private String saveCrashInfo2File(Throwable ex) {
+        StringBuffer sb = new StringBuffer();
+        for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
+            String key = entry.getKey();
+            String value = entry.getValue();
+            sb.append(key + "=" + value + "\n");
+        }
+
+        Writer writer = new StringWriter();
+        PrintWriter printWriter = new PrintWriter(writer);
+        ex.printStackTrace(printWriter);
+        Throwable cause = ex.getCause();
+        while (cause != null) {
+            cause.printStackTrace(printWriter);
+            cause = cause.getCause();
+        }
+        printWriter.close();
+        String result = writer.toString();
+        sb.append(result);
+
+        try {
+            long timestamp = System.currentTimeMillis();
+            format.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+            String time = format.format(new Date());
+            String fileName = "crash-" + time + "-" + timestamp + ".txt";
+            if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+                String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/crash/";
+                File dir = new File(path);
+                if (!dir.exists()) {
+                    dir.mkdirs();
+                }
+                FileOutputStream fos = new FileOutputStream(path + fileName);
+                fos.write(sb.toString().getBytes());
+                Log.i(TAG, "saveCrashInfo2File: "+sb.toString());
+                fos.close();
+            }
+            return fileName;
+        } catch (Exception e) {
+            Log.e(TAG, "an error occured while writing file...", e);
+        }
+        return null;
+    }
+
+    private void restartApp() {
+        CallSession session= SkyEngineKit.Instance().getCurrentSession();
+        if(session!=null&&session.getState()!= EnumType.CallState.Idle){
+            SkyEngineKit.Instance().endCall();
+        }
+
+        //重新启动app
+        Intent mStartActivity = new Intent(application.getApplicationContext(), WelcomeActivity.class);
+        mStartActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        int mPendingIntentId = 123456;
+        PendingIntent mPendingIntent = PendingIntent.getActivity(application.getApplicationContext(), mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
+        AlarmManager mgr = (AlarmManager) application.getApplicationContext().getSystemService(Context.ALARM_SERVICE);
+        mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 1500, mPendingIntent);
+
+        android.os.Process.killProcess(android.os.Process.myPid());
+        System.exit(0);
+    }
+
+    /**
+     * ===================================================崩溃异常处理===================================================
+     */
+    public void initFCException() {
+        //设置该CrashHandler为程序的默认处理器
+        AnrFcExceptionUtil catchExcep = AnrFcExceptionUtil.getInstance(application);
+        Thread.setDefaultUncaughtExceptionHandler(catchExcep);
+        mANRWatchDog = new ANRWatchDog(8000);
+        mANRWatchDog.setInterruptionListener(new ANRWatchDog.InterruptionListener() {
+            @Override
+            public void onInterrupted(InterruptedException exception) {
+            }
+        }).setIgnoreDebugger(true).setANRListener(new ANRWatchDog.ANRListener() {
+            @Override
+            public void onAppNotResponding(ANRError error) {
+                /*Intent mStartActivity = new Intent(application.getApplicationContext(), Constants.ANR_FC);
+                int mPendingIntentId = 123456;
+                PendingIntent mPendingIntent = PendingIntent.getActivity(application.getApplicationContext(), mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
+                AlarmManager mgr = (AlarmManager) application.getApplicationContext().getSystemService(Context.ALARM_SERVICE);
+                mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 1500, mPendingIntent);
+                android.os.Process.killProcess(android.os.Process.myPid());*/
+
+                //记录anr发生时间
+                /*try {
+                    long timestamp = System.currentTimeMillis();
+                    String time = format.format(new Date());
+                    format.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+                    String fileName = "anr-" + time + "-" + timestamp + ".txt";
+                    if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+                        String path = Environment.getExternalStorageDirectory() + "/anr/";
+                        File dir = new File(path);
+                        if (!dir.exists()) {
+                            dir.mkdirs();
+                        }
+                        FileOutputStream fos = new FileOutputStream(path + fileName);
+                        fos.write(fileName.getBytes());
+                        fos.close();
+                    }
+                } catch (Exception e) {
+                }*/
+
+                Log.d("anr", "Anr restart app...");
+                if ("rk3128".equals(Build.MODEL)) {
+                    AppUpdateHelper.reboot(application);
+                } else {
+                    restartApp();
+                }
+            }
+        }).start();
+
+    }
+}

+ 47 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/AppInfoDialogHelper.java

@@ -0,0 +1,47 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+
+import com.wdkl.app.ncs.callingdoor.BuildConfig;
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.ncs.android.middleware.common.Constant;
+
+public class AppInfoDialogHelper {
+
+    private static AlertDialog appDialog;
+
+    public static void showAppDialog(Activity activity, DialogInterface.OnClickListener rebootListener,
+                                     DialogInterface.OnClickListener appCheckListener, DialogInterface.OnClickListener debugListener) {
+        if (appDialog != null && appDialog.isShowing()) {
+            appDialog.dismiss();
+        }
+
+        StringBuilder stringBuilder = new StringBuilder();
+        String macAddr = NetHelper.getInstance().getMacAddress();
+        String ipAddr = NetHelper.getInstance().getLocalIP();
+        stringBuilder.append("ID: ");
+        stringBuilder.append(Constant.DEVICE_ID);
+        stringBuilder.append("\nIP: ");
+        stringBuilder.append(ipAddr);
+        stringBuilder.append("\nMAC: ");
+        stringBuilder.append(macAddr);
+        stringBuilder.append("\nIdentifier: ");
+        stringBuilder.append(Constant.DEVICE_SN);
+        stringBuilder.append("\nVersion: V");
+        stringBuilder.append(BuildConfig.VERSION_NAME);
+        stringBuilder.append("\nMCU: ");
+        stringBuilder.append(Constant.MCU_VERSION_NUMBER);
+
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setTitle(R.string.version_title);
+        builder.setPositiveButton(R.string.str_reset, rebootListener);
+        builder.setNegativeButton(R.string.str_check_update, appCheckListener);
+        builder.setNeutralButton(R.string.str_debug, debugListener);
+        builder.setMessage(stringBuilder.toString());
+
+        appDialog = builder.create();
+        appDialog.show();
+    }
+}

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

@@ -0,0 +1,243 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import android.support.v4.content.FileProvider;
+import android.util.Log;
+
+import com.wdkl.ncs.android.component.welcome.activity.WelcomeActivity;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+public class AppUpdateHelper {
+    private final static String TAG = "AppUpdate";
+
+    /**
+     * 下载的APK文件绝对路径
+     */
+    public static final String FILE_APK_PATH = Environment.getExternalStorageDirectory() + "/CallingDoor";
+    /**
+     * 下载的APK文件的文件名
+     */
+    public static final String FILE_APK_NAME = "CallingDoorAPK.apk";
+
+    public static void installAPK(Context context) {
+        try {
+            File apkFile = new File(FILE_APK_PATH + "/" + FILE_APK_NAME);
+            if (!apkFile.exists()) {
+                return;
+            }
+
+            Intent intent = new Intent(Intent.ACTION_VIEW);
+            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//安装完成后打开新版本
+            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); // 给目标应用一个临时授权
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {//判断版本大于等于7.0
+                //如果SDK版本>=24,即:Build.VERSION.SDK_INT >= 24,使用FileProvider兼容安装apk
+                String packageName = context.getApplicationContext().getPackageName();
+                String authority = new StringBuilder(packageName).append(".fileprovider").toString();
+                Uri apkUri = FileProvider.getUriForFile(context, authority, apkFile);
+                intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
+            } else {
+                intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
+            }
+            context.startActivity(intent);
+        } catch (Exception e) {
+        }
+    }
+
+    public static void updateApp(Context context, UpdateCallBack callBack) {
+        if (checkApkExit(context)) {
+            Log.d(TAG, "文件存在");
+        } else {
+            Log.d(TAG, "文件不存在");
+            if (callBack != null) {
+                callBack.onFailed();
+            }
+            return;
+        }
+
+        /*if (!checkApkAvailable(context, DownloadUtil.FILE_APK_PATH + "/" + DownloadUtil.FILE_APK_NAME)) {
+            ToastUtil.showToast("apk文件不匹配,升级失败!");
+            return;
+        }*/
+
+        String path = FILE_APK_PATH + "/" + FILE_APK_NAME;
+        //if (installApp(context.getPackageName(), path)) {
+        if (rootSilenceInstall(path)) {
+            Log.d(TAG, "安装成功");
+            if (callBack != null) {
+                callBack.onSuccess();
+            }
+        } else {
+            Log.d(TAG, "安装失败");
+            if (callBack != null) {
+                callBack.onFailed();
+            }
+        }
+
+        /*if (silentInstall(context, path)) {
+            Log.d(TAG, "app 安装成功");
+            if (callBack != null) {
+                callBack.onSuccess();
+            }
+        }*/
+    }
+
+    private static boolean checkApkExit(Context context) {
+        File file = new File(FILE_APK_PATH + "/" + FILE_APK_NAME);
+        return file.exists();
+    }
+
+    private static boolean checkApkAvailable(Context context, String path) {
+        try {
+            PackageManager pm = context.getPackageManager();
+            PackageInfo info = pm.getPackageArchiveInfo(path, 0);
+            ApplicationInfo applicationInfo = info.applicationInfo;
+            String newPkg = applicationInfo.packageName;
+            String curPkg = context.getPackageName();
+            Log.d(TAG, "new package: " + newPkg + ", cur package: " + curPkg);
+            if (curPkg.equals(newPkg)) {
+                return true;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return false;
+    }
+
+    public static boolean silentInstall(Context context, String apkPath) {
+        PackageManager packageManager = context.getPackageManager();
+        Class pmClz = packageManager.getClass();
+        try {
+            if (Build.VERSION.SDK_INT >= 21) {
+                Log.d(TAG, "apk path: " + apkPath);
+                Class aClass = Class.forName("android.app.PackageInstallObserver");
+                Constructor constructor = aClass.getDeclaredConstructor();
+                constructor.setAccessible(true);
+                Object installObserver = constructor.newInstance();
+                Method method = pmClz.getDeclaredMethod("installPackage", Uri.class, aClass, int.class, String.class);
+                method.setAccessible(true);
+                method.invoke(packageManager, Uri.fromFile(new File(apkPath)), installObserver, 2, null);
+            } else {
+                Method method = pmClz.getDeclaredMethod("installPackage", Uri.class, Class.forName("android.content.pm.IPackageInstallObserver"), int.class, String.class);
+                method.setAccessible(true);
+                method.invoke(packageManager, Uri.fromFile(new File(apkPath)), null, 2, null);
+            }
+            return true;
+        } catch (Exception e) {
+            Log.e(TAG, e.toString());
+        }
+        return false;
+    }
+
+    public static boolean installApp(String packageName, String apkPath) {
+        Process process = null;
+        BufferedReader successResult = null;
+        BufferedReader errorResult = null;
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder errorMsg = new StringBuilder();
+        Log.e(TAG, "install package: " + packageName + ", apkPath: " + apkPath);
+        try {
+            process = new ProcessBuilder("pm", "install", "-i", packageName, "-r", apkPath).start();
+            successResult = new BufferedReader(new InputStreamReader(process.getInputStream()));
+            errorResult = new BufferedReader(new InputStreamReader(process.getErrorStream()));
+            String s;
+            while ((s = successResult.readLine()) != null) {
+                successMsg.append(s);
+            }
+            while ((s = errorResult.readLine()) != null) {
+                errorMsg.append(s);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (successResult != null) {
+                    successResult.close();
+                }
+                if (errorResult != null) {
+                    errorResult.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            if (process != null) {
+                process.destroy();
+            }
+        }
+        Log.e(TAG, "" + errorMsg.toString());
+        //如果含有“success”认为安装成功
+        return successMsg.toString().equalsIgnoreCase("success");
+    }
+
+    public static boolean rootSilenceInstall(String path) {
+        Process process;
+        PrintWriter printWriter;
+        try {
+            process = Runtime.getRuntime().exec("su");
+            printWriter = new PrintWriter(process.getOutputStream());
+            printWriter.println("pm install -r " + path);
+            printWriter.flush();
+            printWriter.close();
+            int res = process.waitFor();
+            Log.e(TAG, "silent install res: " + res);
+            if (res == 0) {
+                return true;
+            } else {
+                return false;
+            }
+        } catch (Exception e) {
+            Log.e(TAG, "rootSilenceInstall e:" + e.getMessage());
+            return false;
+        }
+    }
+
+    public static void reboot(Context context) {
+        try {
+            Intent intent = new Intent(Intent.ACTION_REBOOT);
+            intent.putExtra("nowait", 1);
+            intent.putExtra("interval", 1);
+            intent.putExtra("window", 0);
+            context.sendBroadcast(intent);
+
+            if ("rk3128".equals(Build.MODEL)) {
+                SerialPortHelper.resetDevice();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    public static void restartApp(Context context) {
+        //重新启动app
+        Intent mStartActivity = new Intent(context.getApplicationContext(), WelcomeActivity.class);
+        mStartActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        int mPendingIntentId = 123456;
+        PendingIntent mPendingIntent = PendingIntent.getActivity(context.getApplicationContext(), mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
+        AlarmManager mgr = (AlarmManager) context.getApplicationContext().getSystemService(Context.ALARM_SERVICE);
+        mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 1500, mPendingIntent);
+
+        android.os.Process.killProcess(android.os.Process.myPid());
+        System.exit(0);
+    }
+
+    public interface UpdateCallBack {
+        void onFailed();
+        void onSuccess();
+    }
+}

+ 189 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/AsyncPlayer.java

@@ -0,0 +1,189 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.content.Context;
+import android.media.AudioDeviceInfo;
+import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.net.Uri;
+import android.os.PowerManager;
+import android.os.SystemClock;
+import android.util.Log;
+
+import java.io.IOException;
+import java.util.LinkedList;
+
+/**
+ * 响铃相关类
+ */
+public class AsyncPlayer {
+    private static final int PLAY = 1;
+    private static final int STOP = 2;
+    private AudioManager audioManager;
+
+    private static final class Command {
+        int code;
+        Context context;
+        int resId;
+        boolean looping;
+        int stream;
+        long requestTime;
+
+        public String toString() {
+            return "{ code=" + code + " looping=" + looping + " stream=" + stream + " resId=" + resId + " }";
+        }
+    }
+
+    private final LinkedList mCmdQueue = new LinkedList();
+
+    private void startSound(Command cmd) {
+
+        try {
+            //MediaPlayer player = new MediaPlayer();
+            MediaPlayer player = MediaPlayer.create(cmd.context, cmd.resId);
+            player.setAudioStreamType(cmd.stream);
+            //player.setDataSource(cmd.context, cmd.uri);
+            player.setLooping(cmd.looping);
+            player.setVolume(1.0f, 1.0f);
+            //player.prepare();
+            player.start();
+            if (mPlayer != null) {
+                mPlayer.release();
+            }
+            mPlayer = player;
+            Log.w(mTag, "start sound " + cmd.resId);
+        } catch (Exception e) {
+            Log.w(mTag, "error loading sound for " + cmd.resId, e);
+        }
+    }
+
+    private final class Thread extends java.lang.Thread {
+        Thread() {
+            super("AsyncPlayer-" + mTag);
+        }
+
+        public void run() {
+            while (true) {
+                Command cmd = null;
+
+                synchronized (mCmdQueue) {
+
+                    cmd = (Command) mCmdQueue.removeFirst();
+                }
+
+                switch (cmd.code) {
+                    case PLAY:
+                        startSound(cmd);
+                        break;
+                    case STOP:
+
+                        if (mPlayer != null) {
+                            mPlayer.stop();
+                            mPlayer.reset();
+                            mPlayer.release();
+                            mPlayer = null;
+                        } else {
+                            Log.w(mTag, "STOP command without a player");
+                        }
+                        break;
+                }
+
+                synchronized (mCmdQueue) {
+                    if (mCmdQueue.size() == 0) {
+
+                        mThread = null;
+                        releaseWakeLock();
+                        return;
+                    }
+                }
+            }
+        }
+    }
+
+    private String mTag;
+    private Thread mThread;
+    private MediaPlayer mPlayer;
+    private PowerManager.WakeLock mWakeLock;
+
+    private int mState = STOP;
+
+    public AsyncPlayer(String tag) {
+        if (tag != null) {
+            mTag = tag;
+        } else {
+            mTag = "AsyncPlayer";
+        }
+    }
+
+    public void play(Context context, int res, boolean looping, int stream) {
+        Command cmd = new Command();
+        cmd.requestTime = SystemClock.uptimeMillis();
+        cmd.code = PLAY;
+        cmd.context = context;
+        cmd.resId = res;
+        cmd.looping = looping;
+        cmd.stream = stream;
+        synchronized (mCmdQueue) {
+            enqueueLocked(cmd);
+            mState = PLAY;
+        }
+    }
+
+    public void stop() {
+        synchronized (mCmdQueue) {
+            if (mState != STOP) {
+                Command cmd = new Command();
+                cmd.requestTime = SystemClock.uptimeMillis();
+                cmd.code = STOP;
+                enqueueLocked(cmd);
+                mState = STOP;
+            }
+        }
+    }
+
+    private void enqueueLocked(Command cmd) {
+        mCmdQueue.add(cmd);
+        if (mThread == null) {
+            acquireWakeLock();
+            mThread = new Thread();
+            mThread.start();
+        }
+    }
+
+    public void setUsesWakeLock(Context context) {
+        if (mWakeLock != null || mThread != null) {
+            throw new RuntimeException("assertion failed mWakeLock=" + mWakeLock + " mThread=" + mThread);
+        }
+        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
+        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, mTag);
+    }
+
+    private void acquireWakeLock() {
+        if (mWakeLock != null) {
+            mWakeLock.acquire();
+        }
+    }
+
+    private void releaseWakeLock() {
+        if (mWakeLock != null) {
+            mWakeLock.release();
+        }
+    }
+
+    private boolean isHeadphonesPlugged(Context context) {
+        if (audioManager == null) {
+            audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        }
+        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
+            AudioDeviceInfo[] audioDevices = audioManager.getDevices(AudioManager.GET_DEVICES_ALL);
+            for (AudioDeviceInfo deviceInfo : audioDevices) {
+                if (deviceInfo.getType() == AudioDeviceInfo.TYPE_WIRED_HEADPHONES
+                        || deviceInfo.getType() == AudioDeviceInfo.TYPE_WIRED_HEADSET) {
+                    return true;
+                }
+            }
+            return false;
+        } else {
+            return audioManager.isWiredHeadsetOn();
+        }
+    }
+}

+ 83 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/CallDialogHelper.java

@@ -0,0 +1,83 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.media.AudioManager;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+
+import com.wdkl.app.ncs.callingdoor.R;
+
+public class CallDialogHelper {
+
+    private static AlertDialog callDialog;
+
+    private static AsyncPlayer ringPlayer;
+
+    public static void showCallDialog(Activity activity, int callType, View.OnClickListener hangupCall, View.OnClickListener acceptCall, View.OnClickListener rejectCall) {
+        if (ringPlayer == null) {
+            ringPlayer = new AsyncPlayer(null);
+        }
+
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.call_dialog_lay, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+
+        LinearLayout outCall = contentView.findViewById(R.id.ll_call_outgoing);
+        ImageView hangup = contentView.findViewById(R.id.iv_hangup_call);
+
+        RelativeLayout inCall = contentView.findViewById(R.id.rl_call_incoming);
+        ImageView accept = contentView.findViewById(R.id.iv_accept_call);
+        ImageView reject = contentView.findViewById(R.id.iv_reject_call);
+
+        if (callType == 0) {
+            //去电
+            outCall.setVisibility(View.VISIBLE);
+            inCall.setVisibility(View.GONE);
+            ringPlayer.play(activity, R.raw.ring_back2, true, AudioManager.STREAM_MUSIC);
+        } else {
+            //来电
+            outCall.setVisibility(View.GONE);
+            inCall.setVisibility(View.VISIBLE);
+            ringPlayer.play(activity, R.raw.ring_tone, true, AudioManager.STREAM_MUSIC);
+        }
+
+        hangup.setOnClickListener(hangupCall);
+        accept.setOnClickListener(acceptCall);
+        reject.setOnClickListener(rejectCall);
+
+        callDialog = builder.create();
+        callDialog.setCanceledOnTouchOutside(false);
+        callDialog.setCancelable(false);
+        callDialog.show();
+
+        //设置dialog宽高及位置
+        try {
+            Window window = callDialog.getWindow();
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.width = 800;
+            lp.height = 400;
+            lp.gravity = Gravity.CENTER;
+            //lp.alpha = 0.4f;
+            //window.setBackgroundDrawableResource(R.color.transparent_dialog);
+            window.setAttributes(lp);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void dismissCallDialog() {
+        if (callDialog != null && callDialog.isShowing()) {
+            callDialog.dismiss();
+        }
+        if (ringPlayer != null) {
+            ringPlayer.stop();
+        }
+    }
+}

+ 85 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/CallbedDialogHelper.java

@@ -0,0 +1,85 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.support.v7.widget.RecyclerView;
+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 com.alibaba.android.vlayout.VirtualLayoutManager;
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.app.ncs.callingdoor.adapter.BedItemAdapter;
+import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO;
+
+public class CallbedDialogHelper {
+
+    private static AlertDialog alertDialog;
+
+    public static void showDialog(Activity activity, ClickListener clickListener) {
+
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.call_bed_dialog_lay, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+
+        Button btn_cancel = contentView.findViewById(R.id.button_cancel);
+        btn_cancel.setOnClickListener(v -> {
+            if (alertDialog != null && alertDialog.isShowing()) {
+                alertDialog.dismiss();
+            }
+        });
+
+        RecyclerView recyclerView = contentView.findViewById(R.id.recycler_bed_list);
+        BedItemAdapter adapter = new BedItemAdapter(activity, Utils.getInBedVOS());
+        recyclerView.setAdapter(adapter);
+        recyclerView.setLayoutManager(new VirtualLayoutManager(activity));
+        adapter.setCallClickListener(new BedItemAdapter.BedClickListener() {
+            @Override
+            public void onVideoClick(FrameBedVO bedVO) {
+                if (clickListener != null) {
+                    clickListener.onVideoClick(bedVO);
+                }
+                if (alertDialog != null) {
+                    alertDialog.dismiss();
+                }
+            }
+
+            @Override
+            public void onVoiceClick(FrameBedVO bedVO) {
+                if (clickListener != null) {
+                    clickListener.onVoiceClick(bedVO);
+                }
+                if (alertDialog != null) {
+                    alertDialog.dismiss();
+                }
+            }
+        });
+
+
+        alertDialog = builder.create();
+        alertDialog.setCanceledOnTouchOutside(false);
+        alertDialog.setCancelable(false);
+        alertDialog.show();
+
+        //设置dialog宽高及位置
+        try {
+            Window window = alertDialog.getWindow();
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.width = 680;
+            lp.height = 440;
+            lp.gravity = Gravity.CENTER;
+            window.setAttributes(lp);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    public interface ClickListener{
+        void onVoiceClick(FrameBedVO bedVO);
+        void onVideoClick(FrameBedVO bedVO);
+    }
+}

+ 50 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/DoorLightHelper.java

@@ -0,0 +1,50 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import com.wdkl.app.ncs.callingdoor.settings.SettingConfig;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+import com.wdkl.ncs.android.middleware.common.Constant;
+import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel;
+import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction;
+
+public class DoorLightHelper {
+
+    public static void handleDoorLight(TcpModel tcpModel) {
+        if (TcpAction.SideAction.CALL == tcpModel.getAction()
+            || TcpAction.SideAction.SOS_CALL == tcpModel.getAction()) {
+            //门灯红色闪烁
+            SerialPortHelper.setDoorLight(1, "200"); //红色闪烁
+
+            if (TcpAction.SideAction.SOS_CALL == tcpModel.getAction()) {
+                Constant.sosOn = true;
+            }
+        } else if (TcpAction.SideAction.ACCEPT == tcpModel.getAction()
+            || TcpAction.SideAction.CANCEL == tcpModel.getAction()
+            || TcpAction.SideAction.SOS_CANCEL == tcpModel.getAction()) {
+            //如果当前在护理中则不操作门灯,如果不在护理中则重置门灯
+            if (Constant.inNursing) {
+                SerialPortHelper.setDoorLight(1, Constant.nursingColor); //绿色
+            } else {
+                //SerialPortHelper.setDoorLight(1, "111"); //白色
+                resetDoorLight();
+            }
+
+            if (TcpAction.SideAction.SOS_CANCEL == tcpModel.getAction()) {
+                Constant.sosOn = false;
+            }
+        }
+    }
+
+    public static void resetDoorLight() {
+        //有人入住时点亮门灯,无人入住关闭门灯
+        Constant.inNursing = SettingConfig.getInNursing(BaseApplication.appContext);
+        if (Constant.inNursing) {
+            SerialPortHelper.setDoorLight(1, Constant.nursingColor); //绿色
+        } else {
+            if (Constant.bedCustomIn) {
+                SerialPortHelper.setDoorLight(1, "111"); //白色
+            } else {
+                SerialPortHelper.setDoorLight(0, "000"); //关闭
+            }
+        }
+    }
+}

+ 188 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/HttpHelper.java

@@ -0,0 +1,188 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.util.Log;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+import static com.wdkl.app.ncs.callingdoor.helper.AppUpdateHelper.FILE_APK_NAME;
+import static com.wdkl.app.ncs.callingdoor.helper.AppUpdateHelper.FILE_APK_PATH;
+
+public class HttpHelper {
+    private static OkHttpClient okHttpClient = null;
+
+    /**
+     * @param url   服务器地址
+     * @param file  所要上传的文件
+     */
+    public static void upload(String url, File file, Object tag, UploadCallback callback) {
+        if (okHttpClient == null) {
+            okHttpClient = new OkHttpClient();
+        }
+
+        RequestBody requestBody = new MultipartBody.Builder()
+                .setType(MultipartBody.FORM)
+                .addFormDataPart("file", file.getName(), RequestBody.create(MediaType.parse("multipart/form-data"), file))
+                .build();
+        Request request = new Request.Builder()
+                .url(url)
+                .tag(tag)
+                .post(requestBody)
+                .build();
+
+        okHttpClient.newCall(request).enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+                if (callback != null) {
+                    callback.onFail();
+                }
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                Log.d("upload", "voice msg response: " + response.toString());
+               if( response.code()==200 && response.body() != null) {
+                   String data = response.body().string();
+                   //voice msg response: upload/file/202104102037715.mp3
+                   if (callback != null) {
+                       callback.onSuccess(data);
+                   }
+               } else {
+                   if (callback != null) {
+                       callback.onFail();
+                   }
+               }
+            }
+        });
+    }
+
+    public static void download(String url, Object tag, final DownloadListener listener) {
+        if (okHttpClient == null) {
+            okHttpClient = new OkHttpClient();
+        }
+
+        Request request = new Request.Builder()
+                .url(url)
+                .tag(tag)
+                .build();
+
+        okHttpClient.newCall(request).enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+                Log.d("download", "onFailure==" + e.toString());
+                if (listener != null) {
+                    listener.onDownloadFailed(); // 下载失败
+                }
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) {
+                Log.d("download", "response==" + response.body().contentLength());
+                InputStream is = null;
+                byte[] buf = new byte[2048];
+                int len;
+                FileOutputStream fos = null;
+                try {
+                    is = response.body().byteStream();
+                    long total = response.body().contentLength();
+                    File file = new File(isHaveExistDir(new File(FILE_APK_PATH), new File(FILE_APK_PATH + "/" + FILE_APK_NAME)), FILE_APK_NAME);
+                    fos = new FileOutputStream(file);
+                    long sum = 0;
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                        sum = sum + (long) len;
+                        //int progress = (int) (sum * 1.0f / total * 100);
+                        float sp = (float) sum / (float) total;
+                        int progress = (int) (sp * 100);
+                        Log.d("download", "progress==" + progress);
+                        if (listener != null) {
+                            listener.onDownloading(progress);// 下载中
+                        }
+                    }
+                    fos.flush();
+                    if (listener != null) {
+                        listener.onDownloadSuccess(); // 下载完成
+                    }
+                } catch (Exception e) {
+                    Log.d("download", "Exception==");
+                    if (listener != null) {
+                        listener.onDownloadFailed();
+                    }
+                } finally {
+                    try {
+                        if (is != null)
+                            is.close();
+                        if (fos != null)
+                            fos.close();
+                    } catch (IOException e) {
+                        Log.d("download", "IOException==");
+                    }
+                }
+            }
+        });
+    }
+
+    public static void cancelRequestByTag(Object tag) {
+        if (okHttpClient != null && tag != null) {
+            for (Call call : okHttpClient.dispatcher().queuedCalls()) {
+                if (tag.equals(call.request().tag())) {
+                    call.cancel();
+                }
+            }
+
+            for (Call call : okHttpClient.dispatcher().runningCalls()) {
+                if (tag.equals(call.request().tag())) {
+                    call.cancel();
+                }
+            }
+        }
+    }
+
+    private static String isHaveExistDir(File downloadFile, File sonFile) throws IOException {
+        Log.d("download", "downloadFile.mkdirs()==" + downloadFile.mkdirs());
+        Log.d("download", "sonFile.mkdir()==" + sonFile.mkdir());
+        if (!downloadFile.mkdirs()) {
+            downloadFile.createNewFile();
+        }
+        deleteAPKFile(sonFile);//只要文件名相同就可以自动替换(按道理此处不需要了,但为了保险起见还是先执行删除操作)。
+        return downloadFile.getAbsolutePath();
+    }
+
+    public static boolean deleteAPKFile(File downloadFile) {
+        return downloadFile.delete();
+    }
+
+
+    public interface UploadCallback{
+        void onFail();
+        void onSuccess(String data);
+    }
+
+    public interface DownloadListener {
+        /**
+         * 下载成功
+         */
+        void onDownloadSuccess();
+
+        /**
+         * @param progress 下载进度
+         */
+        void onDownloading(int progress);
+
+        /**
+         * 下载失败
+         */
+        void onDownloadFailed();
+    }
+}

+ 140 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/LanguageSetDialogHelper.java

@@ -0,0 +1,140 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.os.Handler;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.app.ncs.callingdoor.settings.SettingConfig;
+
+
+public class LanguageSetDialogHelper {
+
+    private static AlertDialog dialog;
+    private static int selectIndex;
+
+    public static void showDialog(final Activity activity) {
+        if (dialog != null && dialog.isShowing()) {
+            return;
+        }
+
+        final int originIndex = LocaleMangerUtils.getCurrentLocaleIndex();
+        selectIndex = originIndex;
+
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.language_set_dialog, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+
+        RadioButton btnYes = contentView.findViewById(R.id.rb_language_yes);
+        RadioButton btnNo = contentView.findViewById(R.id.rb_language_no);
+        final int mode = SettingConfig.getLanguageMode(activity);
+        if (mode == 0) {
+            btnYes.setChecked(true);
+        } else {
+            btnNo.setChecked(true);
+        }
+
+        Button buttonCancel = contentView.findViewById(R.id.cancel_button);
+        Button buttonConfirm = contentView.findViewById(R.id.confirm_button);
+        Spinner spinner = contentView.findViewById(R.id.spinner_language_select);
+        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(activity,
+                R.array.language_list, R.layout.spinner_item);
+        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+        spinner.setAdapter(adapter);
+        spinner.setSelection(originIndex);
+        spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                Log.d("languageId", "pos: " + position + ", originIndex: " + originIndex);
+                selectIndex = position;
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+
+            }
+        });
+
+        RadioGroup languageGroup = contentView.findViewById(R.id.group_language_mode);
+        languageGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                if (checkedId == R.id.rb_language_yes) {
+                    SettingConfig.setLanguageMode(activity, 0);
+                } else {
+                    SettingConfig.setLanguageMode(activity, 1);
+                }
+            }
+        });
+
+        buttonCancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (dialog != null) {
+                    dialog.dismiss();
+                }
+            }
+        });
+
+        buttonConfirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                SettingConfig.setLanguageId(activity, selectIndex);
+
+                if (SettingConfig.getLanguageMode(activity) == 1) {
+                    if (selectIndex != originIndex) {
+                        Toast.makeText(activity, "restart now...", Toast.LENGTH_LONG).show();
+                        new Handler().postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                AppUpdateHelper.restartApp(activity);
+                            }
+                        }, 3000);
+                    }
+                } else {
+                    Toast.makeText(activity, "restart now...", Toast.LENGTH_LONG).show();
+                    new Handler().postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            AppUpdateHelper.restartApp(activity);
+                        }
+                    }, 3000);
+                }
+
+                if (dialog != null) {
+                    dialog.dismiss();
+                }
+            }
+        });
+
+        dialog = builder.create();
+        //dialog.setCanceledOnTouchOutside(false);
+        //dialog.setCancelable(false);
+        dialog.show();
+
+        //设置dialog宽高及位置
+        try {
+            Window window = dialog.getWindow();
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.width = 480;
+            lp.height = 420;
+            lp.gravity = Gravity.CENTER;
+            window.setAttributes(lp);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 80 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/LocaleMangerUtils.java

@@ -0,0 +1,80 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.content.Context;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.os.Build;
+import android.util.DisplayMetrics;
+import android.util.Log;
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.app.ncs.callingdoor.settings.SettingConfig;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+
+import java.util.Locale;
+
+public class LocaleMangerUtils {
+
+    public static Locale getSystemLocale() {
+        return Locale.getDefault();
+    }
+
+    //获取当前语言id: 0--auto, 1--English, 2--中文, 3--西班牙语, 4--俄语
+    public static int getCurrentLocaleIndex() {
+        int languageSize = BaseApplication.appContext.getResources().getStringArray(R.array.language_list).length;
+        int index = SettingConfig.getLanguageId(BaseApplication.appContext);
+        //Log.d("wzl", "current language index: " + index);
+        if (index >= 0 && index <languageSize) {
+            return index;
+        } else {
+            return 0;
+        }
+    }
+
+    public static void setApplicationLanguageByIndex(Context context, int index) {
+        Locale locale = Locale.getDefault();
+        switch (index) {
+            case 0:
+                //
+                break;
+            case 1:
+                locale = Locale.ENGLISH;
+                break;
+            case 2:
+                locale = Locale.CHINESE;
+                break;
+            case 3:
+                locale = new Locale("es");
+                break;
+            case 4:
+                locale = new Locale("ru");
+                break;
+        }
+
+        setApplicationLanguage(context, locale);
+    }
+
+    public static void setApplicationLanguage(Context context, Locale locale) {
+        Log.d("locale", "set locale language: " + locale.getLanguage());
+        Configuration configuration = context.getResources().getConfiguration();
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+            configuration.setLocale(locale);
+        } else {
+            configuration.locale = locale;
+        }
+        // 更新context中的语言设置
+        Resources resources = context.getResources();
+        DisplayMetrics dm = resources.getDisplayMetrics();
+        resources.updateConfiguration(configuration, dm);
+    }
+
+    public static Locale getApplicationLocale() {
+        Configuration config = BaseApplication.appContext.getResources().getConfiguration();
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+            return config.locale;
+        } else {
+            return config.getLocales().get(0);
+        }
+    }
+
+}

+ 219 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/MediaPlayHelper.java

@@ -0,0 +1,219 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Message;
+
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+
+public class MediaPlayHelper {
+
+    private static MediaPlayHelper sInstance = null;
+    private MediaPlayer mediaPlayer;
+    private HandlerThread playHandlerThread;
+    private Handler playHandler;
+
+    private int mResId;
+    private String mUrl;
+    private float mVolume;
+    private boolean mLoop;
+
+    /**
+     * 播放res资源
+     */
+    public static final int PLAY_RES = 100;
+    /**
+     * 播放url资源
+     */
+    public static final int PLAY_URL = 101;
+    /**
+     * 停止
+     */
+    public static final int STOP = 102;
+    /**
+     * 释放
+     */
+    public static final int RELEASE = 103;
+
+
+    private MediaPlayHelper() {
+        createHandlerThread();
+    }
+
+    public static MediaPlayHelper getInstance() {
+        if (sInstance == null) {
+            synchronized (MediaPlayHelper.class) {
+                if (sInstance == null) {
+                    sInstance = new MediaPlayHelper();
+                }
+            }
+        }
+        return sInstance;
+    }
+
+    private void createHandlerThread() {
+        if (playHandlerThread == null) {
+            playHandlerThread = new HandlerThread("playHandlerThread");
+            playHandlerThread.start();
+        }
+
+        if (playHandler == null) {
+            playHandler = new Handler(playHandlerThread.getLooper()) {
+                @Override
+                public void handleMessage(Message msg) {
+                    switch (msg.what) {
+                        case PLAY_RES:
+                            playResMusicNow();
+                            break;
+                        case PLAY_URL:
+                            playUrlMusicNow();
+                            break;
+                        case STOP:
+                            stopMusicNow();
+                            break;
+                        case RELEASE:
+                            releaseMediaNow();
+                            break;
+                        default:
+                            break;
+                    }
+                }
+            };
+        }
+    }
+
+    public void playResMusic(int id, float vol, boolean loop) {
+        mResId = id;
+        mVolume = vol;
+        mLoop = loop;
+        playHandler.sendEmptyMessage(PLAY_RES);
+    }
+
+    public void playUrlMusic(String url, float vol, boolean loop) {
+        mUrl = url;
+        mVolume = vol;
+        mLoop = loop;
+        playHandler.sendEmptyMessage(PLAY_URL);
+    }
+
+    public void stopMusic() {
+        playHandler.sendEmptyMessage(STOP);
+    }
+
+    public void releaseMusic() {
+        playHandler.sendEmptyMessage(RELEASE);
+    }
+
+    //播放本地res音频资源
+    private void playResMusicNow() {
+        if (mediaPlayer != null && mediaPlayer.isPlaying()) {
+            mediaPlayer.stop();
+        }
+        mediaPlayer = MediaPlayer.create(BaseApplication.appContext, mResId);
+        try {
+            mediaPlayer.setLooping(mLoop);
+            mediaPlayer.setVolume(mVolume, mVolume);
+            mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
+            mediaPlayer.start();
+            mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
+                @Override
+                public void onCompletion(MediaPlayer player) {
+                    //playMusicComplete();
+                    //stopMusicNow();
+                }
+            });
+            mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() {
+                @Override
+                public boolean onError(MediaPlayer player, int what, int extra) {
+                    //playMusicError();
+                    stopMusicNow();
+                    return false;
+                }
+            });
+        } catch (Exception e) {
+            //playMusicError();
+            e.printStackTrace();
+        }
+    }
+
+    //播放远程或本地存储音频资源
+    private void playUrlMusicNow() {
+        if (mediaPlayer != null && mediaPlayer.isPlaying()) {
+            mediaPlayer.stop();
+        }
+        mediaPlayer = new MediaPlayer();
+        try {
+            mediaPlayer.reset();
+            mediaPlayer.setDataSource(mUrl);
+            mediaPlayer.setLooping(mLoop);
+            mediaPlayer.setVolume(mVolume, mVolume);
+            mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
+            mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
+                @Override
+                public void onPrepared(MediaPlayer player) {
+                    if (mediaPlayer != null) {
+                        mediaPlayer.start();
+                    }
+                }
+            });
+            mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
+                @Override
+                public void onCompletion(MediaPlayer player) {
+                    //playMusicComplete();
+                    //stopMusicNow();
+                }
+            });
+            mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() {
+                @Override
+                public boolean onError(MediaPlayer player, int what, int extra) {
+                    //playMusicError();
+                    stopMusicNow();
+                    return false;
+                }
+            });
+            mediaPlayer.prepareAsync();
+        } catch (Exception e) {
+            //playMusicError();
+            e.printStackTrace();
+        }
+    }
+
+    private void stopMusicNow() {
+        if (mediaPlayer != null) {
+            mediaPlayer.setOnPreparedListener(null);
+            mediaPlayer.setOnCompletionListener(null);
+            try {
+                //if (mediaPlayer.isPlaying()) {
+                    mediaPlayer.stop();
+                    mediaPlayer.release();
+                //}
+            } catch (IllegalStateException e) {
+                e.printStackTrace();
+            }
+        }
+        mediaPlayer = null;
+    }
+
+    private void releaseMediaNow() {
+        if (mediaPlayer != null) {
+            mediaPlayer.setOnPreparedListener(null);
+            mediaPlayer.setOnCompletionListener(null);
+            try {
+                mediaPlayer.stop();
+                mediaPlayer.release();
+            } catch (IllegalStateException e) {
+                e.printStackTrace();
+            }
+        }
+        mediaPlayer = null;
+    }
+
+    public boolean isMediaPlaying() {
+        if (mediaPlayer != null) {
+            return mediaPlayer.isPlaying();
+        }
+        return false;
+    }
+}

+ 496 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/NetHelper.java

@@ -0,0 +1,496 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.annotation.SuppressLint;
+import android.bluetooth.BluetoothAdapter;
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.text.TextUtils;
+
+
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+import com.wdkl.ncs.android.middleware.common.MessageEvent;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.Inet4Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import static com.wdkl.ncs.android.middleware.common.Constant.EVENT_INTERNETPING;
+
+public class NetHelper {
+    private WifiManager wifiManager;
+    private ConnectivityManager connManager;
+    private static NetHelper sInstance = null;
+
+    private static Timer timerNetStatus = null;
+    private static final int SCHEDULE_TIME = 30000;
+    public static boolean NetConn = false;
+
+    /**
+     * 以太网是否ping成功
+     */
+    public static final String ETHERNETSTATUS = "ethernetStatus";
+
+    public NetHelper() {
+    }
+
+    public static NetHelper getInstance() {
+        if (sInstance == null) {
+            synchronized (NetHelper.class) {
+                if (sInstance == null) {
+                    sInstance = new NetHelper();
+                }
+            }
+        }
+        return sInstance;
+    }
+
+    public void init() {
+        wifiManager = (WifiManager) BaseApplication.appContext.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
+        connManager = (ConnectivityManager) BaseApplication.appContext.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
+    }
+
+    public static void startNetCheck() {
+        if (timerNetStatus != null) {
+            timerNetStatus.purge();
+        }
+        timerNetStatus = new Timer();
+        timerNetStatus.schedule(new TimerTask() {
+            @Override
+            public void run() {
+                NetConn = ping(getLocalElement(3), 2, null);
+
+                EventBus.getDefault().post(new MessageEvent(ETHERNETSTATUS, EVENT_INTERNETPING));//循环检测SIP,以太网ping状态
+            }
+        }, 10, SCHEDULE_TIME);
+    }
+
+    /**
+     * ping 网络
+     *
+     * @param host
+     * @param pingCount
+     * @param stringBuffer
+     * @return
+     */
+    public static boolean ping(String host, int pingCount, StringBuffer stringBuffer) {
+        String line = null;
+        Process process = null;
+        BufferedReader successReader = null;
+        String command = "ping -c " + pingCount + " " + host;
+        boolean isSuccess = false;
+        try {
+            process = Runtime.getRuntime().exec(command);
+            if (process == null) {
+                append(stringBuffer, "ping fail:process is null.");
+                return false;
+            }
+            successReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+            while ((line = successReader.readLine()) != null) {
+                append(stringBuffer, line);
+            }
+            int status = process.waitFor();
+            if (status == 0) {
+                append(stringBuffer, "exec cmd success:" + command);
+                isSuccess = true;
+            } else {
+                append(stringBuffer, "exec cmd fail.");
+                isSuccess = false;
+            }
+            append(stringBuffer, "exec finished.");
+        } catch (IOException e) {
+        } catch (InterruptedException e) {
+        } finally {
+            if (process != null) {
+                process.destroy();
+            }
+            if (successReader != null) {
+                try {
+                    successReader.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+
+        return isSuccess;
+    }
+
+    private static void append(StringBuffer stringBuffer, String text) {
+        if (stringBuffer != null) {
+            stringBuffer.append(text + "\n");
+        }
+    }
+
+    /**
+     * 获取网关  Waderson
+     * <p>
+     * 1 WIFI情况下获取网关 2 有线网络下的DHCP模式连接 3 有线网络其他连接方式:比如静态ip、pppoe拨号、ipoe拨号等
+     */
+    public static String getLocalElement(int type) {
+        String e = "";
+        if (1 == type) {
+            //e = getLocalElementByWifi();
+        } else if (2 == type) {
+            e = getLocalElementByDhcp();
+        } else if (3 == type) {
+            e = getLocalElementByIp();
+        }
+        if (!TextUtils.isEmpty(e) && e.length() >= 11 && e.length() <= 15) {
+            return e;
+        } else {
+            return "192.168.101.1";
+        }
+    }
+
+
+    /**
+     * 有线网络下的DHCP模式连接
+     */
+    public static String getLocalElementByDhcp() {
+        BufferedReader bufferedReader = null;
+        String str2 = "";
+        String str3 = "getprop dhcp.eth0.gateway";
+        Process exec;
+        BufferedReader bufferedReader2 = null;
+        try {
+            exec = Runtime.getRuntime().exec(str3);
+            try {
+                bufferedReader2 = new BufferedReader(new InputStreamReader(exec.getInputStream()));
+            } catch (Throwable th3) {
+                if (bufferedReader != null) {
+                    bufferedReader.close();
+                }
+                if (exec != null) {
+                    exec.exitValue();
+                }
+            }
+            try {
+                str3 = bufferedReader2.readLine();
+                if (str3 != null) {
+                    TextUtils.isEmpty(str3);
+                }
+                try {
+                    bufferedReader2.close();
+                } catch (IOException iOException222) {
+                    iOException222.printStackTrace();
+                }
+                if (exec != null) {
+                    try {
+                        exec.exitValue();
+                    } catch (Exception e5) {
+                    }
+                }
+            } catch (IOException e6) {
+                str3 = str2;
+                if (bufferedReader2 != null) {
+                    bufferedReader2.close();
+                }
+                if (exec != null) {
+                    exec.exitValue();
+                }
+                return str3;
+            }
+        } catch (IOException e62) {
+            bufferedReader2 = null;
+            exec = null;
+            str3 = str2;
+            if (bufferedReader2 != null) {
+                try {
+                    bufferedReader2.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (exec != null) {
+                exec.exitValue();
+            }
+            return str3;
+        } catch (Throwable th4) {
+            exec = null;
+            if (bufferedReader != null) {
+                try {
+                    bufferedReader.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (exec != null) {
+                exec.exitValue();
+            }
+        }
+        return str3;
+    }
+
+    /**
+     * 有线网络其他连接方式:比如静态ip、pppoe拨号、ipoe拨号等
+     */
+    public static String getLocalElementByIp() {
+        BufferedReader bufferedReader = null;
+        String result = "";
+        String str2 = "";
+        String str3 = "ip route list table 0";
+        Process exec;
+        BufferedReader bufferedReader2 = null;
+        try {
+            exec = Runtime.getRuntime().exec(str3);
+            try {
+                bufferedReader2 = new BufferedReader(new InputStreamReader(exec.getInputStream()));
+            } catch (Throwable th3) {
+                if (bufferedReader != null) {
+                    bufferedReader.close();
+                }
+                if (exec != null) {
+                    exec.exitValue();
+                }
+            }
+            try {
+                str2 = bufferedReader2.readLine();
+                if (str2 != null) {
+                    str2 = str2.trim();
+                    String[] strings = str2.split("\\s+");
+                    if (strings.length > 3) {
+                        result = strings[2];
+                    }
+                }
+                try {
+                    bufferedReader2.close();
+                } catch (IOException iOException222) {
+                    iOException222.printStackTrace();
+                }
+                if (exec != null) {
+                    try {
+                        exec.exitValue();
+                    } catch (Exception e5) {
+                    }
+                }
+            } catch (IOException e6) {
+                if (bufferedReader2 != null) {
+                    bufferedReader2.close();
+                }
+                if (exec != null) {
+                    exec.exitValue();
+                }
+                return result;
+            }
+        } catch (IOException e62) {
+            bufferedReader2 = null;
+            exec = null;
+            if (bufferedReader2 != null) {
+                try {
+                    bufferedReader2.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (exec != null) {
+                exec.exitValue();
+            }
+            return result;
+        } catch (Throwable th4) {
+            exec = null;
+            if (bufferedReader != null) {
+                try {
+                    bufferedReader.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (exec != null) {
+                exec.exitValue();
+            }
+        }
+        return result;
+    }
+
+    //获取本地ip地址
+    public String getLocalIP() {
+        try {
+            for (Enumeration<NetworkInterface> enNetI = NetworkInterface.getNetworkInterfaces(); enNetI.hasMoreElements(); ) {
+                NetworkInterface netI = enNetI.nextElement();
+                for (Enumeration<InetAddress> enumIpAddr = netI.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {
+                    InetAddress inetAddress = enumIpAddr.nextElement();
+                    if (inetAddress instanceof Inet4Address && !inetAddress.isLoopbackAddress()) {
+                        return inetAddress.getHostAddress();
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 得到MAC
+     *
+     * @return String
+     */
+    public String getMacAddress() {
+        String mac = "";
+        try {
+            mac = getLocalMacAddressFromIp();
+            if (TextUtils.isEmpty(mac)) {
+                mac = getNetworkMac();
+            }
+            if (TextUtils.isEmpty(mac)) {
+                mac = tryGetWifiMac();
+            }
+        } catch (Exception e) {
+        }
+        return mac;
+    }
+
+    /**
+     * 通过WiFiManager获取mac地址
+     * 这个方法Android 7.0是获取不到的,返回的是null,其实是返回“02:00:00:00:00:00”
+     *
+     * @return
+     */
+    public String tryGetWifiMac() {
+        String mac;
+        WifiInfo wi = wifiManager.getConnectionInfo();
+        if (wi == null || wi.getMacAddress() == null) {
+            mac = null;
+        }
+        if ("02:00:00:00:00:00".equals(wi.getMacAddress().trim())) {
+            mac = null;
+        } else {
+            mac = wi.getMacAddress().trim();
+        }
+        return mac;
+    }
+
+    /**
+     * 通过网络接口获取
+     *
+     * @return
+     */
+    public static String getNetworkMac() {
+        try {
+            List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
+            for (NetworkInterface nif : all) {
+                // if (!nif.getName().equalsIgnoreCase("wlan0") && !nif.getName().equalsIgnoreCase("eth0") && !nif.getName().equalsIgnoreCase("eth1"))
+                if (!nif.getName().equalsIgnoreCase("eth0") && !nif.getName().equalsIgnoreCase("eth1") && !nif.getName().equalsIgnoreCase("eth2"))
+                    continue;
+                byte[] macBytes = nif.getHardwareAddress();
+                if (macBytes == null) {
+                    return null;
+                }
+                StringBuilder res1 = new StringBuilder();
+                for (byte b : macBytes) {
+                    res1.append(String.format("%02X:", b));
+                }
+                if (res1.length() > 0) {
+                    res1.deleteCharAt(res1.length() - 1);
+                }
+                return res1.toString();
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        return null;
+    }
+
+
+    /**
+     * 根据IP地址获取MAC地址
+     *
+     * @return
+     */
+    @SuppressLint("NewApi")
+    public static String getLocalMacAddressFromIp() {
+        String strMacAddr = null;
+        try {
+            // 获得IpD地址
+            InetAddress ip = getLocalInetAddress();
+            byte[] b = NetworkInterface.getByInetAddress(ip)
+                    .getHardwareAddress();
+            StringBuffer buffer = new StringBuffer();
+            for (int i = 0; i < b.length; i++) {
+                if (i != 0) {
+                    buffer.append(':');
+                }
+                String str = Integer.toHexString(b[i] & 0xFF);
+                buffer.append(str.length() == 1 ? 0 + str : str);
+            }
+            strMacAddr = buffer.toString().toUpperCase();
+
+        } catch (Exception e) {
+
+        }
+
+        return strMacAddr;
+    }
+
+    /**
+     * 获取移动设备本地IP
+     *
+     * @return
+     */
+    public static InetAddress getLocalInetAddress() {
+        InetAddress ip = null;
+        try {
+            // 列举
+            Enumeration<NetworkInterface> en_netInterface = NetworkInterface
+                    .getNetworkInterfaces();
+            while (en_netInterface.hasMoreElements()) {// 是否还有元素
+                NetworkInterface ni = (NetworkInterface) en_netInterface
+                        .nextElement();// 得到下一个元素
+                Enumeration<InetAddress> en_ip = ni.getInetAddresses();// 得到一个ip地址的列举
+                while (en_ip.hasMoreElements()) {
+                    ip = en_ip.nextElement();
+                    if (!ip.isLoopbackAddress()
+                            && ip.getHostAddress().indexOf(":") == -1)
+                        break;
+                    else
+                        ip = null;
+                }
+
+                if (ip != null) {
+                    break;
+                }
+            }
+        } catch (SocketException e) {
+
+            e.printStackTrace();
+        }
+        return ip;
+    }
+
+    public static boolean isBTConnected() {
+        BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
+        if (btAdapter != null) {
+            return btAdapter.getState() == BluetoothAdapter.STATE_ON;
+        }
+
+        return false;
+    }
+
+    public int getNetworkType() {
+        if (connManager != null && connManager.getActiveNetworkInfo() != null) {
+            return connManager.getActiveNetworkInfo().getType();
+        }
+
+        return -1;
+    }
+
+    public boolean networkAvailable() {
+        if (connManager != null && connManager.getActiveNetworkInfo() != null) {
+            return connManager.getActiveNetworkInfo().isConnected();
+        }
+
+        return false;
+    }
+}

+ 127 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/PasswordDialogHelper.java

@@ -0,0 +1,127 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.GridView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.app.ncs.callingdoor.adapter.NumAdapter;
+
+
+public class PasswordDialogHelper {
+
+    private static AlertDialog dialog;
+    private static String pwd = "";
+
+    public static void showPasswordDialog(final Activity activity, final MyListener listener) {
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.password_dialog_lay, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+
+        final String[] numbers = {"1","2","3","4","5","6","7","8","9"};
+        final TextView password = contentView.findViewById(R.id.tv_psw_view);
+        final LinearLayout llPwd = contentView.findViewById(R.id.ll_password);
+        final LinearLayout llServer = contentView.findViewById(R.id.ll_server_config);
+        GridView gridView = contentView.findViewById(R.id.grid_psw);
+        NumAdapter adapter = new NumAdapter(numbers, activity);
+        gridView.setAdapter(adapter);
+        gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                if (pwd.length() <= 2) {
+                    pwd = pwd + numbers[position];
+                    password.setText(pwd);
+                }
+            }
+        });
+
+        TextView delete = contentView.findViewById(R.id.btn_delete);
+        TextView cancel = contentView.findViewById(R.id.btn_cancel);
+        TextView confirm = contentView.findViewById(R.id.btn_confirm);
+        delete.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Log.d("pwd", "delete password len: " + pwd.length() + "--" + pwd);
+                if (pwd.length() > 1) {
+                    pwd = pwd.substring(0, pwd.length()-1);
+                    password.setText(pwd);
+                } else {
+                    pwd = "";
+                    password.setText(pwd);
+                    password.setHint(R.string.input_password);
+                }
+            }
+        });
+
+        cancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dismissCallDialog();
+            }
+        });
+
+        confirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if ("888".equals(pwd)) {
+                    if (listener != null) {
+                        listener.onConfirm();
+                        dismissCallDialog();
+                    }
+                } else {
+                    Toast.makeText(activity, R.string.invalid_password, Toast.LENGTH_SHORT).show();
+                }
+            }
+        });
+
+
+
+
+        dialog = builder.create();
+        dialog.setCanceledOnTouchOutside(false);
+        dialog.setCancelable(false);
+        dialog.show();
+
+        //设置dialog宽高及位置
+        try {
+            Window window = dialog.getWindow();
+            window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.width = 400;
+            lp.height = 480;
+            lp.gravity = Gravity.CENTER;
+            window.setAttributes(lp);
+
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
+                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_FULLSCREEN);
+            window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void dismissCallDialog() {
+        pwd = "";
+        if (dialog != null && dialog.isShowing()) {
+            dialog.dismiss();
+        }
+    }
+
+    public interface MyListener{
+        void onConfirm();
+    }
+}

+ 126 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/RecordHelper.java

@@ -0,0 +1,126 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.media.MediaRecorder;
+import android.os.Environment;
+import android.util.Log;
+
+import java.io.File;
+import java.io.IOException;
+
+public class RecordHelper {
+    private static final String VOICE_MSG_FILE_PATH = Environment.getExternalStorageDirectory().getPath() + "/VoiceMsg";
+    private String audiofilePath;
+    private MediaRecorder mediaRecorder;
+    private static RecordHelper sInstance = null;
+    private boolean recording = false;
+
+    private final static Object lock = new Object();
+
+    public RecordHelper() {
+    }
+
+    public static RecordHelper getInstance() {
+        if (sInstance == null) {
+            synchronized (RecordHelper.class) {
+                if (sInstance == null) {
+                    sInstance = new RecordHelper();
+                }
+            }
+        }
+        return sInstance;
+    }
+
+    public void init() {
+        //创建音频文件路径
+        File file = new File(VOICE_MSG_FILE_PATH);
+        if (!file.exists()) {
+            file.mkdir();
+        }
+    }
+
+    public void startRecord() {
+        audiofilePath = VOICE_MSG_FILE_PATH + "/" + System.currentTimeMillis() + "_voice.mp3";
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                synchronized (lock) {
+                    try {
+                        mediaRecorder = new MediaRecorder();
+                        mediaRecorder.setOutputFile(audiofilePath);
+                        mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);// 设置MediaRecorder的音频源为麦克风
+                        mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);// 设置MediaRecorder录制的音频格式
+                        mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);// 设置MediaRecorder录制音频的编码为amr
+                        mediaRecorder.prepare();
+                        mediaRecorder.start();
+                        recording = true;
+                    } catch (IOException e) {
+                        Log.i("error", "call startAmr(File mRecAudioFile) failed!" + e.getMessage());
+                    }
+                }
+            }
+        }).start();
+    }
+
+    public void stopRecord() {
+        synchronized (lock) {
+            try {
+                mediaRecorder.stop();
+                mediaRecorder.release();
+                mediaRecorder = null;
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                recording = false;
+            }
+        }
+    }
+
+    public void recordTestStart() {
+        audiofilePath = VOICE_MSG_FILE_PATH + "/" + System.currentTimeMillis() + "_voice.mp3";
+        synchronized (lock) {
+            try {
+                mediaRecorder = new MediaRecorder();
+                mediaRecorder.setOutputFile(audiofilePath);
+                mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);// 设置MediaRecorder的音频源为麦克风
+                mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);// 设置MediaRecorder录制的音频格式
+                mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);// 设置MediaRecorder录制音频的编码为amr
+                mediaRecorder.prepare();
+                mediaRecorder.start();
+                recording = true;
+            } catch (IOException e) {
+                Log.i("error", "call startAmr(File mRecAudioFile) failed!" + e.getMessage());
+            }
+        }
+    }
+
+    public void recordTestStop() {
+        synchronized (lock) {
+            try {
+                mediaRecorder.stop();
+                mediaRecorder.release();
+                mediaRecorder = null;
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                recording = false;
+            }
+        }
+    }
+
+    public void deleteAudioFile(String path) {
+        synchronized (lock) {
+            File file = new File(path);
+            if (file.exists()) {
+                file.delete();
+            }
+        }
+    }
+
+    public void deleteAudioFile() {
+        deleteAudioFile(audiofilePath);
+    }
+
+    public String getAudiofilePath() {
+        return audiofilePath;
+    }
+}

+ 22 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/RingPlayHelper.java

@@ -0,0 +1,22 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.content.Context;
+import android.media.AudioManager;
+
+public class RingPlayHelper {
+
+    private static AsyncPlayer ringPlayer;
+
+    public static void playRingTone(Context context, int res, boolean loop) {
+        if (ringPlayer == null) {
+            ringPlayer = new AsyncPlayer(null);
+        }
+        ringPlayer.play(context, res, loop, AudioManager.STREAM_MUSIC);
+    }
+
+    public static void stopRingTone() {
+        if (ringPlayer != null) {
+            ringPlayer.stop();
+        }
+    }
+}

+ 63 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/SOSHelper.java

@@ -0,0 +1,63 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.os.Build;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+
+import com.wdkl.app.ncs.callingdoor.settings.SettingConfig;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+import com.wdkl.ncs.android.middleware.common.Constant;
+import com.wdkl.ncs.android.middleware.tcp.channel.OtherUtil;
+
+
+/*
+ * 紧急按钮辅助类
+ */
+public class SOSHelper {
+
+    private static final Handler handler = new Handler(Looper.getMainLooper()) {
+        @Override
+        public void handleMessage(Message msg) {
+            sosStop();
+        }
+    };
+
+    public static void sosStart() {
+        if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+            Constant.SOS_ON = true;
+            SerialPortHelper.setSosLight("2");
+            OtherUtil.sendSosCall(Constant.DEVICE_ID);
+            SerialPortHelper.setDoorLight(1, "200"); //红色闪烁
+
+            Constant.sosOn = true;
+
+            //60s之后紧急按钮灯自动复位
+            handler.sendEmptyMessageDelayed(110, 60000);
+        }
+    }
+
+    public static void sosStop() {
+        if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+            Constant.SOS_ON = false;
+            handler.removeCallbacksAndMessages(null);
+            if (Constant.day_state == 1) {
+                SerialPortHelper.setSosLight("1");
+            } else {
+                SerialPortHelper.setSosLight("0");
+            }
+
+            Constant.sosOn = false;
+
+            //如果当前在护理中则不操作门灯,如果不在护理中则重置门灯
+            if (SettingConfig.getDoorLightAlwaysOn(BaseApplication.appContext) == 0) {
+                if (Constant.inNursing) {
+                    SerialPortHelper.setDoorLight(1, Constant.nursingColor); //绿色
+                } else {
+                    //SerialPortHelper.setDoorLight(1, "111"); //白色
+                    DoorLightHelper.resetDoorLight();
+                }
+            }
+        }
+    }
+}

+ 81 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/ScreenManagerUtil.kt

@@ -0,0 +1,81 @@
+package com.wdkl.app.ncs.callingdoor.helper
+
+import android.content.Context
+import android.content.Intent
+import android.net.Uri
+import android.os.Build
+import android.provider.Settings
+import android.util.Log
+
+class ScreenManagerUtil {
+
+
+    /**
+     * @return 0--255
+     */
+    fun getScreenBrightness(context: Context): Int {
+        var screenBrightness = 150
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+            if (!Settings.System.canWrite(context)) {
+                val intent = Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS)
+                intent.data = Uri.parse("package:" + context.packageName)
+                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+                context.startActivity(intent)
+            } else {
+                //有了权限,具体的动作
+                try {
+                    screenBrightness = Settings.System.getInt(context.contentResolver,
+                            Settings.System.SCREEN_BRIGHTNESS)
+                } catch (e: Settings.SettingNotFoundException) {
+                    e.printStackTrace()
+                }
+
+            }
+        } else {
+            try {
+                screenBrightness = Settings.System.getInt(context.contentResolver,
+                        Settings.System.SCREEN_BRIGHTNESS)
+            } catch (e: Settings.SettingNotFoundException) {
+                e.printStackTrace()
+            }
+
+        }
+
+        return screenBrightness
+    }
+
+
+    /**
+     * 保存当前的屏幕亮度值,并使之生效
+     *
+     * @param paramInt 0-255
+     */
+    fun setScreenBrightness(context: Context, paramInt: Int) {
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+            if (!Settings.System.canWrite(context)) {
+                val intent = Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS)
+                intent.data = Uri.parse("package:" + context.packageName)
+                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+                context.startActivity(intent)
+            } else {
+                //有了权限,具体的动作
+                Settings.System.putInt(context.contentResolver,
+                        Settings.System.SCREEN_BRIGHTNESS, paramInt)
+                val uri = Settings.System
+                        .getUriFor("screen_brightness")
+                Log.w("当前亮度", "当前亮度======" + getScreenBrightness(context))
+                context.contentResolver.notifyChange(uri, null)
+            }
+        } else {
+            Settings.System.putInt(context.contentResolver,
+                    Settings.System.SCREEN_BRIGHTNESS, paramInt)
+            val uri = Settings.System
+                    .getUriFor("screen_brightness")
+            Log.w("当前亮度", "当前亮度======" + getScreenBrightness(context))
+            context.contentResolver.notifyChange(uri, null)
+        }
+
+    }
+}

+ 69 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/SerialPortHelper.java

@@ -0,0 +1,69 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.os.Build;
+
+import serialporttest.utils.SerialPortUtil;
+
+public class SerialPortHelper {
+
+    /**
+     * 麦克风切换控制
+     */
+    public static void setMIC(boolean mainMIC) {
+        if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+            if (mainMIC) {
+                SerialPortUtil.getInstance().sendCommand(SerialPortUtil.MIC, "0", "F");
+            } else {
+                SerialPortUtil.getInstance().sendCommand(SerialPortUtil.MIC, "1", "F");
+            }
+        }
+    }
+
+    /**
+     * 设置免提
+     */
+    public static void setHandsFree(boolean isHandsFree) {
+        if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+            if (isHandsFree) {
+                SerialPortUtil.getInstance().sendCommand(SerialPortUtil.AUDIO, "0", "F");
+            } else {
+                SerialPortUtil.getInstance().sendCommand(SerialPortUtil.AUDIO, "1", "F");
+            }
+        }
+    }
+
+    /**
+     * 门灯控制开关
+     *
+     * @param data  0  表示灯灭   1  表示灯亮
+     * @param color 0 表示灯灭  非0表示灯的颜色
+     */
+    public static void setDoorLight(int data, String color) {
+        if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+            String command;
+            if (data == 0 || color == null) {
+                command = "000";
+            } else {
+                command = color;
+            }
+            SerialPortUtil.getInstance().sendCommand(SerialPortUtil.DOORLIGHT, command, "F");
+        }
+    }
+
+    /**
+     * 设置卫生间紧急按钮灯状态: 0关闭1打开2闪烁
+     */
+    public static void setSosLight(String state) {
+        if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+            SerialPortUtil.getInstance().sendCommand(SerialPortUtil.ULED, state, "F");
+        }
+    }
+
+    //重置设备
+    public static void resetDevice() {
+        if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+            //SerialPortUtil.getInstance().sendCommand(SerialPortUtil.NET_STATUS , "1", "F");
+            SerialPortUtil.getInstance().systemRestart();
+        }
+    }
+}

+ 159 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/ServerConfigDialogHelper.java

@@ -0,0 +1,159 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.EditText;
+import android.widget.GridView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.app.ncs.callingdoor.adapter.NumAdapter;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+import com.wdkl.ncs.android.lib.utils.ExtendMethodsKt;
+import com.wdkl.ncs.android.middleware.utils.CommonUtils;
+
+
+public class ServerConfigDialogHelper {
+
+    private static AlertDialog callDialog;
+    private static String pwd = "";
+
+    public static void showPasswordDialog(final Activity activity) {
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.server_config_dialog_lay, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+
+        final String[] numbers = {"1","2","3","4","5","6","7","8","9"};
+        final TextView password = contentView.findViewById(R.id.tv_psw_view);
+        final LinearLayout llPwd = contentView.findViewById(R.id.ll_password);
+        final LinearLayout llServer = contentView.findViewById(R.id.ll_server_config);
+        GridView gridView = contentView.findViewById(R.id.grid_psw);
+        NumAdapter adapter = new NumAdapter(numbers, activity);
+        gridView.setAdapter(adapter);
+        gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                if (pwd.length() <= 2) {
+                    pwd = pwd + numbers[position];
+                    password.setText(pwd);
+                }
+                Log.d("serverIp", "input password len: " + pwd.length() + "--" + pwd);
+            }
+        });
+
+        TextView delete = contentView.findViewById(R.id.btn_delete);
+        TextView cancel = contentView.findViewById(R.id.btn_cancel);
+        TextView confirm = contentView.findViewById(R.id.btn_confirm);
+        delete.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Log.d("serverIp", "delete password len: " + pwd.length() + "--" + pwd);
+                if (pwd.length() > 1) {
+                    pwd = pwd.substring(0, pwd.length()-1);
+                    password.setText(pwd);
+                } else {
+                    pwd = "";
+                    password.setText(pwd);
+                    password.setHint(R.string.input_password);
+                }
+            }
+        });
+
+        cancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dismissCallDialog();
+            }
+        });
+
+        confirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if ("666".equals(pwd)) {
+                    llPwd.setVisibility(View.GONE);
+                    llServer.setVisibility(View.VISIBLE);
+                } else {
+                    Toast.makeText(activity, R.string.invalid_password, Toast.LENGTH_SHORT).show();
+                }
+            }
+        });
+
+        final EditText editUrl = contentView.findViewById(R.id.edit_url);
+        final EditText editPort = contentView.findViewById(R.id.edit_port);
+        final EditText editSipUrl = contentView.findViewById(R.id.edit_sip_url);
+        final EditText editSipPort = contentView.findViewById(R.id.edit_sip_port);
+        TextView saveConfig = contentView.findViewById(R.id.btn_save_config);
+        TextView cancelConfig = contentView.findViewById(R.id.btn_cancel_config);
+        editUrl.setText(CommonUtils.getUrl(BaseApplication.appContext));
+        editPort.setText(CommonUtils.getUrlPort(BaseApplication.appContext));
+        //editSipUrl.setText(CommonUtils.getSipUrl(BaseApplication.appContext));
+        //editSipPort.setText(CommonUtils.getSipPort(BaseApplication.appContext));
+        saveConfig.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String url = editUrl.getText().toString();
+                String port = editPort.getText().toString();
+                if (TextUtils.isEmpty(url) || TextUtils.isEmpty(port)) {
+                    ExtendMethodsKt.showMessage(R.string.input_empty);
+                } else {
+                    //保存配置
+                    CommonUtils.setUrl(BaseApplication.appContext, editUrl.getText().toString());
+                    CommonUtils.setUrlPort(BaseApplication.appContext, editPort.getText().toString());
+                    //CommonUtils.setSipUrl(BaseApplication.appContext, editSipUrl.getText().toString());
+                    //CommonUtils.setSipPort(BaseApplication.appContext, editSipPort.getText().toString());
+                    dismissCallDialog();
+                }
+            }
+        });
+        cancelConfig.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dismissCallDialog();
+            }
+        });
+
+
+        callDialog = builder.create();
+        callDialog.setCanceledOnTouchOutside(false);
+        callDialog.setCancelable(false);
+        callDialog.show();
+
+        //设置dialog宽高及位置
+        try {
+            Window window = callDialog.getWindow();
+            window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.width = 400;
+            lp.height = 480;
+            lp.gravity = Gravity.CENTER;
+            window.setAttributes(lp);
+
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
+                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_FULLSCREEN);
+            window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void dismissCallDialog() {
+        pwd = "";
+        if (callDialog != null && callDialog.isShowing()) {
+            callDialog.dismiss();
+        }
+    }
+}

+ 86 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/SoundPoolManager.java

@@ -0,0 +1,86 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.media.AudioAttributes;
+import android.media.AudioManager;
+import android.media.SoundPool;
+import android.os.Build;
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+
+import java.util.HashMap;
+
+public class SoundPoolManager {
+
+    private static SoundPoolManager instance;
+    private SoundPool soundPool;
+    private HashMap<Integer, Integer> soundID = new HashMap<>();
+    private boolean isLoaded = false;
+    private boolean inited = false;
+
+    public static SoundPoolManager getInstance() {
+        if (instance == null) {
+            instance = new SoundPoolManager();
+        }
+        return instance;
+    }
+
+    public void init() {
+        if (inited) {
+            return;
+        }
+
+        if(Build.VERSION.SDK_INT > 21){
+            SoundPool.Builder builder = new SoundPool.Builder();
+            //传入音频数量
+            builder.setMaxStreams(7);
+            //AudioAttributes是一个封装音频各种属性的方法
+            AudioAttributes.Builder attrBuilder = new AudioAttributes.Builder();
+            //设置音频流的合适的属性
+            attrBuilder.setLegacyStreamType(AudioManager.STREAM_MUSIC);//STREAM_MUSIC
+            //加载一个AudioAttributes
+            builder.setAudioAttributes(attrBuilder.build());
+            soundPool = builder.build();
+        }else{
+            soundPool = new SoundPool(7, AudioManager.STREAM_MUSIC, 0);
+        }
+
+        //来电
+        soundID.put(1, soundPool.load(BaseApplication.appContext, R.raw.incoming_call, 1));
+        //去电
+        soundID.put(2, soundPool.load(BaseApplication.appContext, R.raw.outgoing_call, 1));
+        //测试
+        soundID.put(3, soundPool.load(BaseApplication.appContext, R.raw.mic_test, 1));
+        soundID.put(4, soundPool.load(BaseApplication.appContext, R.raw.test_start, 1));
+        soundID.put(5, soundPool.load(BaseApplication.appContext, R.raw.reinforced, 1));
+        soundID.put(6, soundPool.load(BaseApplication.appContext, R.raw.call_response, 1));
+        soundID.put(7, soundPool.load(BaseApplication.appContext, R.raw.dengdeng, 1));
+        soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
+            @Override
+            public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
+                isLoaded = true;
+                inited = true;
+            }
+        });
+    }
+
+    public int playSound(int index, float leftVol, float rightVol, int loop) {
+        try {
+            if (isLoaded) {
+                return soundPool.play(soundID.get(index), leftVol, rightVol, 1, loop, 1);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return -1;
+    }
+
+    public void stopPlaySound(int streamId) {
+        soundPool.stop(streamId);
+    }
+
+    public void release() {
+        soundPool.release();
+    }
+}

+ 101 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/UpdateTipsDialogHelper.java

@@ -0,0 +1,101 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Intent;
+import android.os.CountDownTimer;
+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 com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.app.ncs.callingdoor.activity.AppUpdateActivity;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+import com.wdkl.ncs.android.middleware.common.Constant;
+
+public class UpdateTipsDialogHelper {
+
+    private static AlertDialog dialog;
+
+    public static void showDialog(Activity activity) {
+        if (dialog != null && dialog.isShowing()) {
+            return;
+        }
+
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.update_tips_dialog, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+        Button buttonCancel = contentView.findViewById(R.id.cancel_button);
+        Button buttonConfirm = contentView.findViewById(R.id.confirm_button);
+        final CountDownTimer timer = new CountDownTimer(15000, 1000) {
+
+            @Override
+            public void onTick(long millisUntilFinished) {
+                String text = BaseApplication.appContext.getString(R.string.confirm_down_time, millisUntilFinished/1000);
+                buttonConfirm.setText(text);
+            }
+
+            @Override
+            public void onFinish() {
+                Intent intent = new Intent();
+                intent.setClass(activity, AppUpdateActivity.class);
+                activity.startActivity(intent);
+
+                if (dialog != null) {
+                    dialog.dismiss();
+                }
+            }
+        };
+        timer.start();
+
+        buttonCancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Constant.APP_UPDATING = false;
+                if (timer != null) {
+                    timer.cancel();
+                }
+                if (dialog != null) {
+                    dialog.dismiss();
+                }
+            }
+        });
+
+        buttonConfirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (timer != null) {
+                    timer.cancel();
+                }
+
+                Intent intent = new Intent();
+                intent.setClass(activity, AppUpdateActivity.class);
+                activity.startActivity(intent);
+
+                if (dialog != null) {
+                    dialog.dismiss();
+                }
+            }
+        });
+
+        dialog = builder.create();
+        dialog.setCanceledOnTouchOutside(false);
+        dialog.setCancelable(false);
+        dialog.show();
+
+        //设置dialog宽高及位置
+        try {
+            Window window = dialog.getWindow();
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.width = 600;
+            lp.height = 320;
+            lp.gravity = Gravity.CENTER;
+            window.setAttributes(lp);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 59 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/Utils.java

@@ -0,0 +1,59 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.hardware.Camera;
+import android.text.TextUtils;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.wdkl.app.ncs.callingdoor.R;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+import com.wdkl.ncs.android.lib.utils.DisplayUtils;
+import com.wdkl.ncs.android.middleware.common.Constant;
+import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO;
+
+import java.util.ArrayList;
+
+public class Utils {
+    private static ArrayList<FrameBedVO> bedVOS = new ArrayList<>();
+
+    public static void checkCameraSupport() {
+        int num = Camera.getNumberOfCameras();
+        if (num > 0) {
+            Constant.supportCamera = true;
+        } else {
+            Constant.supportCamera = false;
+        }
+    }
+
+
+    public static void setInBedVos(ArrayList<FrameBedVO> data) {
+        bedVOS.clear();
+        bedVOS.addAll(data);
+    }
+
+    public static ArrayList<FrameBedVO> getInBedVOS() {
+        return bedVOS;
+    }
+
+    //带图片的toast
+    public static void showToastWithImage(String message) {
+        View toastView = LayoutInflater.from(BaseApplication.appContext).inflate(R.layout.view_toast_image, null);
+        LinearLayout layout = (LinearLayout) toastView.findViewById(R.id.toast_linear);
+        //动态设置toast控件的宽高度
+        //这里用了一个将dp转换为px的工具类PxUtil
+        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams((int) DisplayUtils.dp2px(BaseApplication.appContext, 200f), (int)DisplayUtils.dp2px(BaseApplication.appContext, 200f));
+        layout.setLayoutParams(layoutParams);
+        TextView textView = toastView.findViewById(R.id.tv_toast_clear);
+        textView.setText(message);
+        Toast mToast = new Toast(BaseApplication.appContext);
+        mToast.setDuration(Toast.LENGTH_LONG);
+        mToast.setGravity(Gravity.CENTER, 0, 0);
+        mToast.setView(toastView);
+        mToast.show();
+    }
+}

+ 184 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/VoiceManagerUtil.java

@@ -0,0 +1,184 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.content.Context;
+import android.media.AudioManager;
+
+/**
+ * 类名称:VoiceManagerUtil <br>
+ * 类描述:声音控制工具类 <br>
+ * 创建人:Waderson Shll (TEL:15675117662)<br>
+ * 创建时间:2018-03-15 <br>
+ * 特别提醒:如有需要该类可任意创建与调用;在未通知本人的情况下该类禁止任何修改!<br>
+ */
+public class VoiceManagerUtil {
+    /**
+     * 获取提示音音量最大值
+     *
+     * @param context
+     */
+    public static int getAlarmMax(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM);
+    }
+
+    /**
+     * 获取提示音音量当前值
+     *
+     * @param context
+     */
+    public static int getAlarmNow(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamVolume(AudioManager.STREAM_ALARM);
+    }
+
+    /**
+     * 获取多媒体音量最大值
+     *
+     * @param context
+     */
+    public static int getMusicMax(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
+    }
+
+    /**
+     * 获取多媒体音量当前值
+     *
+     * @param context
+     */
+    public static int getMusicNow(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
+    }
+
+    /**
+     * 获取铃声音量最大值
+     *
+     * @param context
+     */
+    public static int getRingMax(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_RING);
+    }
+
+    /**
+     * 获取铃声音量当前值
+     *
+     * @param context
+     */
+    public static int getRingNow(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamVolume(AudioManager.STREAM_RING);
+    }
+
+    /**
+     * 获取系统音量最大值
+     *
+     * @param context
+     */
+    public static int getSystemMax(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_SYSTEM);
+    }
+
+    /**
+     * 获取系统音量当前值
+     *
+     * @param context
+     */
+    public static int getSystemNow(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamVolume(AudioManager.STREAM_SYSTEM);
+    }
+
+    /**
+     * 获取通话音量最大值
+     *
+     * @param context
+     */
+    public static int getCallMax(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
+    }
+
+    /**
+     * 获取通话音量当前值
+     *
+     * @param context
+     */
+    public static int getCallNow(Context context) {
+        AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        return mAudioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
+    }
+
+    /**
+     * 设置提示音音量
+     *
+     * @param context
+     * @param percent (百分比;只能0--100之间)
+     */
+    public static void setAlarmVoice(Context context, int percent) {
+        float vPercent=((float)percent)/100f;
+        vPercent = vPercent < 0 ? 0 : vPercent;
+        vPercent = vPercent > 1 ? 1 : vPercent;
+        AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        audioManager.setStreamVolume(AudioManager.STREAM_ALARM, (int) (getAlarmMax(context) * vPercent), 0);
+    }
+
+    /**
+     * 设置多媒体音量
+     *
+     * @param context
+     * @param percent (百分比;只能0--100之间)
+     */
+    public static void setMusicVoice(Context context, int percent) {
+        float vPercent=((float)percent)/100f;
+        vPercent = vPercent < 0 ? 0 : vPercent;
+        vPercent = vPercent > 1 ? 1 : vPercent;
+        AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, (int) (getMusicMax(context) * vPercent), 0);
+    }
+
+    /**
+     * 设置铃声音量
+     *
+     * @param context
+     * @param percent (百分比;只能0--100之间)
+     */
+    public static void setRingVoice(Context context, int percent) {
+        float vPercent=((float)percent)/100f;
+        vPercent = vPercent < 0 ? 0 : vPercent;
+        vPercent = vPercent > 1 ? 1 : vPercent;
+        AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        audioManager.setStreamVolume(AudioManager.STREAM_RING, (int) (getRingMax(context) * vPercent), 0);
+    }
+
+    /**
+     * 设置系统音量
+     *
+     * @param context
+     * @param percent (百分比;只能0--100之间)
+     */
+    public static void setSystemVoice(Context context, int percent) {
+        float vPercent=((float)percent)/100f;
+        vPercent = vPercent < 0 ? 0 : vPercent;
+        vPercent = vPercent > 1 ? 1 : vPercent;
+        AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        audioManager.setStreamVolume(AudioManager.STREAM_SYSTEM, (int) (getSystemMax(context) * vPercent), 0);
+    }
+
+    /**
+     * 设置通话音量
+     *
+     * @param context
+     * @param percent (百分比;只能0--100之间)
+     */
+    public static void setCallVoice(Context context, int percent) {
+        float vPercent=((float)percent)/100f;
+        vPercent = vPercent < 0 ? 0 : vPercent;
+        vPercent = vPercent > 1 ? 1 : vPercent;
+        AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+        audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, (int) (getCallMax(context) * vPercent), 0);
+    }
+
+}

+ 50 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/WarningDialogHelper.java

@@ -0,0 +1,50 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+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 com.wdkl.app.ncs.callingdoor.R;
+
+public class WarningDialogHelper {
+    private static AlertDialog dialog;
+
+    public static void showDialog(Activity activity) {
+        if (dialog != null && dialog.isShowing()) {
+            return;
+        }
+
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.warning_dialog_lay, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+        Button button = contentView.findViewById(R.id.cancel_button);
+        button.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                AppUpdateHelper.reboot(activity);
+            }
+        });
+
+        dialog = builder.create();
+        //dialog.setCanceledOnTouchOutside(false);
+        //dialog.setCancelable(false);
+        dialog.show();
+
+        //设置dialog宽高及位置
+        try {
+            Window window = dialog.getWindow();
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.width = 600;
+            lp.height = 240;
+            lp.gravity = Gravity.CENTER;
+            window.setAttributes(lp);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 242 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/helper/XCrashUtils.java

@@ -0,0 +1,242 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.app.AlarmManager;
+import android.app.Application;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Build;
+import android.util.Log;
+
+import com.wdkl.app.ncs.callingdoor.BuildConfig;
+import com.wdkl.ncs.android.component.welcome.activity.WelcomeActivity;
+import com.wdkl.ncs.android.middleware.api.UrlManager;
+
+import org.json.JSONObject;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.FormBody;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import xcrash.ICrashCallback;
+import xcrash.TombstoneManager;
+import xcrash.TombstoneParser;
+import xcrash.XCrash;
+
+public class XCrashUtils {
+    private final static String TAG = "XCrashUtils";
+
+    private Application app;
+    private OkHttpClient okHttpClient;
+
+    // callback for java crash, native crash and ANR
+    private final ICrashCallback callback = new ICrashCallback() {
+        @Override
+        public void onCrash(String logPath, String emergency) {
+            Log.d(TAG, "log path: " + (logPath != null ? logPath : "(null)") + ", emergency: " + (emergency != null ? emergency : "(null)"));
+
+            if (emergency != null) {
+                debug(logPath, emergency);
+
+                // Disk is exhausted, send crash report immediately.
+                //sendThenDeleteCrashLog(logPath, emergency);
+            } else {
+                // Add some expanded sections. Send crash report at the next time APP startup.
+
+                // OK
+                TombstoneManager.appendSection(logPath, "expanded_key_1", "expanded_content");
+                TombstoneManager.appendSection(logPath, "expanded_key_2", "expanded_content_row_1\nexpanded_content_row_2");
+
+                // Invalid. (Do NOT include multiple consecutive newline characters ("\n\n") in the content string.)
+                // TombstoneManager.appendSection(logPath, "expanded_key_3", "expanded_content_row_1\n\nexpanded_content_row_2");
+
+                debug(logPath, null);
+            }
+
+            // Disk is exhausted, send crash report immediately.
+            //sendThenDeleteCrashLog(logPath, emergency);
+
+            //非debug版本上传crash日志
+            if (!BuildConfig.DEBUG) {
+                uploadCrashLog(logPath);
+            } else {
+                restartApp();
+            }
+        }
+    };
+
+    //ANR Catcher
+    private final ICrashCallback anrCallback = new ICrashCallback() {
+        @Override
+        public void onCrash(String logPath, String emergency) {
+            Log.d(TAG, "log path: " + (logPath != null ? logPath : "(null)") + ", emergency: " + (emergency != null ? emergency : "(null)"));
+
+            /*if (emergency != null) {
+                debug(logPath, emergency);
+
+                // Disk is exhausted, send crash report immediately.
+                //sendThenDeleteCrashLog(logPath, emergency);
+            } else {
+                // Add some expanded sections. Send crash report at the next time APP startup.
+
+                // OK
+                TombstoneManager.appendSection(logPath, "expanded_key_1", "expanded_content");
+                TombstoneManager.appendSection(logPath, "expanded_key_2", "expanded_content_row_1\nexpanded_content_row_2");
+
+                // Invalid. (Do NOT include multiple consecutive newline characters ("\n\n") in the content string.)
+                // TombstoneManager.appendSection(logPath, "expanded_key_3", "expanded_content_row_1\n\nexpanded_content_row_2");
+
+                debug(logPath, null);
+            }*/
+
+            if ("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) {
+                AppUpdateHelper.reboot(app);
+            } else {
+                restartApp();
+            }
+        }
+    };
+
+    public void init(Application application) {
+        Log.d(TAG, "xCrash SDK init: start");
+        app = application;
+
+        // Initialize xCrash.
+        XCrash.init(application, new XCrash.InitParameters()
+                .setAppVersion(BuildConfig.VERSION_NAME)
+                .setJavaRethrow(true)
+                .setJavaLogCountMax(10)
+                .setJavaDumpAllThreadsWhiteList(new String[]{"^main$", "^Binder:.*", ".*Finalizer.*"})
+                .setJavaDumpAllThreadsCountMax(10)
+                .setJavaCallback(callback)
+                .setNativeRethrow(true)
+                .setNativeLogCountMax(10)
+                .setNativeDumpAllThreadsWhiteList(new String[]{"^xcrash\\.sample$", "^Signal Catcher$", "^Jit thread pool$", ".*(R|r)ender.*", ".*Chrome.*"})
+                .setNativeDumpAllThreadsCountMax(10)
+                .setNativeCallback(callback)
+                .setAnrRethrow(true)
+                .setAnrLogCountMax(10)
+                .setAnrCallback(anrCallback)
+                .setPlaceholderCountMax(3)
+                .setPlaceholderSizeKb(512)
+                .setLogDir(application.getExternalFilesDir("xcrash").toString())
+                .setLogFileMaintainDelayMs(5000));
+    }
+
+    private void uploadCrashLog(String path) {
+        final File logFile = new File(path);
+        if (logFile.exists()) {
+            final UrlManager urlManager = UrlManager.Companion.build();
+            String url = urlManager.getBuyer() + "ncs/upload/file";
+            HttpHelper.upload(url, logFile, TAG, new HttpHelper.UploadCallback() {
+                @Override
+                public void onFail() {
+                    Log.e(TAG,"错误日志文件上传失败!");
+                    restartApp();
+                }
+
+                @Override
+                public void onSuccess(String data) {
+                    Log.e(TAG,"错误日志文件上传成功!" + data);
+                    sendThenDeleteCrashLog(urlManager.getBuyer() + data, null);
+                    //删除日志文件
+                    //logFile.delete();
+                }
+            });
+        }
+    }
+
+    private void sendThenDeleteCrashLog(final String logPath, String emergency) {
+        try {
+            // Parse
+            //Map<String, String> map = TombstoneParser.parse(logPath, emergency);
+            //String crashReport = new JSONObject(map).toString();
+
+            if(okHttpClient == null){
+                okHttpClient = new OkHttpClient();
+            }
+
+            FormBody.Builder formBody = new FormBody.Builder();
+            formBody.add("class_name", app.getPackageName());
+            formBody.add("method_name", "");
+            formBody.add("exception_name", "");
+            formBody.add("err_msg", "");
+            formBody.add("stack_trace", logPath);
+
+            UrlManager urlManager = UrlManager.Companion.build();
+            Request request  = new Request.Builder()
+                    .url(urlManager.getBuyer() + "device/error_log")
+                    .post(formBody.build())
+                    .build();
+
+            okHttpClient.newCall(request).enqueue(new Callback() {
+                @Override
+                public void onFailure(Call call, IOException e) {
+                    Log.e(TAG,"错误日志名称上传失败"+e.getMessage());
+                    restartApp();
+                }
+
+                @Override
+                public void onResponse(Call call, Response response) throws IOException {
+                    Log.d(TAG,"错误日志名称上传成功");
+                    TombstoneManager.deleteTombstone(logPath);
+                    //String data = response.body().string();
+                    //Log.d(TAG,"错误日志数据 data "+data);
+                    restartApp();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        // Send the crash report to server-side.
+        // ......
+
+        // If the server-side receives successfully, delete the log file.
+        //
+        // Note: When you use the placeholder file feature,
+        //       please always use this method to delete tombstone files.
+        //
+        //TombstoneManager.deleteTombstone(logPath);
+    }
+
+    private void debug(String logPath, String emergency) {
+        // Parse and save the crash info to a JSON file for debugging.
+        FileWriter writer = null;
+        try {
+            File debug = new File(XCrash.getLogDir() + "/debug.json");
+            debug.createNewFile();
+            writer = new FileWriter(debug, false);
+            writer.write(new JSONObject(TombstoneParser.parse(logPath, emergency)).toString());
+        } catch (Exception e) {
+            Log.d(TAG, "debug failed", e);
+        } finally {
+            if (writer != null) {
+                try {
+                    writer.close();
+                } catch (Exception ignored) {
+                }
+            }
+        }
+    }
+
+    private void restartApp() {
+        //重新启动app
+        Intent mStartActivity = new Intent(app.getApplicationContext(), WelcomeActivity.class);
+        mStartActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        int mPendingIntentId = 123456;
+        PendingIntent mPendingIntent = PendingIntent.getActivity(app.getApplicationContext(), mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
+        AlarmManager mgr = (AlarmManager) app.getApplicationContext().getSystemService(Context.ALARM_SERVICE);
+        mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 2000, mPendingIntent);
+
+        android.os.Process.killProcess(android.os.Process.myPid());
+        System.exit(0);
+    }
+
+}

+ 20 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/launch/CallingdoorLaunch.kt

@@ -0,0 +1,20 @@
+package com.wdkl.app.ncs.callingdoor.launch
+
+import com.enation.javashop.android.jrouter.external.annotation.Router
+import com.wdkl.app.ncs.callingdoor.di.CallingdoorComponent
+import com.wdkl.app.ncs.callingdoor.di.DaggerCallingdoorComponent
+import com.wdkl.ncs.android.lib.base.BaseLaunch
+import com.wdkl.ncs.android.middleware.di.DaggerManager
+
+@Router(path = "/callingdoor/launch")
+class CallingdoorLaunch :BaseLaunch() {
+    companion object {
+        lateinit var component:CallingdoorComponent
+    }
+
+    override fun moduleInit() {
+        component = DaggerCallingdoorComponent.builder()
+                .applicationComponent(DaggerManager.APPLICATION_COMPONENT)
+                .build()
+    }
+}

+ 362 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/settings/SettingConfig.java

@@ -0,0 +1,362 @@
+package com.wdkl.app.ncs.callingdoor.settings;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+
+public class SettingConfig {
+
+    private static final String SP_NAME = "SP_DOOR_FUNCTION";
+
+    //白昼设置白天的初始时间设置
+    private static final String KEY_SP_INITIAL_DAY_TIME = "KEY_SP_INITIAL_DAY_TIME";
+    private static final String initial_day_time = "07:00";
+    private static final String KEY_SP_INITIAL_DAY_TIME_LOCATION = "KEY_SP_INITIAL_DAY_TIME_LOCATION";
+    private static final String initial_day_time_location = "12";
+
+
+    //白昼设置白天的结束时间设置
+    private static final String KEY_SP_END_OF_DAY = "KEY_SP_END_OF_DAY";
+    private static final String end_of_day = "19:00";
+    //白昼设置白天的结束时间设置
+    private static final String KEY_SP_END_OF_DAY_LOCATION = "KEY_SP_END_OF_DAY_LOCATION";
+    private static final String end_of_day_location = "38";
+
+    //白天亮度
+    private static final String KEY_SP_DAYTIME_BRIGHTNESS = "KEY_SP_DAYTIME_BRIGHTNESS";
+    private static final int daytime_brightness = 80;
+    //晚上亮度
+    private static final String KEY_SP_NIGHT_BRIGHTNESS = "KEY_SP_NIGHT_BRIGHTNESS";
+    private static final int night_brightness = 50;
+
+    //门口机白天系统音量
+    private static final String KEY_SP_DOOR_DAYTIME_SYSTEM_VOLUME = "KEY_SP_DOOR_DAYTIME_SYSTEM_VOLUME";
+    private static final int door_daytime_system_volume = 100;
+    //门口机晚上系统音量
+    private static final String KEY_SP_DOOR_NIGHT_SYSTEM_VOLUME = "KEY_SP_DOOR_NIGHT_SYSTEM_VOLUME";
+    private static final int door_night_system_volume = 70;
+
+    //门口机通话音量
+    private static final String KEY_SP_DOOR_CALL_VOLUME = "KEY_SP_DOOR_CALL_VOLUME";
+    private static final int door_call_volume = 80;
+
+
+    //呼叫超时时间
+    private static final String KEY_SP_SIP_OVERTIME = "KEY_SP_SIP_OVERTIME";
+    private static final int sip_over_time = 30;
+
+    //息屏超时时间
+    private static final String KEY_SP_SLEEP_TIME = "KEY_SP_SLEEP_TIME";
+    private static final int sleep_time = 30;
+
+    //网络异常重启次数
+    private static final String KEY_SP_NET_ERR_RESET_COUNT = "KEY_SP_NET_ERR_RESET_COUNT";
+
+    //app上次启动时间
+    private static final String KEY_SP_APP_START_TIME = "KEY_SP_APP_START_TIME";
+
+    //默认语言
+    private static final String KEY_LANGUAGE_ID = "KEY_LANGUAGE_ID";
+    private static final String KEY_LANGUAGE_MODE = "KEY_LANGUAGE_MODE";
+
+    //护理状态
+    private static final String KEY_IN_NURSING = "KEY_IN_NURSING";
+    private static final String KEY_NURSING_ID = "KEY_NURSING_ID";
+
+    //呼叫时门灯是否持续亮,需要手动按护理按键切换
+    private static final String KEY_DOOR_LIGHT_ALWAYS_ON = "KEY_DOOR_LIGHT_ALWAYS_ON";
+
+    public static int getLanguageId(Context context) {
+        //0--auto, 1--English, 2--中文, 3--西班牙语, 4--俄语
+        return getSP(context).getInt(KEY_LANGUAGE_ID, 3);
+    }
+
+    public static void setLanguageId(Context context, int id) {
+        getEditor(context).putInt(KEY_LANGUAGE_ID, id).apply();
+    }
+
+    //0:同步服务器设置, 1:手动设置
+    public static int getLanguageMode(Context context) {
+        return getSP(context).getInt(KEY_LANGUAGE_MODE, 1);
+    }
+
+    public static void setLanguageMode(Context context, int mode) {
+        getEditor(context).putInt(KEY_LANGUAGE_MODE, mode).apply();
+    }
+
+    public static boolean getInNursing(Context context) {
+        return getSP(context).getBoolean(KEY_IN_NURSING, false);
+    }
+
+    public static void setInNursing(Context context, boolean nursing) {
+        getEditor(context).putBoolean(KEY_IN_NURSING, nursing).apply();
+    }
+
+    public static int getNursingId(Context context) {
+        return getSP(context).getInt(KEY_NURSING_ID, -1);
+    }
+
+    public static void setNursingId(Context context, int nursingId) {
+        getEditor(context).putInt(KEY_NURSING_ID, nursingId).apply();
+    }
+
+    public static int getDoorLightAlwaysOn(Context context) {
+        return getSP(context).getInt(KEY_DOOR_LIGHT_ALWAYS_ON, 0);
+    }
+
+    public static void setDoorLightAlwaysOn(Context context, int alwaysOn) {
+        getEditor(context).putInt(KEY_DOOR_LIGHT_ALWAYS_ON, alwaysOn).apply();
+    }
+
+    /**
+     * 获取白天亮度
+     *
+     * @return
+     */
+    public static int getDaytimeBrightness(Context context) {
+        return getSP(context).getInt(KEY_SP_DAYTIME_BRIGHTNESS, daytime_brightness);
+    }
+
+    /**
+     * 设置白天亮度
+     *
+     * @param value
+     */
+    public static void setDaytimeBrightness(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_DAYTIME_BRIGHTNESS, value).apply();
+    }
+
+    /**
+     * 获取晚上亮度
+     *
+     * @return
+     */
+    public static int getNightBrightness(Context context) {
+        return getSP(context).getInt(KEY_SP_NIGHT_BRIGHTNESS, night_brightness);
+    }
+
+    /**
+     * 设置晚上亮度
+     *
+     * @param value
+     */
+    public static void setNightBrightness(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_NIGHT_BRIGHTNESS, value).apply();
+    }
+
+    /**
+     * 获取门口机白天系统音量
+     *
+     * @return
+     */
+    public static int getDoorDaytimeSystemVolume(Context context) {
+        return getSP(context).getInt(KEY_SP_DOOR_DAYTIME_SYSTEM_VOLUME, door_daytime_system_volume);
+    }
+
+    /**
+     * 设置门口机白天系统音量
+     *
+     * @param value
+     */
+    public static void setDoorDaytimeSystemVolume(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_DOOR_DAYTIME_SYSTEM_VOLUME, value).apply();
+    }
+
+    /**
+     * 获取门口机晚上系统音量
+     *
+     * @return
+     */
+    public static int getDoorNightSystemVolume(Context context) {
+        return getSP(context).getInt(KEY_SP_DOOR_NIGHT_SYSTEM_VOLUME, door_night_system_volume);
+    }
+
+    /**
+     * 设置门口机晚上系统音量
+     *
+     * @param value
+     */
+    public static void setDoorNightSystemVolume(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_DOOR_NIGHT_SYSTEM_VOLUME, value).apply();
+    }
+
+
+    /**
+     * 获取门口机通话音量
+     *
+     * @return
+     */
+    public static int getExtensionCallVolume(Context context) {
+        return getSP(context).getInt(KEY_SP_DOOR_CALL_VOLUME, door_call_volume);
+    }
+
+    /**
+     * 设置门口机通话音量
+     *
+     * @param value
+     */
+    public static void setExtensionCallVolume(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_DOOR_CALL_VOLUME, value).apply();
+    }
+
+
+    /**
+     * 获取白昼设置白天的初始时间
+     *
+     * @return
+     */
+    public static String getInitialDayTime(Context context) {
+        return getSP(context).getString(KEY_SP_INITIAL_DAY_TIME, initial_day_time);
+    }
+
+    /**
+     * 设置白昼白天的初始时间
+     *
+     * @param value
+     */
+    public static void setInitialDayTime(Context context, String value) {
+        getEditor(context).putString(KEY_SP_INITIAL_DAY_TIME, value).apply();
+    }
+
+    /**
+     * 获取白昼设置白天的初始时间位置
+     *
+     * @return
+     */
+    public static String getInitialDayTimeLocation(Context context) {
+        return getSP(context).getString(KEY_SP_INITIAL_DAY_TIME_LOCATION, initial_day_time_location);
+    }
+
+    /**
+     * 设置白昼白天的初始时间位置
+     *
+     * @param value
+     */
+    public static void setInitialDayTimeLocation(Context context, String value) {
+        getEditor(context).putString(KEY_SP_INITIAL_DAY_TIME_LOCATION, value).apply();
+    }
+
+
+
+    /**
+     * 设置白昼白天的结束时间
+     *
+     * @param value
+     */
+    public static void setEndOfDay(Context context, String value) {
+        getEditor(context).putString(KEY_SP_END_OF_DAY, value).apply();
+    }
+
+    /**
+     * 获取白昼设置白天的结束时间
+     *
+     * @return
+     */
+    public static String getEndOfDay(Context context) {
+        return getSP(context).getString(KEY_SP_END_OF_DAY, end_of_day);
+    }
+
+    /**
+     * 设置白昼白天的结束时间位置
+     *
+     * @param value
+     */
+    public static void setEndOfDayLocation(Context context, String value) {
+        getEditor(context).putString(KEY_SP_END_OF_DAY_LOCATION, value).apply();
+    }
+
+    /**
+     * 获取白昼设置白天的结束时间位置
+     *
+     * @return
+     */
+    public static String getEndOfDayLocation(Context context) {
+        return getSP(context).getString(KEY_SP_END_OF_DAY_LOCATION, end_of_day_location);
+    }
+
+    /**
+     * 设置呼叫超时时间
+     *
+     * @param value
+     */
+    public static void setSipOverTime(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_SIP_OVERTIME, value).apply();
+    }
+
+    /**
+     * 获取呼叫超时时间
+     *
+     * @return
+     */
+    public static int getSipOverTime(Context context) {
+        return getSP(context).getInt(KEY_SP_SIP_OVERTIME, sip_over_time);
+    }
+
+    /**
+     * 设置息屏时间
+     *
+     * @param value
+     */
+    public static void setSleepTime(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_SLEEP_TIME, value).apply();
+    }
+
+    /**
+     * 获取息屏时间
+     *
+     * @return
+     */
+    public static int getSleepTime(Context context) {
+        return getSP(context).getInt(KEY_SP_SLEEP_TIME, sleep_time);
+    }
+
+    /**
+     * 获取网络异常重启次数
+     *
+     * @return
+     */
+    public static int getNetErrResetCount(Context context) {
+        return getSP(context).getInt(KEY_SP_NET_ERR_RESET_COUNT, 0);
+    }
+
+    /**
+     * 设置网络异常重启次数
+     *
+     * @param value
+     */
+    public static void setNetErrResetCount(Context context, int value) {
+        getEditor(context).putInt(KEY_SP_NET_ERR_RESET_COUNT, value).apply();
+    }
+
+    /**
+     * 设置App启动时间
+     *
+     * @param value
+     */
+    public static void setAppStartTime(Context context, String value) {
+        getEditor(context).putString(KEY_SP_APP_START_TIME, value).apply();
+    }
+
+    /**
+     * 获取App启动时间
+     *
+     * @return
+     */
+    public static String getAppStartTime(Context context) {
+        return getSP(context).getString(KEY_SP_APP_START_TIME, "Unknow");
+    }
+
+
+
+
+
+    private static SharedPreferences getSP(Context context) {
+        return context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
+    }
+
+    private static SharedPreferences.Editor getEditor(Context context) {
+        return getSP(context).edit();
+    }
+
+
+}

+ 579 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/sip/SipHelper.java.bak

@@ -0,0 +1,579 @@
+package com.wdkl.app.ncs.callingbed2.sip;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.ActivityManager;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.CountDownTimer;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.util.Log;
+
+import com.vvsip.ansip.IVvsipService;
+import com.vvsip.ansip.IVvsipServiceListener;
+import com.vvsip.ansip.VvsipCall;
+import com.vvsip.ansip.VvsipService;
+import com.vvsip.ansip.VvsipServiceBinder;
+import com.vvsip.ansip.VvsipTask;
+import com.wdkl.app.ncs.callingbed2.common.MessageEvent;
+import com.wdkl.app.ncs.callingbed2.helper.NetHelper;
+
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.wdkl.app.ncs.callingbed2.common.Constant.EVENT_SIP_REGISTER_STATUS;
+import static com.wdkl.app.ncs.callingbed2.sip.SipStatus.REGISTERCOM;
+import static com.wdkl.app.ncs.callingbed2.sip.SipStatus.REGISTERFAIL;
+import static com.wdkl.app.ncs.callingbed2.sip.SipStatus.REGISTERING;
+import static com.vvsip.ansip.VvsipTask.EXOSIP_CALL_CLOSED;
+
+
+public class SipHelper {
+
+    private final static String SIP_IP_END = ":5060";
+
+    private static String sipIP = "";
+    private static String sipID = "";
+    private static String sipPWD = "";
+
+    /**
+     * Sip启动注册.
+     */
+    protected int mSipRegisterTime = 5000;
+    private Handler sipRegisterHandler = null;
+    private Runnable sipRegisterRunnable = null;
+
+    /**
+     * SIP信息
+     */
+    public static final String SipInfoTag = "SipInfo";
+    /**
+     * 电话呼叫对象
+     */
+    private List<VvsipCall> mVvsipCalls = null;
+
+
+    private static SipHelper sipHelper;
+
+    public Handler getSipRegisterHandler() {
+        return sipRegisterHandler;
+    }
+
+    public Runnable getSipRegisterRunnable() {
+        return sipRegisterRunnable;
+    }
+
+    public List<VvsipCall> getmVvsipCalls() {
+        return mVvsipCalls;
+    }
+
+    private IVvsipServiceListener sipListner;
+
+
+    private Context mContext;
+
+    public static SipHelper getInstance() {
+        if (sipHelper == null) {
+            synchronized (SipHelper.class) {
+                if (sipHelper == null) {
+                    sipHelper = new SipHelper();
+                }
+            }
+        }
+        return sipHelper;
+    }
+
+    /**
+     * Instantiates a new Sip register util.
+     */
+    private SipHelper() {
+        if (mVvsipCalls == null) {
+            mVvsipCalls = new ArrayList<VvsipCall>();
+        }
+
+        // Runnable exiting the splash screen and launching the menu
+        sipRegisterRunnable = new Runnable() {
+            public void run() {
+                isSuccessRegisterSip();
+            }
+        };
+
+        // Run the exitRunnable in in mSipRegisterTime ms
+        sipRegisterHandler = new Handler();
+
+        IVvsipService sipservice = VvsipService.getService();
+        if (sipservice != null) {
+            sipRegisterHandler.postDelayed(sipRegisterRunnable, 3000);
+            return;
+        }
+        sipRegisterHandler.postDelayed(sipRegisterRunnable, mSipRegisterTime);
+    }
+
+    public void initSip(Context context, String ip, String id, String pwd) {
+        mContext = context;
+        sipIP = ip;
+        sipID = id;
+        sipPWD = pwd;
+    }
+
+    public void setSipListner(IVvsipServiceListener listner) {
+        sipListner = listner;
+    }
+
+    /*public void addSipListner(IVvsipServiceListener listner) {
+        IVvsipService sipService = VvsipService.getService();
+        if (sipService != null && listner != null) {
+            sipService.addListener(listner);
+            Log.d("sip", "add sip listner");
+        }
+    }
+
+    public void removeSipListner(IVvsipServiceListener listner) {
+        IVvsipService sipService = VvsipService.getService();
+        if (sipService != null && listner != null) {
+            sipService.removeListener(listner);
+            Log.d("sip", "remove sip listner");
+        }
+    }*/
+
+    /**
+     * 检测Sip服务是否注册成功
+     */
+    public void isSuccessRegisterSip() {
+        VvsipTask vvsipTask = VvsipTask.getVvsipTask();
+        if (vvsipTask != null && VvsipTask.global_failure != 0) {
+            /**
+             * ==================================sip服务启动失败 ================================
+             */
+        }
+    }
+
+    /**
+     * 注销Sip服务
+     */
+    public void unRegisterSip() {
+        //LogUtil.i(SipInfoTag, "lifecycle // onDestroy");
+
+        IVvsipService sipservice = VvsipService.getService();
+        if (sipservice != null && sipListner != null) {
+            sipservice.removeListener(sipListner);
+        }
+
+        getSipServiceStartHandler().removeCallbacks(getSipServiceStartRunnable());
+        sipRegisterHandler.removeCallbacks(sipRegisterRunnable);
+        if (getSipServiceConnection() != null && isRegister) {
+            try {
+                mContext.unbindService(getSipServiceConnection());
+                setSipServiceConnection(null);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (mVvsipCalls != null) {
+            mVvsipCalls.clear();
+            mVvsipCalls = null;
+        }
+
+        //Log.i(SipInfoTag, "lifecycle // onDestroy");
+    }
+
+    public static String sipStatus = "";
+
+    /**
+     * Sip信息获取
+     */
+    public void obtainSipInfo() {
+        if (sipStatus.equals(REGISTERCOM) && NetHelper.NetConn) {//sip注册成功并且以太网连上
+            return;
+        }
+        IVvsipService sipService = VvsipService.getService();
+        if (sipService != null && sipListner != null) {
+            //sipService.addListener(sipListner);
+            sipService.setMessageHandler(messageHandler);
+        } else {
+            //LogUtil.i(SipInfoTag, "lifecycle // _service==null");
+        }
+        sipRegister();
+        failUiRefreshSip();
+    }
+
+    private void failUiRefreshSip() {
+        if (!NetHelper.NetConn) {
+            sipStatus = REGISTERFAIL;
+            EventBus.getDefault().post(new MessageEvent(REGISTERFAIL, EVENT_SIP_REGISTER_STATUS));
+            if (mSipThread != null) {
+                mSipThread.interrupt();
+                mSipThread = null;
+            }
+            //LogUtil.e(SipInfoTag, "以太网断开,SIP UI状态刷新为失败");
+        }
+    }
+
+
+    /**
+     * Sip信息
+     */
+    private String sipinfo = "";
+    private static int handleCount = 0;
+    //Sip註冊次數
+    private CountDownTimer mCountDownAutoTimer;
+    @SuppressLint("HandlerLeak")
+    private Handler messageHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            //LogUtil.i("QASE", "handleMessage==" + " msg.obj==" + msg.obj.toString() + " msg.what==" + msg.what);
+            //LogUtil.i(SipInfoTag, "#" + msg.obj);
+            sipinfo = "" + msg.obj + sipinfo;
+            //LogUtil.i(SipInfoTag, "Sip信息" + sipinfo);
+
+            if (msg.what == 22) {//释放资源
+                //EventBus.getDefault().post(new MessageEvent(msg.what, EVENT_SIP_REGISTER_STATUS));
+            }
+
+            if (sipinfo.contains("200 OK")) {//注册成功
+                sipStatus = REGISTERCOM;
+                EventBus.getDefault().post(new MessageEvent(REGISTERCOM, EVENT_SIP_REGISTER_STATUS));
+                if (mSipThread != null) {
+                    mSipThread.interrupt();
+                    mSipThread = null;
+                }
+                if (msg.obj.toString().contains("408")) {//超时
+                    sipStatus = REGISTERFAIL;
+                    EventBus.getDefault().post(new MessageEvent(REGISTERFAIL, EVENT_SIP_REGISTER_STATUS));
+                    sipRegister();
+                }
+            } else {//注册失败
+                sipStatus = REGISTERFAIL;
+                EventBus.getDefault().post(new MessageEvent(REGISTERFAIL, EVENT_SIP_REGISTER_STATUS));
+                if (mSipThread != null) {
+                    mSipThread.interrupt();
+                    mSipThread = null;
+                }
+                sipRegister();
+            }
+            failUiRefreshSip();
+
+            if (msg.obj.toString().contains("autocall")) {
+                VvsipCall pCall = null;
+                //LogUtil.e(SipInfoTag, "onClick1");
+                for (VvsipCall _pCall : mVvsipCalls) {
+                    if (_pCall.cid > 0)
+                        //LogUtil.e(SipInfoTag, "state#" + _pCall.mState);
+                        if (_pCall.cid > 0 && _pCall.mState <= 2) {
+                            pCall = _pCall;
+                            break;
+                        }
+                }
+                //LogUtil.e(SipInfoTag, "onClick2");
+                if (pCall == null)
+                    return;
+                //LogUtil.e(SipInfoTag, "onClick3#" + pCall.mState);
+                IVvsipService _service = VvsipService.getService();
+                if (_service == null)
+                    return;
+                VvsipTask _vvsipTask = _service.getVvsipTask();
+                if (_vvsipTask == null)
+                    return;
+                pCall.stop();
+                _service.setSpeakerModeOff();
+            }
+        }
+    };
+
+    /**
+     * ====================Sip注册======================
+     */
+    private Thread mSipThread;
+
+    private static class SipThread extends Thread {
+        WeakReference<Activity> mThreadCallingBedActivity;
+
+        private SipThread(Activity activity) {
+            mThreadCallingBedActivity = new WeakReference<Activity>(activity);
+        }
+
+        @Override
+        public void run() {
+            super.run();
+            if (mThreadCallingBedActivity == null)
+                return;
+            if (mThreadCallingBedActivity.get() != null) {
+                IVvsipService sipService = VvsipService.getService();
+                try {
+                    if (sipService != null && !SipHelper.getInstance().sipinfo.contains("200 OK") && NetHelper.NetConn) {
+                        sipStatus = REGISTERING;
+                        EventBus.getDefault().post(new MessageEvent(REGISTERING, EVENT_SIP_REGISTER_STATUS));
+                        sipService.register(sipIP + SIP_IP_END, sipID, sipPWD);
+                        handleCount++;
+                        Log.e(SipInfoTag, "以太网连接,SIP UI状态刷新为注册中");
+                    } else if (sipService != null && SipHelper.getInstance().sipinfo.contains("200 OK")) {
+                        sipStatus = REGISTERCOM;
+                        EventBus.getDefault().post(new MessageEvent(REGISTERCOM, EVENT_SIP_REGISTER_STATUS));
+                    }
+                } catch (NullPointerException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    private void sipRegister() {
+        synchronized (this) {
+            mSipThread = new SipThread((Activity) mContext);
+            if (handleCount < 3) {
+                if (mCountDownAutoTimer == null) {
+                    mCountDownAutoTimer = new CountDownTimer(10000, 1000) {
+                        @Override
+                        public void onTick(long l) {
+                        }
+
+                        @Override
+                        public void onFinish() {
+                            handleCount = 0;
+                            if (mSipThread != null) {
+                                mSipThread.start();
+                            }
+                            if (mCountDownAutoTimer != null) {
+                                mCountDownAutoTimer.cancel();
+                                mCountDownAutoTimer = null;
+                            }
+                        }
+                    };
+                    mCountDownAutoTimer.start();
+                }
+                return;
+            } else {
+                if (mCountDownAutoTimer != null) {
+                    mCountDownAutoTimer.cancel();
+                    mCountDownAutoTimer = null;
+                }
+            }
+            if (handleCount == 0) {
+                mSipThread.start();
+            }
+        }
+    }
+
+
+    public void setmSipThread(Thread mSipThread) {
+        this.mSipThread = mSipThread;
+    }
+
+    public Thread getmSipThread() {
+        return mSipThread;
+    }
+
+    /**
+     * 开始通话
+     */
+    public void startCall(String sipUseName) {
+        IVvsipService sipService = VvsipService.getService();
+        if (sipService == null) return;
+        //----------------------------------------------携带呼叫列表转接床头机的Mac地址--------------------------------------------------//
+        sipService.initiateOutgoingCall(sipUseName, "");
+    }
+
+    /**
+     * 结束通话
+     */
+    public void endCall() {
+        VvsipCall call = null;
+        for (VvsipCall pCall : mVvsipCalls) {
+            if (pCall.cid > 0 && pCall.mState <= 2) {
+                call = pCall;
+                break;
+            }
+        }
+        if (call == null) return;
+        IVvsipService sipService = VvsipService.getService();
+        if (sipService == null) return;
+        VvsipTask sipTask = sipService.getVvsipTask();
+        if (sipTask == null) return;
+        VvsipService.getService().mainEndCall(EXOSIP_CALL_CLOSED);
+        call.stop();
+        sipService.setSpeakerModeOff();
+        sipService.stopPlayer();
+        sipService.setAudioNormalMode();
+    }
+
+    /**
+     * 添加一个电话呼叫对象
+     *
+     * @param call
+     */
+    public void addCallObject(final VvsipCall call) {
+        try {
+            if (call == null) {
+                return;
+            }
+
+            if (mVvsipCalls == null)
+                return;
+            mVvsipCalls.add(call);
+        } catch (Exception e) {
+            //LogUtil.e(SipInfoTag, "onNewVvsipCallEvent: " + e);
+        }
+    }
+
+    /**
+     * 移除一个电话呼叫对象
+     *
+     * @param call
+     */
+    public void removeCallObject(final VvsipCall call) {
+        try {
+            if (call == null) {
+                return;
+            }
+
+            // 4 crash detected here for 4.0.9 with mVvsipCalls=NULL
+            if (mVvsipCalls == null)
+                return;
+            mVvsipCalls.remove(call);
+        } catch (Exception e) {
+            //Log.e(SipInfoTag, "onRemoveVvsipCallEvent: " + e);
+        }
+    }
+
+    /**
+     * 自动接电话
+     */
+    public void autoTalking() {
+        if (mVvsipCalls == null) {
+            mVvsipCalls = new ArrayList<VvsipCall>();
+        }
+        for (VvsipCall _pCall : mVvsipCalls) {
+            if (_pCall.cid > 0 && _pCall.mState < 2 && _pCall.mIncomingCall) {
+                // ANSWER EXISTING CALL
+                int i = _pCall.answer(200, 1);
+              //LogUtil.d(SipInfoTag, "ANSWER EXISTING CALL");
+                IVvsipService _service = VvsipService.getService();
+                if (_service != null) {
+                    if (i >= 0) {
+                        _service.stopPlayer();
+                        _service.setSpeakerModeOff();
+                        _service.setAudioInCallMode();
+                    }
+                }
+                break;
+            }
+        }
+    }
+
+    public static boolean isServiceRunning(Context context, String className) {
+        boolean isRunning = false;
+        ActivityManager activityManager = (ActivityManager) context
+                .getSystemService(Context.ACTIVITY_SERVICE);
+        List<ActivityManager.RunningServiceInfo> serviceList = activityManager
+                .getRunningServices(30);
+
+        if (!(serviceList.size() > 0)) {
+            return false;
+        }
+
+        for (int i = 0; i < serviceList.size(); i++) {
+            if (serviceList.get(i).service.getClassName().equals(className) == true) {
+                isRunning = true;
+                break;
+            }
+        }
+        return isRunning;
+    }
+
+    /**
+     * #############################
+     * <p>
+     * Sip启动服务.
+     * <p>
+     * #############################
+     */
+    private static Handler sipServiceStartHandler = null;
+    private static Runnable sipServiceStartRunnable = null;
+    private static ServiceConnection sipServiceConnection;
+
+    public static Runnable getSipServiceStartRunnable() {
+        return sipServiceStartRunnable;
+    }
+
+    public static Handler getSipServiceStartHandler() {
+        return sipServiceStartHandler;
+    }
+
+    public static ServiceConnection getSipServiceConnection() {
+        return sipServiceConnection;
+    }
+
+    public static void setSipServiceConnection(ServiceConnection sipServiceConnections) {
+        sipServiceConnection = sipServiceConnections;
+    }
+
+    /**
+     * 启动服务
+     */
+    public static Boolean isRegister = false;//是否注册
+
+    public void sipStartService() {
+        sipServiceStartHandler = new Handler();
+
+        sipServiceStartRunnable = new Runnable() {
+            public void run() {
+                if (mContext == null) {
+                    sipServiceStartHandler.postDelayed(sipServiceStartRunnable, 1000);
+                    return;
+                }
+                Intent intent = new Intent(mContext.getApplicationContext(), VvsipService.class);
+                mContext.startService(intent);
+
+                sipServiceConnection = new ServiceConnection() {
+                    public void onServiceConnected(ComponentName name, IBinder service) {
+                        IVvsipService sipservice = ((VvsipServiceBinder) service).getService();
+                        if (sipservice != null && sipListner != null) {
+                            //LogUtil.i(SipInfoTag, "Connected!");
+                            sipservice.addListener(sipListner);
+                            SipHelper.getInstance().obtainSipInfo();//Sip信息获取
+                        }
+                    }
+
+                    public void onServiceDisconnected(ComponentName name) {
+                        //LogUtil.i(SipInfoTag, "Disconnected!");
+                    }
+                };
+
+                isRegister = mContext.bindService(intent, sipServiceConnection, Context.BIND_AUTO_CREATE);
+            }
+        };
+
+        sipServiceStartHandler.postDelayed(sipServiceStartRunnable, 0);
+    }
+
+    /**
+     * 用来解析错误代码
+     */
+    public static String analyseErrorCode(String errorCode) {
+        switch (errorCode) {
+            case "200":
+                return "成功";
+            case "408":
+                return "请求超时";
+            case "400":
+                return "服务器不支持请求的语法";
+            case "401":
+                return "未授权";
+            case "403":
+                return "服务器禁止请求";
+            case "404":
+                return "服务器找不到";
+            default:
+                return "未知错误";
+        }
+    }
+
+}

+ 17 - 0
android_door/src/main/h10_a133_chile/java/com/wdkl/app/ncs/callingdoor/sip/SipStatus.java.bak

@@ -0,0 +1,17 @@
+package com.wdkl.app.ncs.callingbed2.sip;
+
+public class SipStatus {
+    /**
+     * 注册中
+     */
+    public static final String REGISTERING = "register_ing";
+    /**
+     * 注册失败
+     */
+    public static final String REGISTERFAIL = "register_fail";
+    /**
+     * 注册完成
+     */
+    public static final String REGISTERCOM = "register_com";
+
+}

+ 7 - 0
android_door/src/main/h10_a133_chile/res/anim/slide_down_in.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:fromYDelta="100%p"
+        android:toYDelta="0%p"
+        android:duration="300"/>
+</set>

+ 7 - 0
android_door/src/main/h10_a133_chile/res/anim/slide_left_in.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:fromXDelta="-100%p"
+        android:toXDelta="0%p"
+        android:duration="300"/>
+</set>

+ 7 - 0
android_door/src/main/h10_a133_chile/res/anim/slide_right_out.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:fromXDelta="0%p"
+        android:toXDelta="100%p"
+        android:duration="300"/>
+</set>

+ 7 - 0
android_door/src/main/h10_a133_chile/res/anim/slide_up_out.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:fromYDelta="0%p"
+        android:toYDelta="-100%p"
+        android:duration="300"/>
+</set>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 34 - 0
android_door/src/main/h10_a133_chile/res/drawable-v24/ic_launcher_foreground.xml


BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_answer.png


BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_answer_normal.png


BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_answer_press.png


+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/ic_door_launch.xml

@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#2F9DF1"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M19,5L5,5c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7c0,-1.1 -0.9,-2 -2,-2zM19,17L5,17L5,7h14v10z"/>
+</vector>

BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_hangup.png


BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_hangup_normal.png


BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_hangup_press.png


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/ic_language.xml


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/ic_language2.xml


+ 170 - 0
android_door/src/main/h10_a133_chile/res/drawable/ic_launcher_background.xml

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path
+        android:fillColor="#008577"
+        android:pathData="M0,0h108v108h-108z" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M9,0L9,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,0L19,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,0L29,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,0L39,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,0L49,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,0L59,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,0L69,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,0L79,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M89,0L89,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M99,0L99,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,9L108,9"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,19L108,19"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,29L108,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,39L108,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,49L108,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,59L108,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,69L108,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,79L108,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,89L108,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,99L108,99"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,29L89,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,39L89,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,49L89,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,59L89,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,69L89,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,79L89,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,19L29,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,19L39,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,19L49,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,19L59,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,19L69,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,19L79,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+</vector>

BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_nurse.png


BIN
android_door/src/main/h10_a133_chile/res/drawable/ic_nurse_call.png


+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/ic_nursing.xml

@@ -0,0 +1,5 @@
+<vector android:height="16dp" android:tint="#FFFFFF"
+    android:viewportHeight="24.0" android:viewportWidth="24.0"
+    android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#FF000000" android:pathData="M16.5,3c-1.74,0 -3.41,0.81 -4.5,2.09C10.91,3.81 9.24,3 7.5,3 4.42,3 2,5.42 2,8.5c0,3.78 3.4,6.86 8.55,11.54L12,21.35l1.45,-1.32C18.6,15.36 22,12.28 22,8.5 22,5.42 19.58,3 16.5,3zM12.1,18.55l-0.1,0.1 -0.1,-0.1C7.14,14.24 4,11.39 4,8.5 4,6.5 5.5,5 7.5,5c1.54,0 3.04,0.99 3.57,2.36h1.87C13.46,5.99 14.96,5 16.5,5c2,0 3.5,1.5 3.5,3.5 0,2.89 -3.14,5.74 -7.9,10.05z"/>
+</vector>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/ic_nursing2.xml

@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#FFFFFF"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M16.5,3c-1.74,0 -3.41,0.81 -4.5,2.09C10.91,3.81 9.24,3 7.5,3 4.42,3 2,5.42 2,8.5c0,3.78 3.4,6.86 8.55,11.54L12,21.35l1.45,-1.32C18.6,15.36 22,12.28 22,8.5 22,5.42 19.58,3 16.5,3zM12.1,18.55l-0.1,0.1 -0.1,-0.1C7.14,14.24 4,11.39 4,8.5 4,6.5 5.5,5 7.5,5c1.54,0 3.04,0.99 3.57,2.36h1.87C13.46,5.99 14.96,5 16.5,5c2,0 3.5,1.5 3.5,3.5 0,2.89 -3.14,5.74 -7.9,10.05z"/>
+</vector>

+ 8 - 0
android_door/src/main/h10_a133_chile/res/drawable/radiobutton_background_checked.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <!-- 填充 -->
+    <solid android:color="#2F9DF1" />
+    <!-- 圆角 -->
+    <corners android:radius="5dp" />
+</shape>

+ 8 - 0
android_door/src/main/h10_a133_chile/res/drawable/radiobutton_background_unchecked.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <!-- 填充 -->
+    <solid android:color="#B4B4B4" />
+    <!-- 圆角 -->
+    <corners android:radius="5dp" />
+</shape>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_action_button_bg.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@mipmap/bg_action_button_p" android:state_pressed="true"/>
+    <item android:drawable="@mipmap/bg_action_button_n"/>
+</selector>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_action_button_text_color.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/drawer_item_bg_p" android:state_pressed="true"/>
+    <item android:color="@color/text_black"/>
+</selector>

+ 6 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_bottom_btn_text_color.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/text_name_color" android:state_pressed="true"/>
+    <item android:color="@color/text_name_color" android:state_enabled="false"/>
+    <item android:color="@color/white"/>
+</selector>

+ 7 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_button_bg_color.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/radiobutton_background_unchecked"
+        android:state_checked="false" />
+    <item android:drawable="@drawable/radiobutton_background_checked"
+        android:state_checked="true" />
+</selector>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_call_answer.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/ic_answer_press" android:state_pressed="true"/>
+    <item android:drawable="@drawable/ic_answer_normal"/>
+</selector>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_call_end.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/ic_hangup_press" android:state_pressed="true"/>
+    <item android:drawable="@drawable/ic_hangup_normal"/>
+</selector>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_call_hangup.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/ic_hangup_press" android:state_pressed="true"/>
+    <item android:drawable="@drawable/ic_hangup_normal"/>
+</selector>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_main.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@color/right_item_select" android:state_pressed="true"/>
+    <item android:drawable="@color/right_item_bg"/>
+</selector>

+ 5 - 0
android_door/src/main/h10_a133_chile/res/drawable/selector_record_btn.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@mipmap/ic_record_press" android:state_pressed="true"/>
+    <item android:drawable="@mipmap/ic_record_normal"/>
+</selector>

+ 7 - 0
android_door/src/main/h10_a133_chile/res/drawable/shape_frame_bg.xml

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

+ 50 - 0
android_door/src/main/h10_a133_chile/res/layout/adapter_call_bed.xml

@@ -0,0 +1,50 @@
+<?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="80dp"
+    android:gravity="center_vertical"
+    android:background="#EAF2F9"
+    android:layout_margin="8dp">
+    <TextView
+        android:id="@+id/tv_call_bed_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="8dp"
+        android:layout_weight="2"
+        android:text="--"
+        android:textColor="#2F9DF1"
+        android:textSize="24sp"/>
+    <TextView
+        android:id="@+id/tv_call_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="8dp"
+        android:layout_weight="2"
+        android:text="--"
+        android:textColor="#2F9DF1"
+        android:textSize="24sp"/>
+
+    <Button
+        android:id="@+id/btn_voice_call"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:background="@mipmap/bg_bottom_btn"
+        android:gravity="center"
+        android:text="@string/voice_call"
+        android:textColor="@drawable/selector_bottom_btn_text_color"
+        android:textSize="20sp"/>
+
+    <Button
+        android:id="@+id/btn_video_call"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:background="@mipmap/bg_bottom_btn"
+        android:layout_marginLeft="16dp"
+        android:layout_marginStart="16dp"
+        android:gravity="center"
+        android:text="@string/video_call"
+        android:textColor="@drawable/selector_bottom_btn_text_color"
+        android:textSize="20sp"/>
+</LinearLayout>

+ 137 - 0
android_door/src/main/h10_a133_chile/res/layout/adapter_call_records_item.xml

@@ -0,0 +1,137 @@
+<?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="74dp"
+        android:background="#ffffff"
+        android:layout_marginTop="6px">
+
+        <LinearLayout
+            android:id="@+id/tab_linyout"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="9px"
+            android:gravity="center_vertical"
+            android:orientation="vertical">
+
+            <ImageView
+                android:id="@+id/tab_imagev"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:src="@mipmap/ic_customer" />
+
+            <ImageView
+                android:id="@+id/call_status_imagev"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:layout_marginTop="2px" />
+        </LinearLayout>
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginTop="4px"
+            android:layout_marginRight="9px"
+            android:layout_toRightOf="@+id/tab_linyout">
+
+            <RelativeLayout
+                android:id="@+id/room_name_linlyout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="6px">
+
+                <TextView
+                    android:id="@+id/sickbed_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="--"
+                    android:textSize="14px" />
+
+                <TextView
+                    android:id="@+id/call_time_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentRight="true"
+                    android:text="--:--"
+                    android:textSize="12px" />
+
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:id="@+id/nursing_project_relalyout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@+id/room_name_linlyout"
+                android:layout_marginLeft="6px"
+                android:layout_marginTop="4px"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/name_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="--"
+                    android:textSize="14px" />
+
+                <LinearLayout
+                    android:id="@+id/incident_linlyou"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentRight="true"
+                    android:orientation="horizontal">
+
+                    <ImageView
+                        android:id="@+id/treatment_state_imagev"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center"
+                        android:layout_marginRight="6px" />
+
+
+                    <TextView
+                        android:id="@+id/project_tv"
+                        android:layout_width="wrap_content"
+                        android:layout_height="20px"
+                        android:gravity="center"
+                        android:text="--"
+                        android:textSize="12px" />
+
+                    <ImageView
+                        android:id="@+id/play_tv"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:gravity="center"
+                        android:visibility="gone"/>
+
+                </LinearLayout>
+            </RelativeLayout>
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_below="@+id/nursing_project_relalyout"
+                android:layout_alignParentRight="true"
+                android:layout_marginTop="4px"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/conductor_name_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="10px"
+                    android:text="--"
+                    android:textSize="12px" />
+
+                <TextView
+                    android:id="@+id/processing_time_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="--:--"
+                    android:textSize="12px" />
+            </LinearLayout>
+        </RelativeLayout>
+    </RelativeLayout>
+</layout>

+ 22 - 0
android_door/src/main/h10_a133_chile/res/layout/call_bed_dialog_lay.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/radis">
+
+    <Button
+        android:id="@+id/button_cancel"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_centerHorizontal="true"
+        android:text="@string/str_cancel"
+        android:textColor="#2F9DF1"/>
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/recycler_bed_list"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@id/button_cancel"
+        android:padding="10dp"/>
+</RelativeLayout>

+ 67 - 0
android_door/src/main/h10_a133_chile/res/layout/call_dialog_lay.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <!--拨出按钮显示-->
+    <LinearLayout
+        android:id="@+id/ll_call_outgoing"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:gravity="center"
+        android:orientation="vertical">
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:text="@string/call_in_calling"
+            android:textSize="28sp"/>
+
+        <ImageView
+            android:id="@+id/iv_hangup_call"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="60dp"
+            android:src="@drawable/selector_call_hangup" />
+    </LinearLayout>
+
+
+    <!--接听按钮显示-->
+    <RelativeLayout
+        android:id="@+id/rl_call_incoming"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:gravity="center"
+        android:visibility="gone">
+
+        <TextView
+            android:id="@+id/tv_incoming_call_text"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:text="@string/call_incoming"
+            android:textSize="28sp"/>
+
+        <ImageView
+            android:id="@+id/iv_accept_call"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/tv_incoming_call_text"
+            android:layout_alignParentLeft="true"
+            android:layout_marginLeft="160dp"
+            android:layout_marginTop="60dp"
+            android:src="@drawable/selector_call_answer"/>
+
+        <ImageView
+            android:id="@+id/iv_reject_call"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/tv_incoming_call_text"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="160dp"
+            android:layout_marginTop="60dp"
+            android:src="@drawable/selector_call_end"/>
+    </RelativeLayout>
+
+</RelativeLayout>

+ 238 - 0
android_door/src/main/h10_a133_chile/res/layout/callingdoor_main_lay.xml

@@ -0,0 +1,238 @@
+<?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:background="#EAF2F9">
+
+        <include
+            android:id="@+id/activity_calling_door_layout_title"
+            layout="@layout/view_title_layout"/>
+
+        <LinearLayout
+            android:id="@+id/ll_room_name"
+            android:layout_width="match_parent"
+            android:layout_height="100dp"
+            android:layout_below="@id/activity_calling_door_layout_title">
+            <com.wdkl.ncs.android.lib.widget.MarqueeTextView
+                android:id="@+id/tv_room_name"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="3"
+                android:paddingLeft="20dp"
+                android:paddingRight="20dp"
+                android:text="--"
+                android:textColor="@color/main_color"
+                android:textSize="68sp"
+                android:singleLine="true"
+                android:ellipsize="marquee"
+                android:focusable="true"
+                android:focusableInTouchMode="true" />
+
+            <ViewFlipper
+                android:id="@+id/view_flipper"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:paddingRight="10dp"
+                android:paddingLeft="10dp"
+                android:autoStart="true"
+                android:flipInterval="5000"
+                android:inAnimation="@anim/slide_down_in"
+                android:outAnimation="@anim/slide_up_out">
+                <!--<TextView
+                    android:id="@+id/call_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center|right"
+                    android:text="09床 呼叫"
+                    android:textColor="@color/color_red"
+                    android:textSize="32sp" />-->
+            </ViewFlipper>
+        </LinearLayout>
+
+        <TextView
+            android:id="@+id/app_version"
+            android:layout_width="132dp"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_alignParentRight="true"
+            android:gravity="center"
+            android:paddingTop="10dp"
+            android:paddingBottom="10dp"
+            android:text="--"
+            android:textColor="@color/main_color"
+            android:textSize="20sp" />
+
+        <!--右侧按钮区域-->
+        <ScrollView
+            android:id="@+id/room_actions"
+            android:layout_width="132dp"
+            android:layout_height="match_parent"
+            android:layout_margin="10dp"
+            android:layout_below="@id/ll_room_name"
+            android:layout_above="@id/app_version"
+            android:layout_alignParentRight="true">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="10dp"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/room_action_home"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@mipmap/ic_home"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_home"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="20sp" />
+
+                <TextView
+                    android:id="@+id/room_action_call_bed"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="30dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@mipmap/ic_call"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_call_bed"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="20sp" />
+
+                <TextView
+                    android:id="@+id/room_action_call"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="30dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@mipmap/ic_call"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_call_nurse"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="20sp" />
+
+                <TextView
+                    android:id="@+id/room_cancel_call"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="30dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@mipmap/ic_call"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_cancel_call"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="20sp" />
+
+                <TextView
+                    android:id="@+id/room_action_support"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="30dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@mipmap/ic_support"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_support"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="20sp" />
+
+                <TextView
+                    android:id="@+id/room_action_nurse"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="30dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@drawable/ic_nursing"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/enter_nursing"
+                    android:textColor="@color/white"
+                    android:textSize="20sp" />
+
+                <TextView
+                    android:id="@+id/room_action_language_set"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="30dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@drawable/ic_language"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/language_set_title"
+                    android:textColor="@color/white"
+                    android:textSize="20sp" />
+
+                <TextView
+                    android:id="@+id/room_action_more"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="30dp"
+                    android:background="@mipmap/bg_bottom_btn"
+                    android:drawableLeft="@mipmap/ic_more"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="10dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_more"
+                    android:textColor="@color/white"
+                    android:textSize="20sp" />
+
+            </LinearLayout>
+        </ScrollView>
+
+        <!--床位fragment区域-->
+        <FrameLayout
+            android:id="@+id/callingdoor_main_frame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_margin="10dp"
+            android:layout_below="@id/ll_room_name"
+            android:layout_toLeftOf="@id/room_actions"/>
+
+        <!--通话界面-->
+        <FrameLayout
+            android:id="@+id/call_frame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+        <!--black screen-->
+        <LinearLayout
+            android:id="@+id/black_view"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="horizontal"
+            android:background="#000000"
+            android:visibility="gone"/>
+    </RelativeLayout>
+</layout>

+ 246 - 0
android_door/src/main/h10_a133_chile/res/layout/callingdoor_main_lay_rk3288.xml

@@ -0,0 +1,246 @@
+<?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:background="#EAF2F9">
+
+        <include
+            android:id="@+id/activity_calling_door_layout_title"
+            layout="@layout/view_title_layout_rk3288"/>
+
+        <LinearLayout
+            android:id="@+id/ll_room_name"
+            android:layout_width="match_parent"
+            android:layout_height="180dp"
+            android:layout_below="@id/activity_calling_door_layout_title">
+
+            <com.wdkl.ncs.android.lib.widget.MarqueeTextView
+                android:id="@+id/tv_room_name"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="3"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:gravity="center_vertical"
+                android:singleLine="true"
+                android:ellipsize="marquee"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:text="--"
+                android:textColor="@color/main_color"
+                android:textSize="140sp" />
+
+            <ViewFlipper
+                android:id="@+id/view_flipper"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:paddingRight="10dp"
+                android:paddingLeft="10dp"
+                android:autoStart="true"
+                android:flipInterval="5000"
+                android:inAnimation="@anim/slide_down_in"
+                android:outAnimation="@anim/slide_up_out">
+                <!--<TextView
+                    android:id="@+id/call_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center|right"
+                    android:text="09床 呼叫"
+                    android:textColor="@color/color_red"
+                    android:textSize="32sp" />-->
+            </ViewFlipper>
+        </LinearLayout>
+
+        <TextView
+            android:id="@+id/app_version"
+            android:layout_width="260dp"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_alignParentRight="true"
+            android:layout_marginTop="10dp"
+            android:layout_marginBottom="10dp"
+            android:paddingTop="10dp"
+            android:paddingBottom="10dp"
+            android:gravity="center"
+            android:text="--"
+            android:textSize="32sp"
+            android:textColor="@color/main_color"/>
+
+        <!--右侧按钮区域-->
+        <ScrollView
+            android:id="@+id/room_actions"
+            android:layout_width="260dp"
+            android:layout_height="match_parent"
+            android:layout_above="@id/app_version"
+            android:layout_below="@id/ll_room_name"
+            android:layout_alignParentRight="true">
+
+            <LinearLayout
+                android:id="@+id/rl_room_actions"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="10dp"
+                android:orientation="vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp">
+
+                <TextView
+                    android:id="@+id/room_action_home"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:layout_marginBottom="40dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@mipmap/ic_home2"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_home"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="40sp" />
+
+                <TextView
+                    android:id="@+id/room_action_call_bed"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="40dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@mipmap/ic_call2"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_call_bed"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="40sp" />
+
+                <TextView
+                    android:id="@+id/room_action_call"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="40dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@mipmap/ic_call2"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_call_nurse"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="40sp" />
+
+                <TextView
+                    android:id="@+id/room_cancel_call"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="40dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@mipmap/ic_call2"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_cancel_call"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="40sp" />
+
+                <TextView
+                    android:id="@+id/room_action_support"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="40dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@mipmap/ic_support2"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_support"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="40sp" />
+
+                <TextView
+                    android:id="@+id/room_action_nurse"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="40dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@drawable/ic_nursing2"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/enter_nursing"
+                    android:textColor="@color/white"
+                    android:textSize="40sp" />
+
+                <TextView
+                    android:id="@+id/room_action_language_set"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="40dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@drawable/ic_language2"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/language_set_title"
+                    android:textColor="@color/white"
+                    android:textSize="40sp" />
+
+                <TextView
+                    android:id="@+id/room_action_more"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="10dp"
+                    android:background="@mipmap/bg_bottom_btn2"
+                    android:drawableLeft="@mipmap/ic_more"
+                    android:drawablePadding="6dp"
+                    android:gravity="center_vertical"
+                    android:padding="12dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_more"
+                    android:textColor="@color/white"
+                    android:textSize="40sp" />
+
+            </LinearLayout>
+        </ScrollView>
+
+        <!--床位fragment区域-->
+        <FrameLayout
+            android:id="@+id/callingdoor_main_frame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_margin="20dp"
+            android:layout_below="@id/ll_room_name"
+            android:layout_toLeftOf="@id/room_actions"/>
+
+        <!--通话界面-->
+        <FrameLayout
+            android:id="@+id/call_frame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+        <!--black screen-->
+        <LinearLayout
+            android:id="@+id/black_view"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="horizontal"
+            android:background="#000000"
+            android:visibility="gone"/>
+    </RelativeLayout>
+</layout>

+ 14 - 0
android_door/src/main/h10_a133_chile/res/layout/cost_view_lay.xml

@@ -0,0 +1,14 @@
+<?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">
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/rv_cost_main_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginBottom="6dp"/>
+</LinearLayout>
+</layout>

+ 17 - 0
android_door/src/main/h10_a133_chile/res/layout/digital_item.xml

@@ -0,0 +1,17 @@
+<?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="match_parent">
+
+    <TextView
+        android:id="@+id/tv_number"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/color_gray"
+        android:layout_margin="4dp"
+        android:padding="10dp"
+        android:gravity="center"
+        android:textSize="32sp"
+        android:textColor="@color/main_color"/>
+
+</LinearLayout>

+ 33 - 0
android_door/src/main/h10_a133_chile/res/layout/item_action_view.xml

@@ -0,0 +1,33 @@
+<?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="wrap_content"
+    android:paddingTop="4dp"
+    android:paddingLeft="4dp"
+    android:paddingRight="4dp">
+
+    <LinearLayout
+        android:id="@+id/ll_action_view"
+        android:layout_width="match_parent"
+        android:layout_height="62dp"
+        android:background="@mipmap/bg_action_item"
+        android:gravity="center_vertical">
+
+        <ImageView
+            android:id="@+id/iv_action"
+            android:layout_width="40dp"
+            android:layout_height="40dp"
+            android:layout_marginLeft="10dp"
+            android:scaleType="centerInside"/>
+
+        <TextView
+            android:id="@+id/tv_action"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="10dp"
+            android:gravity="left|center_vertical"
+            android:text="--"
+            android:textSize="28sp"
+            android:textColor="@drawable/selector_action_button_text_color"/>
+    </LinearLayout>
+</LinearLayout>

+ 291 - 0
android_door/src/main/h10_a133_chile/res/layout/item_bed.xml

@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="430dp"
+    android:layout_height="match_parent"
+    android:paddingLeft="20dp"
+    android:orientation="vertical">
+
+    <com.wdkl.ncs.android.lib.widget.FlickerTextView
+        android:id="@+id/tv_bed_name_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="4dp"
+        android:text="--"
+        android:textColor="@color/main_color"
+        android:textSize="36sp"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:baselineAligned="false">
+
+        <!--护理项-->
+        <LinearLayout
+            android:id="@+id/ll_nurse_configs"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1.2"
+            android:baselineAligned="false"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="10dp">
+                <View
+                    android:id="@+id/nurse_config_item_color1"
+                    android:layout_width="10dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color1"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="18sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color1"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="@dimen/nurse_config_margin">
+                <View
+                    android:id="@+id/nurse_config_item_color2"
+                    android:layout_width="10dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color2"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="18sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color2"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="@dimen/nurse_config_margin">
+                <View
+                    android:id="@+id/nurse_config_item_color3"
+                    android:layout_width="10dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name3"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color3"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="18sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value3"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color3"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="@dimen/nurse_config_margin">
+                <View
+                    android:id="@+id/nurse_config_item_color4"
+                    android:layout_width="10dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name4"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color4"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="18sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value4"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color4"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="@dimen/nurse_config_margin">
+                <View
+                    android:id="@+id/nurse_config_item_color5"
+                    android:layout_width="10dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name5"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color5"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="18sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value5"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color5"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+        </LinearLayout>
+
+        <!--入住信息-->
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:layout_marginTop="10dp"
+            android:baselineAligned="false"
+            android:orientation="vertical"
+            android:gravity="center_horizontal">
+
+            <TextView
+                android:id="@+id/bed_customer_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:drawableTop="@mipmap/ic_custom_male"
+                android:gravity="center"
+                android:text="--"
+                android:textColor="@color/black"
+                android:textSize="24sp"/>
+
+            <TextView
+                android:id="@+id/bed_customer_age"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:drawableLeft="@mipmap/ic_gender_male"
+                android:drawablePadding="4dp"
+                android:text="--"
+                android:textSize="20sp"/>
+
+            <ImageView
+                android:id="@+id/bed_doctor_icon"
+                android:layout_width="48dp"
+                android:layout_height="48dp"
+                android:layout_marginTop="20dp"
+                android:src="@mipmap/ic_doctor_default"/>
+
+            <TextView
+                android:id="@+id/bed_doctor_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="@string/doctor_title"
+                android:textColor="@color/text_name_color"
+                android:textSize="14sp"/>
+
+            <TextView
+                android:id="@+id/bed_doctor_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/str_empty"
+                android:textColor="@color/black"
+                android:textSize="14sp"/>
+
+            <ImageView
+                android:id="@+id/bed_nurse_icon"
+                android:layout_width="48dp"
+                android:layout_height="48dp"
+                android:layout_marginTop="10dp"
+                android:src="@mipmap/ic_nurse_default"/>
+
+            <TextView
+                android:id="@+id/bed_nurse_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="@string/nurse_title"
+                android:textColor="@color/text_name_color"
+                android:textSize="14sp"/>
+
+            <TextView
+                android:id="@+id/bed_nurse_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/str_empty"
+                android:textColor="@color/black"
+                android:textSize="14sp"/>
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+</LinearLayout>

+ 325 - 0
android_door/src/main/h10_a133_chile/res/layout/item_bed_rk3288.xml

@@ -0,0 +1,325 @@
+<?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="480dp"
+    android:layout_marginTop="20dp"
+    android:paddingLeft="32dp"
+    android:paddingRight="32dp"
+    android:orientation="vertical">
+
+    <com.wdkl.ncs.android.lib.widget.FlickerTextView
+        android:id="@+id/tv_bed_name_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="10dp"
+        android:text="--"
+        android:textColor="@color/main_color"
+        android:textSize="54sp"
+        android:background="#EAF2F9"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:baselineAligned="false">
+
+        <!--护理项-->
+        <LinearLayout
+            android:id="@+id/ll_nurse_configs"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="2"
+            android:baselineAligned="false"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="10dp">
+                <View
+                    android:id="@+id/nurse_config_item_color1"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color1"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="22sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color1"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="26sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color2"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color2"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="22sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color2"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="26sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color3"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name3"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color3"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="22sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value3"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color3"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="26sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color4"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name4"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color4"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="22sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value4"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color4"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="26sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color5"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name5"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color5"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="22sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value5"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color5"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="26sp"/>
+            </RelativeLayout>
+
+        </LinearLayout>
+
+        <!--入住信息-->
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="3"
+            android:layout_marginTop="10dp"
+            android:baselineAligned="false"
+            android:orientation="vertical"
+            android:gravity="center_horizontal">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dp">
+                <TextView
+                    android:id="@+id/bed_customer_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:drawableLeft="@mipmap/ic_custom_empty2"
+                    android:drawablePadding="12dp"
+                    android:layout_centerHorizontal="true"
+                    android:gravity="center_vertical"
+                    android:text="--"
+                    android:textColor="@color/black"
+                    android:textSize="40sp"/>
+
+                <TextView
+                    android:id="@+id/bed_customer_age"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:layout_centerHorizontal="true"
+                    android:layout_below="@id/bed_customer_name"
+                    android:drawableLeft="@mipmap/ic_gender_male"
+                    android:drawablePadding="12dp"
+                    android:text="--"
+                    android:textSize="28sp"/>
+
+            </RelativeLayout>
+
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="60dp"
+                android:gravity="center">
+                <ImageView
+                    android:id="@+id/bed_doctor_icon"
+                    android:layout_width="64dp"
+                    android:layout_height="64dp"
+                    android:src="@mipmap/ic_doctor_default2"/>
+
+                <TextView
+                    android:id="@+id/bed_doctor_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_doctor_icon"
+                    android:text="@string/doctor_title"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+
+                <TextView
+                    android:id="@+id/bed_doctor_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_doctor_icon"
+                    android:layout_below="@id/bed_doctor_title"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/black"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="20dp"
+                android:gravity="center">
+                <ImageView
+                    android:id="@+id/bed_nurse_icon"
+                    android:layout_width="64dp"
+                    android:layout_height="64dp"
+                    android:src="@mipmap/ic_nurse_default2"/>
+
+                <TextView
+                    android:id="@+id/bed_nurse_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_nurse_icon"
+                    android:text="@string/nurse_title"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+
+                <TextView
+                    android:id="@+id/bed_nurse_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_nurse_icon"
+                    android:layout_below="@id/bed_nurse_title"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/black"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+</LinearLayout>

+ 325 - 0
android_door/src/main/h10_a133_chile/res/layout/item_bed_rk3288_800.xml

@@ -0,0 +1,325 @@
+<?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="430dp"
+    android:layout_marginTop="10dp"
+    android:paddingLeft="32dp"
+    android:paddingRight="32dp"
+    android:orientation="vertical">
+
+    <com.wdkl.ncs.android.lib.widget.FlickerTextView
+        android:id="@+id/tv_bed_name_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="10dp"
+        android:text="--"
+        android:textColor="@color/main_color"
+        android:textSize="48sp"
+        android:background="#EAF2F9"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:baselineAligned="false">
+
+        <!--护理项-->
+        <LinearLayout
+            android:id="@+id/ll_nurse_configs"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="2"
+            android:baselineAligned="false"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height_800"
+                android:layout_marginTop="10dp">
+                <View
+                    android:id="@+id/nurse_config_item_color1"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color1"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color1"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height_800"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color2"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color2"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color2"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height_800"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color3"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name3"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color3"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value3"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color3"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height_800"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color4"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name4"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color4"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value4"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color4"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/nurse_config_item_height_800"
+                android:layout_marginTop="16dp">
+                <View
+                    android:id="@+id/nurse_config_item_color5"
+                    android:layout_width="20dp"
+                    android:layout_height="match_parent"
+                    android:background="@color/nursing_default_color"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_name5"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color5"
+                    android:paddingLeft="4dp"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/default_nurse_config_name"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+                <TextView
+                    android:id="@+id/nurse_config_item_value5"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@id/nurse_config_item_color5"
+                    android:layout_alignParentBottom="true"
+                    android:paddingRight="4dp"
+                    android:gravity="right"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/main_color"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+        </LinearLayout>
+
+        <!--入住信息-->
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="3"
+            android:layout_marginTop="10dp"
+            android:baselineAligned="false"
+            android:orientation="vertical"
+            android:gravity="center_horizontal">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dp">
+                <TextView
+                    android:id="@+id/bed_customer_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:drawableLeft="@mipmap/ic_custom_empty2"
+                    android:drawablePadding="12dp"
+                    android:layout_centerHorizontal="true"
+                    android:gravity="center_vertical"
+                    android:text="--"
+                    android:textColor="@color/black"
+                    android:textSize="40sp"/>
+
+                <TextView
+                    android:id="@+id/bed_customer_age"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:layout_centerHorizontal="true"
+                    android:layout_below="@id/bed_customer_name"
+                    android:drawableLeft="@mipmap/ic_gender_male"
+                    android:drawablePadding="12dp"
+                    android:text="--"
+                    android:textSize="28sp"/>
+
+            </RelativeLayout>
+
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="20dp"
+                android:gravity="center">
+                <ImageView
+                    android:id="@+id/bed_doctor_icon"
+                    android:layout_width="64dp"
+                    android:layout_height="64dp"
+                    android:src="@mipmap/ic_doctor_default2"/>
+
+                <TextView
+                    android:id="@+id/bed_doctor_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_doctor_icon"
+                    android:text="@string/doctor_title"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+
+                <TextView
+                    android:id="@+id/bed_doctor_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_doctor_icon"
+                    android:layout_below="@id/bed_doctor_title"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/black"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="20dp"
+                android:gravity="center">
+                <ImageView
+                    android:id="@+id/bed_nurse_icon"
+                    android:layout_width="64dp"
+                    android:layout_height="64dp"
+                    android:src="@mipmap/ic_nurse_default2"/>
+
+                <TextView
+                    android:id="@+id/bed_nurse_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_nurse_icon"
+                    android:text="@string/nurse_title"
+                    android:textColor="@color/text_name_color"
+                    android:textSize="20sp"/>
+
+                <TextView
+                    android:id="@+id/bed_nurse_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_toRightOf="@id/bed_nurse_icon"
+                    android:layout_below="@id/bed_nurse_title"
+                    android:text="@string/str_empty"
+                    android:textColor="@color/black"
+                    android:textSize="20sp"/>
+            </RelativeLayout>
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+</LinearLayout>

+ 39 - 0
android_door/src/main/h10_a133_chile/res/layout/item_cost_detail.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="10dp">
+
+    <TextView
+        android:id="@+id/tv_item_cost_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textSize="20sp"
+        android:textColor="@color/black"/>
+    <TextView
+        android:id="@+id/tv_item_cost_value"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:textSize="20sp"
+        android:textColor="@color/black"/>
+    <TextView
+        android:id="@+id/tv_item_cost_id"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/tv_item_cost_name"
+        android:layout_marginTop="8dp"
+        android:textSize="20sp"
+        android:textColor="#A4A4A4"/>
+    <TextView
+        android:id="@+id/tv_item_cost_unit"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_below="@id/tv_item_cost_value"
+        android:layout_marginTop="8dp"
+        android:textSize="20sp"
+        android:textColor="#A4A4A4"/>
+
+</RelativeLayout>

+ 38 - 0
android_door/src/main/h10_a133_chile/res/layout/item_cost_main_view.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="wrap_content"
+    android:padding="16dp"
+    android:layout_marginBottom="10dp"
+    android:orientation="vertical"
+    android:background="@color/white">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <TextView
+            android:id="@+id/tv_cost_group_name"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text=""
+            android:textColor="@color/main_color"
+            android:textSize="24sp"/>
+        <TextView
+            android:id="@+id/tv_cost_group_total"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="right"
+            android:text=""
+            android:textColor="@color/main_color"
+            android:textSize="24sp"/>
+    </LinearLayout>
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/rv_cost_detail"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"/>
+
+</LinearLayout>

+ 38 - 0
android_door/src/main/h10_a133_chile/res/layout/item_nurse_config.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="86dp"
+    android:layout_marginTop="6dp"
+    android:background="@color/white">
+
+    <TextView
+        android:id="@+id/tv_nurse_color"
+        android:layout_width="8dp"
+        android:layout_height="match_parent"
+        android:background="@color/main_color"/>
+
+    <TextView
+        android:id="@+id/tv_nurse_config_name"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:paddingLeft="6dp"
+        android:paddingTop="6dp"
+        android:text="@string/default_nurse_config_name"
+        android:textSize="20sp"
+        android:textColor="#B4B4B4"/>
+
+    <TextView
+        android:id="@+id/tv_nurse_config_value"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:paddingRight="6dp"
+        android:paddingBottom="6dp"
+        android:gravity="right|bottom"
+        android:text="@string/str_empty"
+        android:textSize="24sp"
+        android:textColor="@color/main_color"/>
+
+</LinearLayout>

+ 83 - 0
android_door/src/main/h10_a133_chile/res/layout/language_set_dialog.xml

@@ -0,0 +1,83 @@
+<?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="match_parent"
+    android:padding="20dp"
+    android:gravity="center"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/tv_language_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:text="@string/language_set_mode"
+        android:textSize="24sp" />
+
+    <RadioGroup
+        android:id="@+id/group_language_mode"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:orientation="horizontal">
+        <RadioButton
+            android:id="@+id/rb_language_yes"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/str_yes"/>
+        <RadioButton
+            android:id="@+id/rb_language_no"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="4dp"
+            android:text="@string/str_no"/>
+    </RadioGroup>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="20dp"
+        android:orientation="vertical">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:text="@string/language_set_title"
+            android:textSize="24sp" />
+
+        <Spinner
+            android:id="@+id/spinner_language_select"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"/>
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="60dp"
+        android:gravity="center_horizontal">
+        <Button
+            android:id="@+id/confirm_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@mipmap/bg_bottom_btn"
+            android:padding="8dp"
+            android:text="@string/str_confirm"
+            android:textSize="20sp"
+            android:textColor="@drawable/selector_bottom_btn_text_color"/>
+
+        <Button
+            android:id="@+id/cancel_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="80dp"
+            android:background="@mipmap/bg_bottom_btn"
+            android:padding="8dp"
+            android:text="@string/str_cancel"
+            android:textSize="20sp"
+            android:textColor="@drawable/selector_bottom_btn_text_color"/>
+    </LinearLayout>
+
+</LinearLayout>

+ 18 - 0
android_door/src/main/h10_a133_chile/res/layout/main_view_layout.xml

@@ -0,0 +1,18 @@
+<?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"
+    android:background="@color/white">
+
+    <com.wdkl.ncs.android.lib.widget.AutoPollRecyclerView
+        android:id="@+id/rv_bed_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:overScrollMode="never"
+        android:paddingLeft="2dp"
+        android:paddingRight="2dp"/>
+
+</LinearLayout>
+</layout>

+ 65 - 0
android_door/src/main/h10_a133_chile/res/layout/password_dialog_lay.xml

@@ -0,0 +1,65 @@
+<?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="match_parent"
+    android:gravity="center"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/tv_psw_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:hint="@string/input_password"
+        android:textColor="@color/main_color"
+        android:textSize="24sp" />
+
+    <GridView
+        android:id="@+id/grid_psw"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:horizontalSpacing="5dp"
+        android:numColumns="3"
+        android:verticalSpacing="5dp" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="20dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:id="@+id/btn_delete"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="center_horizontal"
+            android:padding="4dp"
+            android:text="@string/str_delete"
+            android:textColor="@color/main_color"
+            android:textSize="24sp" />
+
+        <TextView
+            android:id="@+id/btn_cancel"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="center_horizontal"
+            android:padding="4dp"
+            android:text="@string/str_cancel"
+            android:textColor="@color/main_color"
+            android:textSize="24sp" />
+
+        <TextView
+            android:id="@+id/btn_confirm"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:gravity="center_horizontal"
+            android:padding="4dp"
+            android:text="@string/str_confirm"
+            android:textColor="@color/main_color"
+            android:textSize="24sp" />
+    </LinearLayout>
+</LinearLayout>

+ 256 - 0
android_door/src/main/h10_a133_chile/res/layout/qr_code_lay.xml

@@ -0,0 +1,256 @@
+<?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">
+
+    <LinearLayout
+        android:id="@+id/ll_qr_code_view"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="3"
+        android:layout_marginTop="6dp"
+        android:layout_marginBottom="6dp"
+        android:background="@color/white"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="10dp">
+
+            <RadioGroup
+                android:id="@+id/group_qr_code"
+                android:layout_width="160dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="30dp"
+                android:orientation="vertical">
+
+                <RadioButton
+                    android:id="@+id/rb_qr_code_main"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="20dp"
+                    android:padding="10dp"
+                    android:background="@drawable/selector_button_bg_color"
+                    android:button="@null"
+                    android:gravity="center"
+                    android:text="@string/qr_code_main"
+                    android:textSize="24sp"/>
+
+                <RadioButton
+                    android:id="@+id/rb_qr_code_h1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="20dp"
+                    android:padding="10dp"
+                    android:background="@drawable/selector_button_bg_color"
+                    android:button="@null"
+                    android:gravity="center"
+                    android:text="@string/qr_code_h1"
+                    android:textSize="24sp"/>
+
+                <RadioButton
+                    android:id="@+id/rb_qr_code_h2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="20dp"
+                    android:padding="10dp"
+                    android:background="@drawable/selector_button_bg_color"
+                    android:button="@null"
+                    android:gravity="center"
+                    android:text="@string/qr_code_h2"
+                    android:textSize="24sp"/>
+            </RadioGroup>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:gravity="center"
+                android:orientation="vertical">
+                <ImageView
+                    android:id="@+id/view_qr_code"
+                    android:layout_width="200dp"
+                    android:layout_height="200dp"
+                    android:layout_gravity="center_horizontal"/>
+
+                <TextView
+                    android:id="@+id/tv_local_mac_id"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="4dp"
+                    android:textColor="@color/black"
+                    android:textSize="16sp" />
+            </LinearLayout>
+
+        </LinearLayout>
+
+
+        <TextView
+            android:id="@+id/tv_device_id"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="40dp"
+            android:text="ID:"
+            android:textColor="@color/black"
+            android:textSize="18sp" />
+
+        <TextView
+            android:id="@+id/tv_local_ip"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:layout_marginLeft="40dp"
+            android:text="IP:"
+            android:textColor="@color/black"
+            android:textSize="18sp" />
+
+        <TextView
+            android:id="@+id/tv_server_ip"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:layout_marginLeft="40dp"
+            android:text="Server:"
+            android:textColor="@color/black"
+            android:textSize="18sp" />
+
+        <TextView
+            android:id="@+id/tv_local_mac"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:layout_marginLeft="40dp"
+            android:text="MAC:"
+            android:textColor="@color/black"
+            android:textSize="18sp" />
+
+        <TextView
+            android:id="@+id/tv_device_sn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:layout_marginLeft="40dp"
+            android:text="Identifier:"
+            android:textColor="@color/black"
+            android:textSize="18sp" />
+
+        <TextView
+            android:id="@+id/tv_app_version"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:layout_marginLeft="40dp"
+            android:text="Version:"
+            android:textColor="@color/black"
+            android:textSize="18sp" />
+
+        <TextView
+            android:id="@+id/tv_mcu_version"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:layout_marginLeft="40dp"
+            android:text="MCU:"
+            android:textColor="@color/black"
+            android:textSize="18sp" />
+    </LinearLayout>
+
+    <RelativeLayout
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="2"
+        android:background="@color/white"
+        android:layout_marginTop="6dp"
+        android:layout_marginBottom="6dp"
+        android:padding="20dp"
+        android:orientation="vertical">
+
+        <ScrollView
+            android:id="@+id/device_action_view"
+            android:layout_width="match_parent"
+            android:layout_height="188dp"
+            android:layout_alignParentBottom="true">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+                <TextView
+                    android:id="@+id/tv_btn_reboot"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:padding="10dp"
+                    android:background="@color/main_color"
+                    android:gravity="center_horizontal"
+                    android:singleLine="true"
+                    android:text="@string/reboot_device"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="24sp"/>
+
+                <TextView
+                    android:id="@+id/tv_btn_update_app"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:padding="10dp"
+                    android:background="@color/main_color"
+                    android:gravity="center_horizontal"
+                    android:singleLine="true"
+                    android:text="@string/check_update"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="24sp"
+                    android:visibility="gone"/>
+
+                <TextView
+                    android:id="@+id/tv_btn_server_config"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:padding="10dp"
+                    android:background="@color/main_color"
+                    android:gravity="center_horizontal"
+                    android:singleLine="true"
+                    android:text="@string/server_config"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="24sp" />
+
+                <TextView
+                    android:id="@+id/tv_device_test"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="10dp"
+                    android:padding="10dp"
+                    android:background="@color/main_color"
+                    android:gravity="center_horizontal"
+                    android:singleLine="true"
+                    android:text="@string/test_mode"
+                    android:textColor="@drawable/selector_bottom_btn_text_color"
+                    android:textSize="24sp" />
+            </LinearLayout>
+        </ScrollView>
+
+        <TextView
+            android:id="@+id/tv_detail_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/product_desc"
+            android:textColor="@color/black"
+            android:textSize="22sp" />
+
+        <TextView
+            android:id="@+id/tv_about_me"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_below="@id/tv_detail_title"
+            android:layout_above="@id/device_action_view"
+            android:layout_marginTop="20dp"
+            android:layout_marginBottom="20dp"
+            android:text="@string/str_empty"
+            android:textColor="#949494"
+            android:textSize="20sp" />
+    </RelativeLayout>
+
+</LinearLayout>
+</layout>

+ 189 - 0
android_door/src/main/h10_a133_chile/res/layout/server_config_dialog_lay.xml

@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <!--密码框-->
+    <LinearLayout
+        android:id="@+id/ll_password"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:gravity="center"
+        android:orientation="vertical">
+
+        <TextView
+            android:id="@+id/tv_psw_view"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:textSize="24sp"
+            android:hint="@string/input_password"
+            android:textColor="@color/main_color"/>
+
+        <GridView
+            android:id="@+id/grid_psw"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:verticalSpacing="5dp"
+            android:horizontalSpacing="5dp"
+            android:numColumns="3"/>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp"
+            android:orientation="horizontal">
+            <TextView
+                android:id="@+id/btn_delete"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:padding="4dp"
+                android:gravity="center_horizontal"
+                android:text="@string/str_delete"
+                android:textSize="24sp"
+                android:textColor="@color/main_color"/>
+
+            <TextView
+                android:id="@+id/btn_cancel"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:padding="4dp"
+                android:gravity="center_horizontal"
+                android:text="@string/str_cancel"
+                android:textSize="24sp"
+                android:textColor="@color/main_color"/>
+            <TextView
+                android:id="@+id/btn_confirm"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:padding="4dp"
+                android:gravity="center_horizontal"
+                android:text="@string/str_confirm"
+                android:textSize="24sp"
+                android:textColor="@color/main_color"/>
+        </LinearLayout>
+    </LinearLayout>
+
+
+    <!--服务器ip配置-->
+    <LinearLayout
+        android:id="@+id/ll_server_config"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginTop="20dp"
+        android:padding="10dp"
+        android:orientation="vertical"
+        android:visibility="gone">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:text="Server IP:"
+                android:textSize="20sp"
+                android:textColor="@color/main_color"/>
+
+            <EditText
+                android:id="@+id/edit_url"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="4dp"
+                android:inputType="textUri"
+                android:textSize="20sp"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:text="Port:"
+                android:textSize="20sp"
+                android:textColor="@color/main_color"/>
+
+            <EditText
+                android:id="@+id/edit_port"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="4dp"
+                android:inputType="number"
+                android:textSize="20sp"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:visibility="gone">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:text="Sip IP:"
+                android:textSize="20sp"
+                android:textColor="@color/main_color"/>
+
+            <EditText
+                android:id="@+id/edit_sip_url"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="4dp"
+                android:inputType="textUri"
+                android:textSize="20sp"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:visibility="gone">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:text="Sip port:"
+                android:textSize="20sp"
+                android:textColor="@color/main_color"/>
+
+            <EditText
+                android:id="@+id/edit_sip_port"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="4dp"
+                android:inputType="number"
+                android:textSize="20sp" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="20dp">
+            <TextView
+                android:id="@+id/btn_cancel_config"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:text="@string/str_cancel"
+                android:textSize="28sp"
+                android:textColor="@color/black"/>
+
+            <TextView
+                android:id="@+id/btn_save_config"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:text="@string/str_save"
+                android:textSize="28sp"
+                android:textColor="@color/black" />
+        </LinearLayout>
+    </LinearLayout>
+</RelativeLayout>

+ 135 - 0
android_door/src/main/h10_a133_chile/res/layout/sky_voice_call_layout.xml

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout>
+    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/gray_deep">
+        <!--全屏视频画面-->
+        <FrameLayout
+            android:id="@+id/fullscreen_video_frame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="center"
+            android:visibility="gone"/>
+
+        <!--小窗视频画面-->
+        <FrameLayout
+            android:id="@+id/pip_video_frame"
+            android:layout_width="200dp"
+            android:layout_height="240dp"
+            android:layout_gravity="top|end"
+            android:layout_marginHorizontal="10dp"
+            android:layout_marginTop="10dp"
+            android:visibility="gone"/>
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <!--语音呼叫layout-->
+            <LinearLayout
+                android:id="@+id/ll_voice_call"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_horizontal"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_head_img"
+                    android:layout_width="120dp"
+                    android:layout_height="120dp"
+                    android:layout_marginTop="80dp"
+                    android:scaleType="centerInside"
+                    android:src="@drawable/ic_nurse" />
+
+                <TextView
+                    android:id="@+id/sky_voice_call_calling_text"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="24dp"
+                    android:gravity="center"
+                    android:text="@string/call_in_calling"
+                    android:textColor="@color/white"
+                    android:textSize="32sp" />
+
+                <TextView
+                    android:id="@+id/sky_voice_call_timeout"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="24dp"
+                    android:gravity="center"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+            </LinearLayout>
+
+            <!--呼出-->
+            <LinearLayout
+                android:id="@+id/sky_voice_call_outgoing"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="80dp"
+                android:gravity="center_horizontal"
+                android:orientation="vertical"
+                android:visibility="visible">
+
+                <Chronometer
+                    android:id="@+id/sky_voice_call_timer"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:text="00:00"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_hangup"
+                    android:layout_width="80dp"
+                    android:layout_height="80dp"
+                    android:layout_marginTop="20dp"
+                    android:src="@drawable/selector_call_hangup" />
+            </LinearLayout>
+
+            <!--来电-->
+            <LinearLayout
+                android:id="@+id/sky_voice_call_incoming"
+                android:layout_width="match_parent"
+                android:layout_height="140dp"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="80dp"
+                android:gravity="bottom"
+                android:orientation="horizontal"
+                android:visibility="gone">
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_ring_reject"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_hangup" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="1" />
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_ring_pickup_audio"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_answer" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
+            </LinearLayout>
+        </RelativeLayout>
+    </FrameLayout>
+</layout>

+ 136 - 0
android_door/src/main/h10_a133_chile/res/layout/sky_voice_call_layout_rk3288.xml

@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout>
+    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/gray_deep">
+        <!--全屏视频画面-->
+        <FrameLayout
+            android:id="@+id/fullscreen_video_frame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="center"
+            android:visibility="gone"/>
+
+        <!--小窗视频画面-->
+        <FrameLayout
+            android:id="@+id/pip_video_frame"
+            android:layout_width="280dp"
+            android:layout_height="400dp"
+            android:layout_gravity="top|end"
+            android:layout_marginHorizontal="10dp"
+            android:layout_marginTop="10dp"
+            android:visibility="gone"/>
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <!--语音呼叫layout-->
+            <LinearLayout
+                android:id="@+id/ll_voice_call"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="400dp"
+                android:gravity="center_horizontal"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_head_img"
+                    android:layout_width="200dp"
+                    android:layout_height="200dp"
+                    android:layout_marginTop="80dp"
+                    android:scaleType="centerInside"
+                    android:src="@drawable/ic_nurse" />
+
+                <TextView
+                    android:id="@+id/sky_voice_call_calling_text"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="24dp"
+                    android:gravity="center"
+                    android:text="@string/call_in_calling"
+                    android:textColor="@color/white"
+                    android:textSize="48sp" />
+
+                <TextView
+                    android:id="@+id/sky_voice_call_timeout"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="24dp"
+                    android:gravity="center"
+                    android:textColor="@color/white"
+                    android:textSize="36sp" />
+            </LinearLayout>
+
+            <!--呼出-->
+            <LinearLayout
+                android:id="@+id/sky_voice_call_outgoing"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="120dp"
+                android:gravity="center_horizontal"
+                android:orientation="vertical"
+                android:visibility="visible">
+
+                <Chronometer
+                    android:id="@+id/sky_voice_call_timer"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:text="00:00"
+                    android:textColor="@color/white"
+                    android:textSize="32sp" />
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_hangup"
+                    android:layout_width="120dp"
+                    android:layout_height="120dp"
+                    android:layout_marginTop="20dp"
+                    android:src="@drawable/selector_call_hangup" />
+            </LinearLayout>
+
+            <!--来电-->
+            <LinearLayout
+                android:id="@+id/sky_voice_call_incoming"
+                android:layout_width="match_parent"
+                android:layout_height="140dp"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="120dp"
+                android:gravity="bottom"
+                android:orientation="horizontal"
+                android:visibility="gone">
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_ring_reject"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_hangup" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="1" />
+
+                <ImageView
+                    android:id="@+id/sky_voice_call_ring_pickup_audio"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_answer" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
+            </LinearLayout>
+        </RelativeLayout>
+    </FrameLayout>
+</layout>

+ 0 - 0
android_door/src/main/h10_a133_chile/res/layout/spinner_item.xml


Vissa filer visades inte eftersom för många filer har ändrats