Browse Source

去掉按键功能,增加版本号显示,其他修改

weizhengliang 3 năm trước cách đây
mục cha
commit
7885acf21b

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

@@ -110,6 +110,6 @@ class Application : BaseApplication() {
         //xCrash catcher
         //xCrash catcher
         XCrashUtils().init(this)
         XCrashUtils().init(this)
 
 
-        Utils.checkCameraSupport()
+        //Utils.checkCameraSupport()
     }
     }
 }
 }

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

@@ -511,7 +511,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     }
     }
 
 
     //开启网络调试
     //开启网络调试
-    private fun openNetwrokDebug() {
+    public fun openNetwrokDebug() {
         val commands = arrayListOf(
         val commands = arrayListOf(
             "/system/bin/sh",
             "/system/bin/sh",
             "setprop service.adb.tcp.port 5555",
             "setprop service.adb.tcp.port 5555",
@@ -582,7 +582,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
 
 
     //数据加载错误
     //数据加载错误
     override fun onError(message: String, type: Int) {
     override fun onError(message: String, type: Int) {
-        errorLog("error",message)
         showMessage("数据加载错误")
         showMessage("数据加载错误")
     }
     }
 
 
@@ -793,7 +792,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                 UpdateTipsDialogHelper.showDialog(activity)
                 UpdateTipsDialogHelper.showDialog(activity)
             } else {
             } else {
                 if (!Constant.APP_UPDATING) {
                 if (!Constant.APP_UPDATING) {
-                    showMessage("正在升级...")
                     Constant.APP_UPDATING = true
                     Constant.APP_UPDATING = true
                     Constant.APP_PATH = appInfo.appPath
                     Constant.APP_PATH = appInfo.appPath
                     AppTool.Time.delay(200) {
                     AppTool.Time.delay(200) {
@@ -803,8 +801,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                     showMessage("正在升级中...")
                     showMessage("正在升级中...")
                 }
                 }
             }
             }
-        } else {
-            showMessage("当前已是最新版本")
         }
         }
     }
     }
 
 
@@ -834,7 +830,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
 
 
     override fun serialPortBedOnclick(buffer: ByteArray) {
     override fun serialPortBedOnclick(buffer: ByteArray) {
         Log.d("serialPortBedOnclick", "面板按键: " + buffer[0])
         Log.d("serialPortBedOnclick", "面板按键: " + buffer[0])
-        if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2) {
+        /*if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2) {
             //面板呼叫键
             //面板呼叫键
             runOnUiThread {
             runOnUiThread {
                 if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
                 if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
@@ -843,15 +839,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                     } else {
                     } else {
                         showMessage("当前设备可能未注册,不能呼叫")
                         showMessage("当前设备可能未注册,不能呼叫")
                     }
                     }
-                } /*else if (Constant.CALL_STATE == Constant.CALL_INCOMING) {
-                    inCalling()
-                } else if (Constant.CALL_STATE == Constant.CALL_CALLING) {
-                    hangupCall()
-                } else if (Constant.CALL_STATE == Constant.CALL_OUTGOING) {
-                    cancelCall()
-                }*/
+                }
             }
             }
-        }
+        }*/
     }
     }
 
 
     override fun serialPortSOSCall(status: String?) {
     override fun serialPortSOSCall(status: String?) {
@@ -1049,7 +1039,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
             view_title_layout_tv_no.setTextColor(Constant.colorBoy)
             view_title_layout_tv_no.setTextColor(Constant.colorBoy)
         }
         }
 
 
-        if (Constant.day_state == 0) {
+        if (Constant.day_state == 1) {
             //晚上
             //晚上
             if (Constant.babyGirl) {
             if (Constant.babyGirl) {
                 view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night_red)
                 view_title_layout_iv_day_night.setImageResource(R.mipmap.ic_night_red)

+ 8 - 1
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/BaseCallFragment.kt

@@ -4,6 +4,7 @@ import android.os.Bundle
 import android.os.CountDownTimer
 import android.os.CountDownTimer
 import android.support.v4.app.Fragment
 import android.support.v4.app.Fragment
 import android.view.LayoutInflater
 import android.view.LayoutInflater
+import android.view.MotionEvent
 import android.view.View
 import android.view.View
 import android.view.ViewGroup
 import android.view.ViewGroup
 import android.widget.TextView
 import android.widget.TextView
@@ -17,7 +18,7 @@ import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
 import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
 import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
 import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.EventBus
 
 
-abstract class BaseCallFragment: Fragment() {
+abstract class BaseCallFragment: Fragment(), View.OnTouchListener {
 
 
     private var layout: View? = null
     private var layout: View? = null
 
 
@@ -58,6 +59,8 @@ abstract class BaseCallFragment: Fragment() {
 
 
         init()
         init()
         bindEvent()
         bindEvent()
+
+        view!!.setOnTouchListener(this)
     }
     }
 
 
     override fun onDestroyView() {
     override fun onDestroyView() {
@@ -85,6 +88,10 @@ abstract class BaseCallFragment: Fragment() {
 
 
     protected abstract fun callEnd(handoff: Boolean)
     protected abstract fun callEnd(handoff: Boolean)
 
 
+    override fun onTouch(v: View?, event: MotionEvent?): Boolean {
+        return true
+    }
+
     //初始化计时器
     //初始化计时器
     protected fun initCountDownTimer(view: TextView) {
     protected fun initCountDownTimer(view: TextView) {
         val overTime = SettingConfig.getSipOverTime(baseActivity) * 1000L
         val overTime = SettingConfig.getSipOverTime(baseActivity) * 1000L

+ 19 - 1
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/YzMainFragment.kt

@@ -1,8 +1,12 @@
 package com.wdkl.app.ncs.callingdoor.fragment
 package com.wdkl.app.ncs.callingdoor.fragment
 
 
 import com.enation.javashop.net.engine.model.NetState
 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.R
+import com.wdkl.app.ncs.callingdoor.activity.CallingdoorActivity
 import com.wdkl.app.ncs.callingdoor.databinding.MainViewLayoutBinding
 import com.wdkl.app.ncs.callingdoor.databinding.MainViewLayoutBinding
+import com.wdkl.app.ncs.callingdoor.helper.AppInfoDialogHelper
+import com.wdkl.app.ncs.callingdoor.helper.AppUpdateHelper
 import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
 import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
 import com.wdkl.ncs.android.lib.base.BaseFragment
 import com.wdkl.ncs.android.lib.base.BaseFragment
 import com.wdkl.ncs.android.lib.utils.TimeHandle
 import com.wdkl.ncs.android.lib.utils.TimeHandle
@@ -30,10 +34,24 @@ class YzMainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>
     }
     }
 
 
     override fun init() {
     override fun init() {
+        tv_version_no.text = "V" + BuildConfig.VERSION_NAME + "_" + BuildConfig.VERSION_CODE
         updateInfo()
         updateInfo()
     }
     }
 
 
     override fun bindEvent() {
     override fun bindEvent() {
+        tv_version_no.setOnLongClickListener {
+            AppInfoDialogHelper.showAppDialog(activity,
+                { dialog, which -> AppUpdateHelper.reboot(activity) },
+                { dialog, which ->
+                    Constant.silentUpdate = false
+                    (activity as CallingdoorActivity).checkAppVersion()
+                }, { dialog, which ->
+                    showMessage("开启调试")
+                    (activity as CallingdoorActivity).openNetwrokDebug()
+                })
+
+            return@setOnLongClickListener true
+        }
     }
     }
 
 
     override fun destory() {
     override fun destory() {
@@ -82,7 +100,7 @@ class YzMainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>
 
 
             if (bedVO.customerInDate != null) {
             if (bedVO.customerInDate != null) {
                 val inDate = TimeHandle.getDateTime(bedVO.customerInDate*1000, "yyyy年MM月dd日")
                 val inDate = TimeHandle.getDateTime(bedVO.customerInDate*1000, "yyyy年MM月dd日")
-                tv_in_date.setText("入住日期: " + inDate)
+                tv_in_date.setText("入住时间: " + inDate)
             }
             }
             if (bedVO.customerOutDate != null) {
             if (bedVO.customerOutDate != null) {
                 val outDate = TimeHandle.getDateTime(bedVO.customerOutDate*1000, "yyyy年MM月dd日")
                 val outDate = TimeHandle.getDateTime(bedVO.customerOutDate*1000, "yyyy年MM月dd日")

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

@@ -29,7 +29,7 @@ public class UpdateTipsDialogHelper {
         builder.setView(contentView);
         builder.setView(contentView);
         Button buttonCancel = contentView.findViewById(R.id.cancel_button);
         Button buttonCancel = contentView.findViewById(R.id.cancel_button);
         Button buttonConfirm = contentView.findViewById(R.id.confirm_button);
         Button buttonConfirm = contentView.findViewById(R.id.confirm_button);
-        final CountDownTimer timer = new CountDownTimer(15000, 1000) {
+        final CountDownTimer timer = new CountDownTimer(30000, 1000) {
 
 
             @Override
             @Override
             public void onTick(long millisUntilFinished) {
             public void onTick(long millisUntilFinished) {

+ 14 - 3
callingdoor/src/main/res/layout/yz_main_view_layout.xml

@@ -113,12 +113,11 @@
         </LinearLayout>
         </LinearLayout>
     </RelativeLayout>
     </RelativeLayout>
 
 
-    <LinearLayout
+    <RelativeLayout
         android:layout_width="0dp"
         android:layout_width="0dp"
         android:layout_height="match_parent"
         android:layout_height="match_parent"
         android:layout_weight="1.2"
         android:layout_weight="1.2"
         android:layout_marginStart="10dp"
         android:layout_marginStart="10dp"
-        android:gravity="center_horizontal"
         android:background="@color/white"
         android:background="@color/white"
         android:orientation="vertical">
         android:orientation="vertical">
 
 
@@ -127,6 +126,7 @@
             android:layout_width="wrap_content"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginTop="60dp"
             android:layout_marginTop="60dp"
+            android:layout_centerHorizontal="true"
             android:src="@mipmap/ic_nurse_2"/>
             android:src="@mipmap/ic_nurse_2"/>
 
 
         <TextView
         <TextView
@@ -134,11 +134,22 @@
             android:layout_width="wrap_content"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginTop="20dp"
             android:layout_marginTop="20dp"
+            android:layout_below="@id/img_nurse_icon"
+            android:layout_centerHorizontal="true"
             android:text="责护"
             android:text="责护"
             android:textSize="24sp"
             android:textSize="24sp"
             android:textColor="@color/text_color_girl"/>
             android:textColor="@color/text_color_girl"/>
 
 
-    </LinearLayout>
+        <TextView
+            android:id="@+id/tv_version_no"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:layout_alignParentRight="true"
+            android:padding="10dp"
+            android:text="V--"/>
+
+    </RelativeLayout>
 
 
 </LinearLayout>
 </LinearLayout>
 </layout>
 </layout>