Browse Source

中兴8寸分机增加是否同步NTP服务器时间开关,解决同步时间异常问题

weizhengliang 1 year ago
parent
commit
1a5d6cd020

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

@@ -237,20 +237,20 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
             view_title_layout_tv_sip.visibility = View.GONE
             view_title_layout_tv_sip.visibility = View.GONE
         }
         }
 
 
-        if (BuildConfig.device_type.equals("3")){
+        if (BuildConfig.device_type.equals("3")) {
             menu_medical_care.visibility = View.GONE
             menu_medical_care.visibility = View.GONE
             menu_more.visibility = View.GONE
             menu_more.visibility = View.GONE
             menu_support.visibility = View.GONE
             menu_support.visibility = View.GONE
 
 
-       if (!apartmentFragment.equals(curFragment)) {
-            switchFragment(R.id.callingbed_main_frame, apartmentFragment(), apartmentFragment)
-            updateLeftBtState(apartmentFragment)
-             }
-        }else{
-          if (!mainFragment.equals(curFragment)) {
-            switchFragment(R.id.callingbed_main_frame, MainFragment(), mainFragment)
-            updateLeftBtState(mainFragment)
-             }
+            if (!apartmentFragment.equals(curFragment)) {
+                switchFragment(R.id.callingbed_main_frame, ApartmentFragment(), apartmentFragment)
+                updateLeftBtState(apartmentFragment)
+            }
+        } else {
+            if (!mainFragment.equals(curFragment)) {
+                switchFragment(R.id.callingbed_main_frame, MainFragment(), mainFragment)
+                updateLeftBtState(mainFragment)
+            }
         }
         }
 
 
         main_rl_3.isEnabled = false
         main_rl_3.isEnabled = false
@@ -312,6 +312,15 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
         //3288 10.1寸竖屏:width=800,  height=1280
         //3288 10.1寸竖屏:width=800,  height=1280
         Log.d(TAG, "device orientation: ${Constant.DEVICE_ORIENTATION}, width: ${dm.widthPixels}, height: ${dm.heightPixels}")
         Log.d(TAG, "device orientation: ${Constant.DEVICE_ORIENTATION}, width: ${dm.widthPixels}, height: ${dm.heightPixels}")
 
 
+        if ("YUNPAI_H6".equals(Build.MODEL)) {
+            Thread {
+                if (SettingConfig.getSyncNtpTime(activity)) {
+                    Utils.setAutoSyncNtpTime(true)
+                } else {
+                    Utils.setAutoSyncNtpTime(false)
+                }
+            }.start()
+        }
     }
     }
 
 
 
 
@@ -552,7 +561,7 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
             //首页
             //首页
             if (BuildConfig.device_type.equals("3")){
             if (BuildConfig.device_type.equals("3")){
                 if (!apartmentFragment.equals(curFragment)) {
                 if (!apartmentFragment.equals(curFragment)) {
-                    switchFragment(R.id.callingbed_main_frame, apartmentFragment(), apartmentFragment)
+                    switchFragment(R.id.callingbed_main_frame, ApartmentFragment(), apartmentFragment)
                     updateLeftBtState(apartmentFragment)
                     updateLeftBtState(apartmentFragment)
                 }
                 }
             }else{
             }else{
@@ -797,7 +806,7 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
         //显示床位信息界面
         //显示床位信息界面
         if (BuildConfig.device_type.equals("3")){
         if (BuildConfig.device_type.equals("3")){
             if (!apartmentFragment.equals(curFragment)) {
             if (!apartmentFragment.equals(curFragment)) {
-                switchFragment(R.id.callingbed_main_frame, apartmentFragment(), apartmentFragment)
+                switchFragment(R.id.callingbed_main_frame, ApartmentFragment(), apartmentFragment)
                 updateLeftBtState(apartmentFragment)
                 updateLeftBtState(apartmentFragment)
             }
             }
         }else{
         }else{
@@ -1659,6 +1668,12 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
                         SpeechUtil.getInstance().speak(getString(R.string.str_sign_fail))
                         SpeechUtil.getInstance().speak(getString(R.string.str_sign_fail))
                     } else if (tcpModel.type == TcpType.TIME) {
                     } else if (tcpModel.type == TcpType.TIME) {
                         if (tcpModel.action == TcpAction.TimeAction.SYNC) {
                         if (tcpModel.action == TcpAction.TimeAction.SYNC) {
+                            if ("YUNPAI_H6".equals(Build.MODEL)) {
+                                if (SettingConfig.getSyncNtpTime(BaseApplication.appContext)) {
+                                    return
+                                }
+                            }
+
                             var time = 0L
                             var time = 0L
                             var timeZone = "Asia/Shanghai"
                             var timeZone = "Asia/Shanghai"
                             if (canParseJson(tcpModel.data.toString())) {
                             if (canParseJson(tcpModel.data.toString())) {

+ 20 - 0
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/SystemActivity.kt

@@ -164,6 +164,16 @@ class SystemActivity : BaseActivity<SystemActivityPresenter, CallingbedSettingMa
                 EventBus.getDefault().post(MessageEvent("sleep_off", Constant.EVENT_SLEEP_STOP))
                 EventBus.getDefault().post(MessageEvent("sleep_off", Constant.EVENT_SLEEP_STOP))
             }
             }
         }
         }
+
+        switch_ntp_time.setOnCheckedChangeListener { buttonView, isChecked ->
+            if (isChecked) {
+                SettingConfig.setSyncNtpTime(activity, true)
+                Utils.setAutoSyncNtpTime(true)
+            } else {
+                SettingConfig.setSyncNtpTime(activity, false)
+                Utils.setAutoSyncNtpTime(false)
+            }
+        }
     }
     }
 
 
     private fun checkBluetoothPermission(): Boolean {
     private fun checkBluetoothPermission(): Boolean {
@@ -278,6 +288,16 @@ class SystemActivity : BaseActivity<SystemActivityPresenter, CallingbedSettingMa
         switch_433.isChecked = SettingConfig.get433GatewayOn(activity)
         switch_433.isChecked = SettingConfig.get433GatewayOn(activity)
 
 
         switch_sleep.isChecked = SettingConfig.getSLEEPGatewayOn(activity)
         switch_sleep.isChecked = SettingConfig.getSLEEPGatewayOn(activity)
+
+        if ("YUNPAI_H6".equals(Build.MODEL)) {
+            ll_ntp_switch.visibility = View.VISIBLE
+        }
+
+        if (SettingConfig.getSyncNtpTime(activity)) {
+            switch_ntp_time.isChecked = true
+        } else {
+            switch_ntp_time.isChecked = false
+        }
     }
     }
     //设置二维码
     //设置二维码
     private fun setQrcode(){
     private fun setQrcode(){

+ 1 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/di/CallingbedComponent.kt

@@ -50,7 +50,7 @@ interface CallingbedComponent {
 
 
     fun inject(fragment: MainFragment)
     fun inject(fragment: MainFragment)
 
 
-    fun inject(fragment: apartmentFragment)
+    fun inject(fragment: ApartmentFragment)
 
 
     fun inject(fragment: VoiceMsgFragment)
     fun inject(fragment: VoiceMsgFragment)
 
 

+ 1 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/apartmentFragment.kt

@@ -41,7 +41,7 @@ import org.greenrobot.eventbus.ThreadMode
 /**
 /**
  * 公寓首页
  * 公寓首页
  * */
  * */
-class  apartmentFragment: BaseFragment<BedMainFragmentPresenter, MainView3LayoutBinding>(), BedMainFragmentContract.View {
+class  ApartmentFragment: BaseFragment<BedMainFragmentPresenter, MainView3LayoutBinding>(), BedMainFragmentContract.View {
     val TAG = "MainFragment"
     val TAG = "MainFragment"
     private lateinit var nurseConfigAdpter: NurseConfigAdpter
     private lateinit var nurseConfigAdpter: NurseConfigAdpter
     private var clickTime: Long = 0
     private var clickTime: Long = 0

+ 21 - 0
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/helper/Utils.java

@@ -13,6 +13,8 @@ import com.wdkl.app.ncs.callingbed.BuildConfig;
 import com.wdkl.ncs.android.lib.base.BaseApplication;
 import com.wdkl.ncs.android.lib.base.BaseApplication;
 import com.wdkl.ncs.android.middleware.common.Constant;
 import com.wdkl.ncs.android.middleware.common.Constant;
 
 
+import java.io.DataOutputStream;
+import java.io.IOException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
 
 
 public class Utils {
 public class Utils {
@@ -107,4 +109,23 @@ public class Utils {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
     }
     }
+
+    public static void setAutoSyncNtpTime(boolean enable) {
+        try {
+            Process process = Runtime.getRuntime().exec("su");
+            if (null == process) return;
+            DataOutputStream os = new DataOutputStream(process.getOutputStream());
+            if (enable) {
+                os.writeBytes("settings put global auto_time_zone 1\n");
+                os.writeBytes("settings put global auto_time 1\n");
+            } else {
+                os.writeBytes("settings put global auto_time_zone 0\n");
+                os.writeBytes("settings put global auto_time 0\n");
+            }
+            os.writeBytes("exit\n");
+            os.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
 }
 }

+ 10 - 0
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/settings/SettingConfig.java

@@ -104,6 +104,8 @@ public class SettingConfig {
     //是否开启声网自动接听
     //是否开启声网自动接听
     private static final String KEY_SP_SW_CALL = "KEY_SP_SW_CALL";
     private static final String KEY_SP_SW_CALL = "KEY_SP_SW_CALL";
 
 
+    private static final String KEY_SP_SYNC_NTP_TIME = "KEY_SP_SYNC_NTP_TIME";
+
     public static void setSwCall(Context context, boolean on) {
     public static void setSwCall(Context context, boolean on) {
         getEditor(context).putBoolean(KEY_SP_SW_CALL, on).apply();
         getEditor(context).putBoolean(KEY_SP_SW_CALL, on).apply();
     }
     }
@@ -221,6 +223,14 @@ public class SettingConfig {
         getEditor(context).putBoolean(KEY_SP_SIP_ENABLE, enable).apply();
         getEditor(context).putBoolean(KEY_SP_SIP_ENABLE, enable).apply();
     }
     }
 
 
+    public static boolean getSyncNtpTime(Context context) {
+        return getSP(context).getBoolean(KEY_SP_SYNC_NTP_TIME, true);
+    }
+
+    public static void setSyncNtpTime(Context context, boolean enable) {
+        getEditor(context).putBoolean(KEY_SP_SYNC_NTP_TIME, enable).apply();
+    }
+
     /**
     /**
      * 获取分机白天亮度
      * 获取分机白天亮度
      *
      *

+ 207 - 176
android_bed/src/main/res/layout-land/callingbed_setting_main.xml

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android">
 <layout xmlns:android="http://schemas.android.com/apk/res/android">
+
     <LinearLayout
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_height="match_parent"
-        android:orientation="vertical"
-        android:background="#F7F7F7">
+        android:background="#F7F7F7"
+        android:orientation="vertical">
 
 
         <include
         <include
             android:id="@+id/activity_calling_door_layout_title"
             android:id="@+id/activity_calling_door_layout_title"
@@ -13,31 +14,31 @@
         <RelativeLayout
         <RelativeLayout
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="@dimen/d220"
             android:layout_height="@dimen/d220"
-            android:background="@drawable/shape_bed_bg"
-            android:layout_marginTop="@dimen/d20"
             android:layout_marginLeft="@dimen/d15"
             android:layout_marginLeft="@dimen/d15"
+            android:layout_marginTop="@dimen/d20"
             android:layout_marginRight="@dimen/d24"
             android:layout_marginRight="@dimen/d24"
-            android:orientation="vertical"
-            >
+            android:background="@drawable/shape_bed_bg"
+            android:orientation="vertical">
+
             <ImageView
             <ImageView
                 android:id="@+id/settings_img"
                 android:id="@+id/settings_img"
                 android:layout_width="@dimen/d24"
                 android:layout_width="@dimen/d24"
                 android:layout_height="@dimen/d24"
                 android:layout_height="@dimen/d24"
-                android:background="@mipmap/shbei"
+                android:layout_marginLeft="@dimen/d20"
                 android:layout_marginTop="@dimen/d16"
                 android:layout_marginTop="@dimen/d16"
-                android:layout_marginLeft="@dimen/d20" />
+                android:background="@mipmap/shbei" />
 
 
             <TextView
             <TextView
                 android:id="@+id/settings_tx_2"
                 android:id="@+id/settings_tx_2"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d10"
+                android:layout_marginTop="@dimen/d16"
                 android:layout_toRightOf="@+id/settings_img"
                 android:layout_toRightOf="@+id/settings_img"
                 android:text="@string/device_test"
                 android:text="@string/device_test"
-                android:textSize="@dimen/font_size_18"
-                android:layout_marginLeft="@dimen/d10"
                 android:textColor="@color/black"
                 android:textColor="@color/black"
-                android:textStyle="bold"
-                android:layout_marginTop="@dimen/d16" />
+                android:textSize="@dimen/font_size_18"
+                android:textStyle="bold" />
 
 
             <HorizontalScrollView
             <HorizontalScrollView
                 android:id="@+id/device_action_view"
                 android:id="@+id/device_action_view"
@@ -49,12 +50,12 @@
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
                     android:layout_height="match_parent"
-                    android:orientation="horizontal"
+                    android:layout_below="@+id/settings_img"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginTop="@dimen/d16"
                     android:layout_marginTop="@dimen/d16"
                     android:layout_marginBottom="@dimen/d26"
                     android:layout_marginBottom="@dimen/d26"
-                    android:layout_below="@+id/settings_img"
-                    >
+                    android:orientation="horizontal">
+
                     <LinearLayout
                     <LinearLayout
                         android:id="@+id/settings_main_1_ll"
                         android:id="@+id/settings_main_1_ll"
                         android:layout_width="@dimen/d165"
                         android:layout_width="@dimen/d165"
@@ -74,8 +75,8 @@
                         <TextView
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginLeft="@dimen/d6"
                             android:layout_marginLeft="@dimen/d6"
+                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginRight="@dimen/d6"
                             android:layout_marginRight="@dimen/d6"
                             android:singleLine="true"
                             android:singleLine="true"
                             android:text="@string/server_config"
                             android:text="@string/server_config"
@@ -94,192 +95,189 @@
                             android:textColor="#3A78EF"
                             android:textColor="#3A78EF"
                             android:textSize="@dimen/font_size_10" />
                             android:textSize="@dimen/font_size_10" />
                     </LinearLayout>
                     </LinearLayout>
+
                     <LinearLayout
                     <LinearLayout
                         android:id="@+id/settings_main_2_ll"
                         android:id="@+id/settings_main_2_ll"
                         android:layout_width="@dimen/d165"
                         android:layout_width="@dimen/d165"
                         android:layout_height="match_parent"
                         android:layout_height="match_parent"
-                        android:gravity="center_horizontal"
-                        android:orientation="vertical"
-                        android:clickable="true"
-                        android:background="@mipmap/wl_bg"
                         android:layout_marginRight="@dimen/d25"
                         android:layout_marginRight="@dimen/d25"
-                        >
+                        android:background="@mipmap/wl_bg"
+                        android:clickable="true"
+                        android:gravity="center_horizontal"
+                        android:orientation="vertical">
+
                         <ImageView
                         <ImageView
                             android:layout_width="@dimen/d30"
                             android:layout_width="@dimen/d30"
                             android:layout_height="@dimen/d30"
                             android:layout_height="@dimen/d30"
-                            android:src="@mipmap/wangluo"
                             android:layout_marginTop="@dimen/d22"
                             android:layout_marginTop="@dimen/d22"
-                            />
+                            android:src="@mipmap/wangluo" />
 
 
                         <TextView
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d6"
                             android:layout_marginLeft="@dimen/d6"
+                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginRight="@dimen/d6"
                             android:layout_marginRight="@dimen/d6"
                             android:singleLine="true"
                             android:singleLine="true"
                             android:text="@string/str_network_config"
                             android:text="@string/str_network_config"
-                            android:textSize="@dimen/font_size_14"
                             android:textColor="@color/white"
                             android:textColor="@color/white"
-                            android:textStyle="bold"
-                            android:layout_marginTop="@dimen/d12"
-                            />
+                            android:textSize="@dimen/font_size_14"
+                            android:textStyle="bold" />
 
 
                         <TextView
                         <TextView
                             android:id="@+id/settings_main_2_tx"
                             android:id="@+id/settings_main_2_tx"
                             android:layout_width="@dimen/d58"
                             android:layout_width="@dimen/d58"
                             android:layout_height="@dimen/d20"
                             android:layout_height="@dimen/d20"
-                            android:text="@string/str_start"
-                            android:textSize="@dimen/font_size_10"
-                            android:textColor="#57D64E"
-                            android:gravity="center"
                             android:layout_marginTop="@dimen/d21"
                             android:layout_marginTop="@dimen/d21"
                             android:background="@drawable/shape_n_login_ed_bg"
                             android:background="@drawable/shape_n_login_ed_bg"
-                            />
+                            android:gravity="center"
+                            android:text="@string/str_start"
+                            android:textColor="#57D64E"
+                            android:textSize="@dimen/font_size_10" />
                     </LinearLayout>
                     </LinearLayout>
 
 
                     <LinearLayout
                     <LinearLayout
                         android:id="@+id/settings_main_top_3_ll"
                         android:id="@+id/settings_main_top_3_ll"
                         android:layout_width="@dimen/d165"
                         android:layout_width="@dimen/d165"
                         android:layout_height="match_parent"
                         android:layout_height="match_parent"
-                        android:gravity="center_horizontal"
-                        android:orientation="vertical"
-                        android:clickable="true"
-                        android:background="@mipmap/yj_bg"
                         android:layout_marginRight="@dimen/d25"
                         android:layout_marginRight="@dimen/d25"
-                        >
+                        android:background="@mipmap/yj_bg"
+                        android:clickable="true"
+                        android:gravity="center_horizontal"
+                        android:orientation="vertical">
+
                         <ImageView
                         <ImageView
                             android:layout_width="@dimen/d30"
                             android:layout_width="@dimen/d30"
                             android:layout_height="@dimen/d30"
                             android:layout_height="@dimen/d30"
-                            android:src="@mipmap/boxsys"
                             android:layout_marginTop="@dimen/d22"
                             android:layout_marginTop="@dimen/d22"
-                            />
+                            android:src="@mipmap/boxsys" />
 
 
                         <TextView
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d6"
                             android:layout_marginLeft="@dimen/d6"
+                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginRight="@dimen/d6"
                             android:layout_marginRight="@dimen/d6"
                             android:singleLine="true"
                             android:singleLine="true"
                             android:text="@string/device_config"
                             android:text="@string/device_config"
-                            android:textSize="@dimen/font_size_14"
                             android:textColor="@color/white"
                             android:textColor="@color/white"
-                            android:textStyle="bold"
-                            android:layout_marginTop="@dimen/d12"
-                            />
+                            android:textSize="@dimen/font_size_14"
+                            android:textStyle="bold" />
 
 
                         <TextView
                         <TextView
                             android:id="@+id/settings_main_top_3_tx"
                             android:id="@+id/settings_main_top_3_tx"
                             android:layout_width="@dimen/d58"
                             android:layout_width="@dimen/d58"
                             android:layout_height="@dimen/d20"
                             android:layout_height="@dimen/d20"
-                            android:text="@string/str_start"
-                            android:textSize="@dimen/font_size_10"
-                            android:textColor="@color/main_color"
-                            android:gravity="center"
                             android:layout_marginTop="@dimen/d21"
                             android:layout_marginTop="@dimen/d21"
                             android:background="@drawable/shape_n_login_ed_bg"
                             android:background="@drawable/shape_n_login_ed_bg"
-                            />
+                            android:gravity="center"
+                            android:text="@string/str_start"
+                            android:textColor="@color/main_color"
+                            android:textSize="@dimen/font_size_10" />
                     </LinearLayout>
                     </LinearLayout>
+
                     <LinearLayout
                     <LinearLayout
                         android:id="@+id/settings_main_3_ll"
                         android:id="@+id/settings_main_3_ll"
                         android:layout_width="@dimen/d165"
                         android:layout_width="@dimen/d165"
                         android:layout_height="match_parent"
                         android:layout_height="match_parent"
-                        android:gravity="center_horizontal"
-                        android:orientation="vertical"
-                        android:clickable="true"
-                        android:background="@mipmap/tiaoshi_bg"
                         android:layout_marginRight="@dimen/d25"
                         android:layout_marginRight="@dimen/d25"
-                        >
+                        android:background="@mipmap/tiaoshi_bg"
+                        android:clickable="true"
+                        android:gravity="center_horizontal"
+                        android:orientation="vertical">
+
                         <ImageView
                         <ImageView
                             android:layout_width="@dimen/d30"
                             android:layout_width="@dimen/d30"
                             android:layout_height="@dimen/d30"
                             android:layout_height="@dimen/d30"
-                            android:src="@mipmap/tiaoshi"
                             android:layout_marginTop="@dimen/d22"
                             android:layout_marginTop="@dimen/d22"
-                            />
+                            android:src="@mipmap/tiaoshi" />
 
 
                         <TextView
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d6"
                             android:layout_marginLeft="@dimen/d6"
+                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginRight="@dimen/d6"
                             android:layout_marginRight="@dimen/d6"
                             android:singleLine="true"
                             android:singleLine="true"
                             android:text="@string/test_mode"
                             android:text="@string/test_mode"
-                            android:textSize="@dimen/font_size_14"
                             android:textColor="@color/white"
                             android:textColor="@color/white"
-                            android:textStyle="bold"
-                            android:layout_marginTop="@dimen/d12"
-                            />
+                            android:textSize="@dimen/font_size_14"
+                            android:textStyle="bold" />
 
 
                         <TextView
                         <TextView
                             android:id="@+id/settings_main_3_tx"
                             android:id="@+id/settings_main_3_tx"
                             android:layout_width="@dimen/d58"
                             android:layout_width="@dimen/d58"
                             android:layout_height="@dimen/d20"
                             android:layout_height="@dimen/d20"
-                            android:text="@string/str_start"
-                            android:textSize="@dimen/font_size_10"
-                            android:textColor="#FF924A"
-                            android:gravity="center"
                             android:layout_marginTop="@dimen/d21"
                             android:layout_marginTop="@dimen/d21"
                             android:background="@drawable/shape_n_login_ed_bg"
                             android:background="@drawable/shape_n_login_ed_bg"
-                            />
+                            android:gravity="center"
+                            android:text="@string/str_start"
+                            android:textColor="#FF924A"
+                            android:textSize="@dimen/font_size_10" />
                     </LinearLayout>
                     </LinearLayout>
+
                     <LinearLayout
                     <LinearLayout
                         android:id="@+id/settings_main_4_ll"
                         android:id="@+id/settings_main_4_ll"
                         android:layout_width="@dimen/d165"
                         android:layout_width="@dimen/d165"
                         android:layout_height="match_parent"
                         android:layout_height="match_parent"
-                        android:gravity="center_horizontal"
-                        android:orientation="vertical"
-                        android:clickable="true"
+                        android:layout_marginRight="@dimen/d25"
                         android:background="@mipmap/banben_bg"
                         android:background="@mipmap/banben_bg"
-                        android:layout_marginRight="@dimen/d25">
+                        android:clickable="true"
+                        android:gravity="center_horizontal"
+                        android:orientation="vertical">
+
                         <ImageView
                         <ImageView
                             android:layout_width="@dimen/d30"
                             android:layout_width="@dimen/d30"
                             android:layout_height="@dimen/d30"
                             android:layout_height="@dimen/d30"
-                            android:src="@mipmap/banben"
-                            android:layout_marginTop="@dimen/d22" />
+                            android:layout_marginTop="@dimen/d22"
+                            android:src="@mipmap/banben" />
 
 
                         <TextView
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d6"
                             android:layout_marginLeft="@dimen/d6"
+                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginRight="@dimen/d6"
                             android:layout_marginRight="@dimen/d6"
                             android:singleLine="true"
                             android:singleLine="true"
                             android:text="@string/str_app_update"
                             android:text="@string/str_app_update"
-                            android:textSize="@dimen/font_size_14"
                             android:textColor="@color/white"
                             android:textColor="@color/white"
-                            android:textStyle="bold"
-                            android:layout_marginTop="@dimen/d12" />
+                            android:textSize="@dimen/font_size_14"
+                            android:textStyle="bold" />
 
 
                         <TextView
                         <TextView
                             android:id="@+id/settings_main_4_tx"
                             android:id="@+id/settings_main_4_tx"
                             android:layout_width="@dimen/d58"
                             android:layout_width="@dimen/d58"
                             android:layout_height="@dimen/d20"
                             android:layout_height="@dimen/d20"
+                            android:layout_marginTop="@dimen/d21"
+                            android:background="@drawable/shape_n_login_ed_bg"
+                            android:gravity="center"
                             android:text="@string/str_start"
                             android:text="@string/str_start"
-                            android:textSize="@dimen/font_size_10"
                             android:textColor="#EE3B3B"
                             android:textColor="#EE3B3B"
-                            android:gravity="center"
-                            android:layout_marginTop="@dimen/d21"
-                            android:background="@drawable/shape_n_login_ed_bg" />
+                            android:textSize="@dimen/font_size_10" />
 
 
                     </LinearLayout>
                     </LinearLayout>
+
                     <LinearLayout
                     <LinearLayout
                         android:id="@+id/settings_main_5_ll"
                         android:id="@+id/settings_main_5_ll"
                         android:layout_width="@dimen/d165"
                         android:layout_width="@dimen/d165"
                         android:layout_height="match_parent"
                         android:layout_height="match_parent"
-                        android:gravity="center_horizontal"
-                        android:orientation="vertical"
-                        android:clickable="true"
+                        android:layout_marginRight="@dimen/d19"
                         android:background="@mipmap/cq_bg"
                         android:background="@mipmap/cq_bg"
-                        android:layout_marginRight="@dimen/d19">
+                        android:clickable="true"
+                        android:gravity="center_horizontal"
+                        android:orientation="vertical">
+
                         <ImageView
                         <ImageView
                             android:layout_width="@dimen/d30"
                             android:layout_width="@dimen/d30"
                             android:layout_height="@dimen/d30"
                             android:layout_height="@dimen/d30"
-                            android:src="@mipmap/cq"
-                            android:layout_marginTop="@dimen/d22" />
+                            android:layout_marginTop="@dimen/d22"
+                            android:src="@mipmap/cq" />
 
 
                         <TextView
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginLeft="@dimen/d6"
                             android:layout_marginLeft="@dimen/d6"
+                            android:layout_marginTop="@dimen/d12"
                             android:layout_marginRight="@dimen/d6"
                             android:layout_marginRight="@dimen/d6"
                             android:singleLine="true"
                             android:singleLine="true"
                             android:text="@string/reboot_device"
                             android:text="@string/reboot_device"
@@ -291,12 +289,12 @@
                             android:id="@+id/settings_main_5_tx"
                             android:id="@+id/settings_main_5_tx"
                             android:layout_width="@dimen/d58"
                             android:layout_width="@dimen/d58"
                             android:layout_height="@dimen/d20"
                             android:layout_height="@dimen/d20"
+                            android:layout_marginTop="@dimen/d21"
+                            android:background="@drawable/shape_n_login_ed_bg"
+                            android:gravity="center"
                             android:text="@string/str_start"
                             android:text="@string/str_start"
-                            android:textSize="@dimen/font_size_10"
                             android:textColor="#FF924A"
                             android:textColor="#FF924A"
-                            android:gravity="center"
-                            android:layout_marginTop="@dimen/d21"
-                            android:background="@drawable/shape_n_login_ed_bg" />
+                            android:textSize="@dimen/font_size_10" />
                     </LinearLayout>
                     </LinearLayout>
                 </LinearLayout>
                 </LinearLayout>
             </HorizontalScrollView>
             </HorizontalScrollView>
@@ -306,59 +304,58 @@
         <LinearLayout
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_height="match_parent"
-            android:orientation="horizontal"
-            >
+            android:orientation="horizontal">
+
             <RelativeLayout
             <RelativeLayout
                 android:layout_width="@dimen/d700"
                 android:layout_width="@dimen/d700"
                 android:layout_height="@dimen/d290"
                 android:layout_height="@dimen/d290"
-                android:background="@drawable/shape_bed_bg"
-                android:layout_marginTop="@dimen/d15"
                 android:layout_marginLeft="@dimen/d15"
                 android:layout_marginLeft="@dimen/d15"
+                android:layout_marginTop="@dimen/d15"
+                android:background="@drawable/shape_bed_bg"
                 android:orientation="vertical"
                 android:orientation="vertical"
 
 
                 >
                 >
+
                 <ImageView
                 <ImageView
                     android:id="@+id/settings_img1"
                     android:id="@+id/settings_img1"
                     android:layout_width="@dimen/d24"
                     android:layout_width="@dimen/d24"
                     android:layout_height="@dimen/d24"
                     android:layout_height="@dimen/d24"
-                    android:background="@mipmap/xinxi"
-                    android:layout_marginTop="@dimen/d16"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginLeft="@dimen/d20"
-                    />
+                    android:layout_marginTop="@dimen/d16"
+                    android:background="@mipmap/xinxi" />
 
 
                 <TextView
                 <TextView
                     android:id="@+id/nurse_msg_tx_4"
                     android:id="@+id/nurse_msg_tx_4"
                     android:layout_width="wrap_content"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/d10"
+                    android:layout_marginTop="@dimen/d16"
                     android:layout_toRightOf="@+id/settings_img1"
                     android:layout_toRightOf="@+id/settings_img1"
                     android:text="@string/str_device_info"
                     android:text="@string/str_device_info"
-                    android:textSize="@dimen/font_size_18"
                     android:textColor="@color/black"
                     android:textColor="@color/black"
-                    android:textStyle="bold"
-                    android:layout_marginTop="@dimen/d16"
-                    android:layout_marginLeft="@dimen/d10"
-                    />
+                    android:textSize="@dimen/font_size_18"
+                    android:textStyle="bold" />
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_6_ll"
                     android:id="@+id/settings_main_6_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_img1"
                     android:layout_below="@+id/settings_img1"
-                    android:layout_marginTop="@dimen/d17"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginLeft="@dimen/d20"
+                    android:layout_marginTop="@dimen/d17"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="ID:"
                         android:text="ID:"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12"
-                        />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_6_tx"
                         android:id="@+id/settings_main_6_tx"
@@ -369,28 +366,28 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_7_ll"
                     android:id="@+id/settings_main_7_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_img1"
                     android:layout_below="@+id/settings_img1"
-                    android:layout_toRightOf="@+id/settings_main_6_ll"
-                    android:layout_marginTop="@dimen/d17"
                     android:layout_marginLeft="@dimen/d10"
                     android:layout_marginLeft="@dimen/d10"
+                    android:layout_marginTop="@dimen/d17"
+                    android:layout_toRightOf="@+id/settings_main_6_ll"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="IP:"
                         android:text="IP:"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12"
-                        />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_7_tx"
                         android:id="@+id/settings_main_7_tx"
@@ -401,27 +398,27 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_8_ll"
                     android:id="@+id/settings_main_8_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_6_ll"
                     android:layout_below="@+id/settings_main_6_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginLeft="@dimen/d20"
+                    android:layout_marginTop="@dimen/d7"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="@string/str_gateway"
                         android:text="@string/str_gateway"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12"
-                        />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_8_tx"
                         android:id="@+id/settings_main_8_tx"
@@ -432,27 +429,28 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_9_ll"
                     android:id="@+id/settings_main_9_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_7_ll"
                     android:layout_below="@+id/settings_main_7_ll"
-                    android:layout_toRightOf="@+id/settings_main_8_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d10"
                     android:layout_marginLeft="@dimen/d10"
+                    android:layout_marginTop="@dimen/d7"
+                    android:layout_toRightOf="@+id/settings_main_8_ll"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="DNS:"
                         android:text="DNS:"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12" />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_9_tx"
                         android:id="@+id/settings_main_9_tx"
@@ -463,26 +461,27 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_10_ll"
                     android:id="@+id/settings_main_10_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_8_ll"
                     android:layout_below="@+id/settings_main_8_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginLeft="@dimen/d20"
+                    android:layout_marginTop="@dimen/d7"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="@string/str_server_ip"
                         android:text="@string/str_server_ip"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12" />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_10_tx"
                         android:id="@+id/settings_main_10_tx"
@@ -493,27 +492,28 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_11_ll"
                     android:id="@+id/settings_main_11_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_9_ll"
                     android:layout_below="@+id/settings_main_9_ll"
-                    android:layout_toRightOf="@+id/settings_main_8_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d10"
                     android:layout_marginLeft="@dimen/d10"
+                    android:layout_marginTop="@dimen/d7"
+                    android:layout_toRightOf="@+id/settings_main_8_ll"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="SIP ID:"
                         android:text="SIP ID:"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12" />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_11_tx"
                         android:id="@+id/settings_main_11_tx"
@@ -523,26 +523,27 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_12_ll"
                     android:id="@+id/settings_main_12_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_11_ll"
                     android:layout_below="@+id/settings_main_11_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginLeft="@dimen/d20"
+                    android:layout_marginTop="@dimen/d7"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="@string/voice_type"
                         android:text="@string/voice_type"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12" />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_12_tx"
                         android:id="@+id/settings_main_12_tx"
@@ -553,27 +554,28 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_13_ll"
                     android:id="@+id/settings_main_13_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_11_ll"
                     android:layout_below="@+id/settings_main_11_ll"
-                    android:layout_toRightOf="@+id/settings_main_12_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d10"
                     android:layout_marginLeft="@dimen/d10"
+                    android:layout_marginTop="@dimen/d7"
+                    android:layout_toRightOf="@+id/settings_main_12_ll"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="SIP server:"
                         android:text="SIP server:"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12" />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_13_tx"
                         android:id="@+id/settings_main_13_tx"
@@ -584,26 +586,27 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_14_ll"
                     android:id="@+id/settings_main_14_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_12_ll"
                     android:layout_below="@+id/settings_main_12_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d20"
                     android:layout_marginLeft="@dimen/d20"
+                    android:layout_marginTop="@dimen/d7"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="APP version"
                         android:text="APP version"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12" />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_14_tx"
                         android:id="@+id/settings_main_14_tx"
@@ -614,27 +617,28 @@
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
                         android:textSize="@dimen/font_size_14" />
                         android:textSize="@dimen/font_size_14" />
                 </LinearLayout>
                 </LinearLayout>
+
                 <LinearLayout
                 <LinearLayout
                     android:id="@+id/settings_main_15_ll"
                     android:id="@+id/settings_main_15_ll"
                     android:layout_width="@dimen/d325"
                     android:layout_width="@dimen/d325"
                     android:layout_height="@dimen/d38"
                     android:layout_height="@dimen/d38"
                     android:layout_below="@+id/settings_main_12_ll"
                     android:layout_below="@+id/settings_main_12_ll"
-                    android:layout_toRightOf="@+id/settings_main_12_ll"
-                    android:layout_marginTop="@dimen/d7"
                     android:layout_marginLeft="@dimen/d10"
                     android:layout_marginLeft="@dimen/d10"
+                    android:layout_marginTop="@dimen/d7"
+                    android:layout_toRightOf="@+id/settings_main_12_ll"
+                    android:background="@drawable/shape_settings_txt_bg"
                     android:clickable="true"
                     android:clickable="true"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
-                    android:background="@drawable/shape_settings_txt_bg"
                     android:orientation="horizontal">
                     android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="0dp"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d12"
                         android:layout_weight="0.4"
                         android:layout_weight="0.4"
                         android:text="@string/str_app_release_date"
                         android:text="@string/str_app_release_date"
                         android:textColor="@color/txt_setting"
                         android:textColor="@color/txt_setting"
-                        android:textSize="@dimen/font_size_14"
-                        android:layout_marginLeft="@dimen/d12" />
+                        android:textSize="@dimen/font_size_14" />
 
 
                     <TextView
                     <TextView
                         android:id="@+id/settings_main_15_tx"
                         android:id="@+id/settings_main_15_tx"
@@ -649,31 +653,31 @@
 
 
             <ScrollView
             <ScrollView
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                >
+                android:layout_height="match_parent">
+
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:orientation="vertical"
-                    >
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical">
+
                     <LinearLayout
                     <LinearLayout
                         android:layout_width="@dimen/d265"
                         android:layout_width="@dimen/d265"
                         android:layout_height="@dimen/d290"
                         android:layout_height="@dimen/d290"
-                        android:background="@drawable/shape_bed_bg"
                         android:layout_marginLeft="@dimen/d20"
                         android:layout_marginLeft="@dimen/d20"
                         android:layout_marginTop="@dimen/d15"
                         android:layout_marginTop="@dimen/d15"
+                        android:background="@drawable/shape_bed_bg"
                         android:gravity="center"
                         android:gravity="center"
-                        android:orientation="vertical"
-                        >
+                        android:orientation="vertical">
+
                         <TextView
                         <TextView
                             android:id="@+id/settings_img2"
                             android:id="@+id/settings_img2"
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="@string/str_device_qr"
                             android:drawableLeft="@mipmap/saom"
                             android:drawableLeft="@mipmap/saom"
                             android:drawablePadding="@dimen/d8"
                             android:drawablePadding="@dimen/d8"
-                            android:textSize="@dimen/font_size_18"
+                            android:text="@string/str_device_qr"
                             android:textColor="@color/black"
                             android:textColor="@color/black"
+                            android:textSize="@dimen/font_size_18"
                             android:textStyle="bold" />
                             android:textStyle="bold" />
 
 
                         <ImageView
                         <ImageView
@@ -682,31 +686,32 @@
                             android:layout_height="200dp"
                             android:layout_height="200dp"
                             android:layout_marginTop="@dimen/d14" />
                             android:layout_marginTop="@dimen/d14" />
                     </LinearLayout>
                     </LinearLayout>
+
                     <LinearLayout
                     <LinearLayout
                         android:layout_width="@dimen/d265"
                         android:layout_width="@dimen/d265"
-                        android:layout_height="@dimen/d290"
-                        android:background="@drawable/shape_bed_bg"
-                        android:layout_marginLeft="@dimen/d10"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d20"
                         android:layout_marginTop="@dimen/d15"
                         android:layout_marginTop="@dimen/d15"
+                        android:layout_marginBottom="@dimen/d15"
+                        android:background="@drawable/shape_bed_bg"
                         android:gravity="center_horizontal"
                         android:gravity="center_horizontal"
                         android:orientation="vertical">
                         android:orientation="vertical">
 
 
                         <TextView
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="@string/str_device_switch"
+                            android:layout_marginTop="@dimen/d20"
                             android:drawableLeft="@mipmap/xinxi"
                             android:drawableLeft="@mipmap/xinxi"
                             android:drawablePadding="@dimen/d8"
                             android:drawablePadding="@dimen/d8"
-                            android:textSize="@dimen/font_size_18"
+                            android:text="@string/str_device_switch"
                             android:textColor="@color/black"
                             android:textColor="@color/black"
-                            android:layout_marginTop="@dimen/d20"
+                            android:textSize="@dimen/font_size_18"
                             android:textStyle="bold" />
                             android:textStyle="bold" />
 
 
                         <RelativeLayout
                         <RelativeLayout
                             android:id="@+id/ll_bt_switch"
                             android:id="@+id/ll_bt_switch"
                             android:layout_width="match_parent"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:layout_below="@id/settings_main_14_ll"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginTop="@dimen/d20"
                             android:layout_marginTop="@dimen/d20"
                             android:layout_marginBottom="@dimen/d20">
                             android:layout_marginBottom="@dimen/d20">
@@ -715,9 +720,9 @@
                                 android:id="@+id/switch_tx"
                                 android:id="@+id/switch_tx"
                                 android:layout_width="wrap_content"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:textSize="20sp"
+                                android:text="@string/str_bt_gateway"
                                 android:textColor="@color/black"
                                 android:textColor="@color/black"
-                                android:text="@string/str_bt_gateway"/>
+                                android:textSize="20sp" />
 
 
                             <Switch
                             <Switch
                                 android:id="@+id/switch_bluetooth"
                                 android:id="@+id/switch_bluetooth"
@@ -727,14 +732,13 @@
                                 android:layout_marginRight="@dimen/d20"
                                 android:layout_marginRight="@dimen/d20"
                                 android:switchMinWidth="40dp"
                                 android:switchMinWidth="40dp"
                                 android:thumb="@drawable/thumb_selector"
                                 android:thumb="@drawable/thumb_selector"
-                                android:track="@drawable/track_selector"/>
+                                android:track="@drawable/track_selector" />
                         </RelativeLayout>
                         </RelativeLayout>
 
 
                         <RelativeLayout
                         <RelativeLayout
                             android:id="@+id/ll_433_switch"
                             android:id="@+id/ll_433_switch"
                             android:layout_width="match_parent"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:layout_below="@id/settings_main_14_ll"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginTop="@dimen/d20"
                             android:layout_marginTop="@dimen/d20"
                             android:layout_marginBottom="@dimen/d20">
                             android:layout_marginBottom="@dimen/d20">
@@ -743,9 +747,9 @@
                                 android:id="@+id/switch_433_tx"
                                 android:id="@+id/switch_433_tx"
                                 android:layout_width="wrap_content"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:textSize="20sp"
+                                android:text="@string/str_433_switch"
                                 android:textColor="@color/black"
                                 android:textColor="@color/black"
-                                android:text="@string/str_433_switch"/>
+                                android:textSize="20sp" />
 
 
                             <Switch
                             <Switch
                                 android:id="@+id/switch_433"
                                 android:id="@+id/switch_433"
@@ -755,14 +759,13 @@
                                 android:layout_marginRight="@dimen/d20"
                                 android:layout_marginRight="@dimen/d20"
                                 android:switchMinWidth="40dp"
                                 android:switchMinWidth="40dp"
                                 android:thumb="@drawable/thumb_selector"
                                 android:thumb="@drawable/thumb_selector"
-                                android:track="@drawable/track_selector"/>
+                                android:track="@drawable/track_selector" />
                         </RelativeLayout>
                         </RelativeLayout>
 
 
                         <RelativeLayout
                         <RelativeLayout
                             android:id="@+id/ll_sleep_switch"
                             android:id="@+id/ll_sleep_switch"
                             android:layout_width="match_parent"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:layout_below="@id/settings_main_14_ll"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginTop="@dimen/d20"
                             android:layout_marginTop="@dimen/d20"
                             android:layout_marginBottom="@dimen/d20">
                             android:layout_marginBottom="@dimen/d20">
@@ -771,9 +774,9 @@
                                 android:id="@+id/switch_sleep_tx"
                                 android:id="@+id/switch_sleep_tx"
                                 android:layout_width="wrap_content"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:textSize="20sp"
+                                android:text="@string/str_sleep_switch"
                                 android:textColor="@color/black"
                                 android:textColor="@color/black"
-                                android:text="@string/str_sleep_switch"/>
+                                android:textSize="20sp" />
 
 
                             <Switch
                             <Switch
                                 android:id="@+id/switch_sleep"
                                 android:id="@+id/switch_sleep"
@@ -783,7 +786,35 @@
                                 android:layout_marginRight="@dimen/d20"
                                 android:layout_marginRight="@dimen/d20"
                                 android:switchMinWidth="40dp"
                                 android:switchMinWidth="40dp"
                                 android:thumb="@drawable/thumb_selector"
                                 android:thumb="@drawable/thumb_selector"
-                                android:track="@drawable/track_selector"/>
+                                android:track="@drawable/track_selector" />
+                        </RelativeLayout>
+
+                        <RelativeLayout
+                            android:id="@+id/ll_ntp_switch"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginLeft="@dimen/d10"
+                            android:layout_marginTop="@dimen/d20"
+                            android:layout_marginBottom="@dimen/d20"
+                            android:visibility="gone">
+
+                            <TextView
+                                android:id="@+id/switch_ntp_tx"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="@string/str_sync_ntp_time"
+                                android:textColor="@color/black"
+                                android:textSize="20sp" />
+
+                            <Switch
+                                android:id="@+id/switch_ntp_time"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_alignParentRight="true"
+                                android:layout_marginRight="@dimen/d20"
+                                android:switchMinWidth="40dp"
+                                android:thumb="@drawable/thumb_selector"
+                                android:track="@drawable/track_selector" />
                         </RelativeLayout>
                         </RelativeLayout>
                     </LinearLayout>
                     </LinearLayout>
 
 

File diff suppressed because it is too large
+ 299 - 290
android_bed/src/main/res/layout/callingbed_setting_main.xml


+ 2 - 2
android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/activity/SystemActivity.kt

@@ -226,9 +226,9 @@ class SystemActivity : BaseActivity<SystemActivityPresenter, CallingbedSettingMa
             builder.append("&soft_ver=")
             builder.append("&soft_ver=")
             builder.append(Constant.DEVICE_SOFT_VER)
             builder.append(Constant.DEVICE_SOFT_VER)
             builder.append("&device_type=")
             builder.append("&device_type=")
-            builder.append(DeviceTypeEnum.DIGIT_BED_DEVICE.value())
+            builder.append(DeviceTypeEnum.NURSE_HOST.value())
             builder.append("&device_name=")
             builder.append("&device_name=")
-            builder.append(DeviceTypeEnum.DIGIT_BED_DEVICE.typeName())
+            builder.append(DeviceTypeEnum.NURSE_HOST.typeName())
             val code = EcodeHelper().createQRImage(builder.toString(), 200, null)
             val code = EcodeHelper().createQRImage(builder.toString(), 200, null)
             activity.runOnUiThread {
             activity.runOnUiThread {
                 setting_qr_code?.setImageBitmap(code)
                 setting_qr_code?.setImageBitmap(code)

+ 1 - 0
resource/src/main/res/values-es/strings.xml

@@ -480,6 +480,7 @@
     <string name="str_bt_gateway">Puerta de enlace BT</string>
     <string name="str_bt_gateway">Puerta de enlace BT</string>
     <string name="str_433_switch">433 switch</string>
     <string name="str_433_switch">433 switch</string>
     <string name="str_sleep_switch">Monitoreo del sueño</string>
     <string name="str_sleep_switch">Monitoreo del sueño</string>
+    <string name="str_sync_ntp_time">Sync NTP time</string>
 
 
     <string name="test_target_sip_account">Ingrese el ID del SIP</string>
     <string name="test_target_sip_account">Ingrese el ID del SIP</string>
     <string name="test_hint_sip_account">ID de sorbo</string>
     <string name="test_hint_sip_account">ID de sorbo</string>

+ 1 - 0
resource/src/main/res/values-ru/strings.xml

@@ -464,6 +464,7 @@
     <string name="str_bt_gateway">Шлюз BT</string>
     <string name="str_bt_gateway">Шлюз BT</string>
     <string name="str_433_switch">Переключатель 433</string>
     <string name="str_433_switch">Переключатель 433</string>
     <string name="str_sleep_switch">Мониторинг сна </string>
     <string name="str_sleep_switch">Мониторинг сна </string>
+    <string name="str_sync_ntp_time">Sync NTP time</string>
 
 
     <string name="test_target_sip_account">Пожалуйста, введите SIP ID</string>
     <string name="test_target_sip_account">Пожалуйста, введите SIP ID</string>
     <string name="test_hint_sip_account">SIP ID</string>
     <string name="test_hint_sip_account">SIP ID</string>

+ 1 - 0
resource/src/main/res/values-zh/strings.xml

@@ -480,6 +480,7 @@
     <string name="str_bt_gateway">蓝牙网关</string>
     <string name="str_bt_gateway">蓝牙网关</string>
     <string name="str_433_switch">433 开关</string>
     <string name="str_433_switch">433 开关</string>
     <string name="str_sleep_switch">床垫 开关</string>
     <string name="str_sleep_switch">床垫 开关</string>
+    <string name="str_sync_ntp_time">同步NTP时间</string>
 
 
     <string name="test_target_sip_account">请输入对方SIP账号</string>
     <string name="test_target_sip_account">请输入对方SIP账号</string>
     <string name="test_hint_sip_account">输入账号</string>
     <string name="test_hint_sip_account">输入账号</string>

+ 1 - 0
resource/src/main/res/values/strings.xml

@@ -478,6 +478,7 @@
     <string name="str_bt_gateway">BT gateway</string>
     <string name="str_bt_gateway">BT gateway</string>
     <string name="str_433_switch">433 switch</string>
     <string name="str_433_switch">433 switch</string>
     <string name="str_sleep_switch">Mattress switch</string>
     <string name="str_sleep_switch">Mattress switch</string>
+    <string name="str_sync_ntp_time">Sync NTP time</string>
 
 
     <string name="test_target_sip_account">Please input sip id</string>
     <string name="test_target_sip_account">Please input sip id</string>
     <string name="test_hint_sip_account">Sip id</string>
     <string name="test_hint_sip_account">Sip id</string>