Преглед изворни кода

修改7寸分机最终确认界面效果

weizhengliang пре 2 година
родитељ
комит
a5d0907371

+ 9 - 10
android_bed/src/main/h7_3128/java/com/wdkl/app/ncs/callingbed/fragment/QrCodeFragment.kt

@@ -25,7 +25,6 @@ import com.wdkl.ncs.android.middleware.logic.contract.callingbed.QrCodeFragmentC
 import com.wdkl.ncs.android.middleware.logic.presenter.callingbed.QrCodeFragmentPresenter
 import com.wdkl.ncs.android.middleware.utils.StringUtil
 import kotlinx.android.synthetic.main.qr_code_lay.*
-import kotlinx.android.synthetic.main.view_bed_name.*
 import java.io.DataOutputStream
 import java.io.IOException
 
@@ -48,15 +47,13 @@ class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrCodeLayBinding>()
     }
 
     override fun init() {
-        if (Constant.DEVICE_STATUS == 0) {
+        /*if (Constant.DEVICE_STATUS == 0) {
             tv_bed_name.setText(R.string.device_disable)
             tv_bed_name.setTextColor(resources.getColor(R.color.red_color))
         } else {
             tv_bed_name.text = Constant.BED_NAME
             tv_bed_name.setTextColor(resources.getColor(R.color.main_color))
-        }
-
-        tv_version.text = "V"+BuildConfig.VERSION_NAME+"_"+BuildConfig.VERSION_CODE
+        }*/
 
         Thread{
             //val logoBitmap = BitmapFactory.decodeResource(resources, R.mipmap.erlogo)
@@ -76,11 +73,13 @@ class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrCodeLayBinding>()
             builder.append(Constant.DEVICE_TYPE)
             builder.append("&device_name=")
             builder.append(Constant.DEVICE_NAME)
-            val code = EcodeHelper().createQRImage(builder.toString(),180, null)
+            val code = EcodeHelper().createQRImage(builder.toString(),200, null)
             activity.runOnUiThread {
                 view_qr_code?.setImageBitmap(code)
             }
         }.start()
+
+        tv_bed.text = "Bed: " + Constant.BED_NAME
         //val macAddr = NetHelper.getInstance().macAddress
         val ipAddr = NetHelper.getInstance().localIP
         if (Constant.DEVICE_STATUS == 0) {
@@ -94,7 +93,7 @@ class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrCodeLayBinding>()
         val serverIp =  UrlManager.build().base.substringAfterLast("//").substringBefore(":")
         tv_local_ip.text = "IP: " + ipAddr + " - " + serverIp
         tv_local_mac.text = "MAC: " + Constant.LOCAL_MAC
-        tv_app_version.text = "Version: V" + BuildConfig.VERSION_NAME + "_" + BuildConfig.VERSION_CODE + "_" + Build.MODEL + "\r\nAndroid SDK: " + Build.VERSION.SDK_INT
+        tv_app_version.text = "App Version: V" + BuildConfig.VERSION_NAME + "_" + BuildConfig.VERSION_CODE + "_" + Build.MODEL + "\r\nAndroid SDK: " + Build.VERSION.SDK_INT
 
         val wmanager: WindowManager = activity.windowManager
         val dm = DisplayMetrics()
@@ -158,14 +157,14 @@ class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrCodeLayBinding>()
             }
 
             if (clickTimes > 9) {
-                openNetwrokDebug()
+                openNetworkDebug()
                 clickTimes = 1
             }
             clickTime = time
         }
 
         //点击10次床位textview进入系统设置
-        tv_bed_name.setOnClickListener {
+        tv_about_me.setOnClickListener {
             (activity as CallingbedActivity).resetSleepTime()
 
             val time = System.currentTimeMillis()
@@ -208,7 +207,7 @@ class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrCodeLayBinding>()
     }
 
     //开启网络调试
-    private fun openNetwrokDebug() {
+    private fun openNetworkDebug() {
         val commands = arrayListOf(
             "/system/bin/sh",
             "setprop service.adb.tcp.port 5555",

+ 1 - 1
android_bed/src/main/h7_3128/res/layout/callingbed2_main_lay.xml

@@ -146,7 +146,7 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_marginTop="10dp"
-            android:layout_marginBottom="10dp"
+            android:layout_marginBottom="6dp"
             android:layout_marginRight="10dp"
             android:layout_toRightOf="@id/rl_left_view"
             android:layout_above="@id/ll_bottom"

+ 22 - 58
android_bed/src/main/h7_3128/res/layout/main_view2_layout.xml

@@ -10,7 +10,7 @@
 
     <LinearLayout
         android:id="@+id/ll_doctor_nurse_view"
-        android:layout_width="180dp"
+        android:layout_width="200dp"
         android:layout_height="match_parent"
         android:layout_below="@id/lay_main_bed_name"
         android:layout_alignParentRight="true"
@@ -22,7 +22,7 @@
             android:id="@+id/ll_doctor_view"
             android:layout_width="match_parent"
             android:layout_height="0dp"
-            android:layout_weight="1"
+            android:layout_weight="8"
             android:gravity="center"
             android:orientation="vertical"
             android:background="@color/white">
@@ -55,8 +55,8 @@
             android:id="@+id/ll_nurse_view"
             android:layout_width="match_parent"
             android:layout_height="0dp"
-            android:layout_weight="1"
-            android:layout_marginTop="10dp"
+            android:layout_weight="8"
+            android:layout_marginTop="6dp"
             android:gravity="center"
             android:orientation="vertical"
             android:background="@color/white">
@@ -83,6 +83,19 @@
                 android:textSize="24sp"
                 android:text="@string/nurse_title"/>
         </LinearLayout>
+
+        <TextView
+            android:id="@+id/tv_version"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="2"
+            android:layout_marginTop="4dp"
+            android:background="@color/white"
+            android:gravity="center"
+            android:textColor="@color/black"
+            android:textSize="12sp"
+            android:text="v--"
+            android:visibility="gone"/>
     </LinearLayout>
 
 
@@ -253,71 +266,22 @@
 
             <com.wdkl.ncs.android.lib.widget.MarqueeTextView
                 android:id="@+id/tv_custom_name"
-                android:layout_width="380dp"
+                android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_above="@id/ll_nurse_more"
-                android:paddingLeft="4dp"
-                android:paddingRight="4dp"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
                 android:gravity="center"
                 android:ellipsize="marquee"
                 android:focusable="true"
                 android:focusableInTouchMode="true"
                 android:marqueeRepeatLimit="-1"
                 android:singleLine="true"
-                android:textSize="120sp"
+                android:textSize="132sp"
                 android:textColor="@color/main_color"
                 android:textStyle="bold"
                 android:text="---"/>
 
-            <LinearLayout
-                android:id="@+id/ll_custom_no"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_above="@id/ll_nurse_more"
-                android:layout_toRightOf="@id/tv_custom_name"
-                android:paddingTop="8dp"
-                android:paddingBottom="8dp"
-                android:paddingLeft="8dp"
-                android:gravity="center_vertical"
-                android:orientation="vertical">
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content">
-                    <TextView
-                        android:id="@+id/tv_custom_age"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:textSize="28sp"
-                        android:text="--"/>
-                    <TextView
-                        android:id="@+id/tv_custom_gender"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="10dp"
-                        android:textSize="28sp"
-                        android:text="-"/>
-                </LinearLayout>
-
-                <TextView
-                    android:id="@+id/tv_custom_indate"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="10dp"
-                    android:textSize="20sp"
-                    android:textColor="#131313"
-                    android:text="@string/indate"/>
-
-                <TextView
-                    android:id="@+id/tv_custom_card_no"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="10dp"
-                    android:textSize="20sp"
-                    android:textColor="#131313"
-                    android:text=""/>
-            </LinearLayout>
-
             <!--<TextView
                 android:id="@+id/tv_order_title"
                 android:layout_width="match_parent"
@@ -335,7 +299,7 @@
                 android:id="@+id/tv_order_content"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:layout_below="@id/ll_custom_no"
+                android:layout_below="@id/tv_custom_name"
                 android:layout_above="@id/ll_nurse_more"
                 android:layout_marginTop="20dp"
                 android:padding="10dp"

+ 19 - 16
android_bed/src/main/h7_3128/res/layout/qr_code_lay.xml

@@ -5,23 +5,20 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-    <include android:id="@+id/lay_qr_bed_name"
-        layout="@layout/view_bed_name"/>
-
     <LinearLayout
         android:id="@+id/ll_qr_code_view"
-        android:layout_width="500dp"
+        android:layout_width="440dp"
         android:layout_height="match_parent"
-        android:layout_below="@id/lay_qr_bed_name"
         android:layout_marginTop="6dp"
         android:layout_marginBottom="6dp"
         android:gravity="center_vertical"
         android:background="@color/white"
-        android:orientation="horizontal">
+        android:orientation="vertical">
         <ImageView
             android:id="@+id/view_qr_code"
-            android:layout_width="180dp"
-            android:layout_height="180dp" />
+            android:layout_width="200dp"
+            android:layout_height="200dp"
+            android:layout_gravity="center"/>
 
         <ScrollView
             android:layout_width="match_parent"
@@ -33,6 +30,15 @@
                 android:orientation="vertical">
 
                 <TextView
+                    android:id="@+id/tv_bed"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="10dp"
+                    android:text="Bed:"
+                    android:textColor="@color/black"
+                    android:textSize="20sp" />
+
+                <TextView
                     android:id="@+id/tv_device_id"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
@@ -78,7 +84,7 @@
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="10dp"
                     android:layout_marginTop="4dp"
-                    android:text="Version:"
+                    android:text="App Version:"
                     android:textColor="@color/black"
                     android:textSize="20sp" />
 
@@ -100,7 +106,6 @@
         android:layout_height="match_parent"
         android:background="@color/white"
         android:layout_toRightOf="@id/ll_qr_code_view"
-        android:layout_below="@id/lay_qr_bed_name"
         android:layout_marginTop="6dp"
         android:layout_marginBottom="6dp"
         android:layout_marginLeft="10dp"
@@ -110,7 +115,8 @@
         <ScrollView
             android:id="@+id/device_action_view"
             android:layout_width="match_parent"
-            android:layout_height="match_parent">
+            android:layout_height="220dp"
+            android:layout_alignParentBottom="true">
 
             <LinearLayout
                 android:layout_width="match_parent"
@@ -197,8 +203,7 @@
             android:layout_height="wrap_content"
             android:text="@string/product_desc"
             android:textColor="@color/black"
-            android:textSize="22sp"
-            android:visibility="gone"/>
+            android:textSize="24sp" />
 
         <TextView
             android:id="@+id/tv_about_me"
@@ -210,8 +215,7 @@
             android:layout_marginBottom="10dp"
             android:text="@string/str_empty"
             android:textColor="#949494"
-            android:textSize="20sp"
-            android:visibility="gone"/>
+            android:textSize="22sp" />
     </RelativeLayout>
 
     <!--camera预览-->
@@ -220,7 +224,6 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_toRightOf="@id/ll_qr_code_view"
-        android:layout_below="@id/lay_qr_bed_name"
         android:layout_marginTop="6dp"
         android:layout_marginBottom="6dp"
         android:layout_marginLeft="10dp"

+ 45 - 13
android_bed/src/main/h7_3128/res/layout/view_bed_name.xml

@@ -2,17 +2,17 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="188dp">
+    android:layout_height="178dp"
+    android:background="@color/white">
 
     <com.wdkl.ncs.android.lib.widget.MarqueeTextView
         android:id="@+id/tv_bed_name"
         android:layout_width="0dp"
         android:layout_height="match_parent"
-        android:layout_weight="1"
+        android:layout_weight="5.2"
         android:layout_marginTop="-10dp"
         android:paddingLeft="10dp"
         android:paddingRight="10dp"
-        android:background="@color/white"
         android:gravity="center"
         android:ellipsize="marquee"
         android:focusable="true"
@@ -20,18 +20,50 @@
         android:marqueeRepeatLimit="-1"
         android:singleLine="true"
         android:textColor="@color/main_color"
-        android:textSize="160sp"
+        android:textSize="140sp"
         android:textStyle="bold"
         android:text="--"/>
 
-    <TextView
-        android:id="@+id/tv_version"
-        android:layout_width="wrap_content"
+    <LinearLayout
+        android:id="@+id/ll_custom_no"
+        android:layout_width="0dp"
         android:layout_height="match_parent"
-        android:padding="6dp"
-        android:background="@color/white"
-        android:gravity="bottom"
-        android:textColor="@color/black"
-        android:textSize="18sp"
-        android:text="v--"/>
+        android:layout_weight="1.8"
+        android:padding="8dp"
+        android:gravity="center_vertical"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <TextView
+                android:id="@+id/tv_custom_age"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="28sp" />
+            <TextView
+                android:id="@+id/tv_custom_gender"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:textSize="28sp" />
+        </LinearLayout>
+
+        <TextView
+            android:id="@+id/tv_custom_indate"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:textSize="20sp"
+            android:textColor="#131313" />
+
+        <TextView
+            android:id="@+id/tv_custom_card_no"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:textSize="20sp"
+            android:textColor="#131313" />
+    </LinearLayout>
+
 </LinearLayout>