wuhb 2 years ago
parent
commit
b3ceff0a22

+ 15 - 2
app/src/main/AndroidManifest.xml

@@ -43,7 +43,7 @@
         android:debuggable="true"
         android:name=".comm.BaseApplication"
         android:allowBackup="true"
-        android:icon="@mipmap/ic_launcher"
+        android:icon="@mipmap/logo"
         android:label="@string/app_name"
         android:usesCleartextTraffic="true"
         android:networkSecurityConfig="@xml/network_security_config"
@@ -64,11 +64,24 @@
         <activity
             android:name=".activity.ControlActivity"
             android:configChanges="keyboardHidden|screenSize" />
-
+        <activity
+            android:name=".activity.RobotInfoActivity"
+            android:configChanges="keyboardHidden|screenSize" />
         <service
             android:name=".receiver.SocketService"
             android:enabled="true"
             android:exported="false" />
+
+        <provider
+            android:name="androidx.core.content.FileProvider"
+            android:authorities="${applicationId}.fileprovider"
+            android:exported="false"
+            android:grantUriPermissions="true">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/file_paths" />
+        </provider>
+
     </application>
 
 </manifest>

+ 4 - 0
app/src/main/java/com/qy/agv/activity/ControlActivity.java

@@ -440,6 +440,10 @@ public class ControlActivity extends BaseActivity {
     }
 
     private void sendCommand(String cmd, String...args){
+        if(socketService == null){
+            ToastUtils.showToast(context, "没有连接机器人");
+            return;
+        }
         String id = socketService.getSendID();
         boolean rs = false;
         switch (cmd){

+ 21 - 26
app/src/main/java/com/qy/agv/activity/MainActivity.java

@@ -36,6 +36,7 @@ import com.google.gson.reflect.TypeToken;
 import com.qy.agv.R;
 import com.qy.agv.activity.adapter.MainListViewAdapter;
 import com.qy.agv.activity.dao.MainDao;
+import com.qy.agv.activity.model.EventMessage;
 import com.qy.agv.activity.model.RobotModel;
 import com.qy.agv.activity.model.ShelfModel;
 import com.qy.agv.activity.model.SiteModel;
@@ -56,6 +57,9 @@ import com.qy.agv.util.ToastUtils;
 import com.qy.agv.util.ToolUtils;
 
 import org.apache.log4j.Logger;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.xutils.common.Callback;
@@ -101,8 +105,10 @@ public class MainActivity extends BaseActivity {
         initView();
         initData();
         Permission.checkPermission(this);
+        EventBus.getDefault().register(this);
         reloadData();
         checkNet();
+        update();
     }
 
     private void checkNet(){
@@ -177,11 +183,11 @@ public class MainActivity extends BaseActivity {
 //                checkToken(getMac(), getMac());
                 login();
             }else{
-                logout();
+                toActivity(RobotInfoActivity.class);
             }
         });
         submit.setOnLongClickListener(v -> {
-            checkToken(getMac(), getMac());
+            toActivity(RobotInfoActivity.class);
             return false;
         });
     }
@@ -709,30 +715,11 @@ public class MainActivity extends BaseActivity {
     }
 
     private void logout(){
-        AlertDialog alert = new AlertDialog.Builder(MainActivity.this)
-                .setTitle("提示")
-                .setMessage("确定退出系统吗?")
-                .setPositiveButton("确定",
-                        new DialogInterface.OnClickListener() {// 设置确定按钮
-                            @Override
-                            // 处理确定按钮点击事件
-                            public void onClick(DialogInterface dialog, int which) {
-                                Constant.user = null;
-                                CacheService.getInstance(context).clear(CACHE_BIND_CONTROL);
-                                CacheService.getInstance(context).clear(CACHE_LOGIN_KEY);
-                                Constant.ACCESS_TOKEN = null;
-                                Constant.REFRESH_TOKEN = null;
-                                mList.clear();
-                                listViewAdapter.notifyDataSetChanged();
-                                binding.swipeContainer.setVisibility(View.GONE);
-                                binding.tvEmpty.setVisibility(View.VISIBLE);
-                                submit.setText("未登录");
-                                dialog.cancel();// 对话框关闭。
-                            }
-                        })
-                .setNegativeButton("取消", null)
-                .setCancelable(true).create();
-        alert.show();
+        mList.clear();
+        listViewAdapter.notifyDataSetChanged();
+        binding.swipeContainer.setVisibility(View.GONE);
+        binding.tvEmpty.setVisibility(View.VISIBLE);
+        submit.setText("未登录");
     }
 
     private void login(){
@@ -781,4 +768,12 @@ public class MainActivity extends BaseActivity {
             mylog.error("更新检测异常", ex);
         }
     }
+
+    @Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1)
+    public void onReceiveMsg(EventMessage message){
+        if(message.getType() == 1){
+            logout();
+        }
+    }
+
 }

+ 175 - 0
app/src/main/java/com/qy/agv/activity/RobotInfoActivity.java

@@ -0,0 +1,175 @@
+package com.qy.agv.activity;
+
+import static com.qy.agv.util.Constant.CACHE_BIND_CONTROL;
+import static com.qy.agv.util.Constant.CACHE_LOGIN_KEY;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.StrictMode;
+import android.provider.Settings;
+import android.view.View;
+
+import com.qy.agv.activity.model.EventMessage;
+import com.qy.agv.comm.BaseActivity;
+import com.qy.agv.comm.CacheService;
+import com.qy.agv.databinding.QyRobotInfoBinding;
+import com.qy.agv.update.UpdateManager;
+import com.qy.agv.update.UpdateXmlService;
+import com.qy.agv.util.Constant;
+import com.qy.agv.util.ProjectUtils;
+import com.qy.agv.util.StringUtils;
+import com.qy.agv.util.ToastUtils;
+import com.qy.agv.util.VersionUtils;
+
+import org.apache.log4j.Logger;
+import org.greenrobot.eventbus.EventBus;
+import org.xutils.x;
+
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.util.HashMap;
+
+
+public class RobotInfoActivity extends BaseActivity {
+    public static Logger mylog =Logger.getLogger(RobotInfoActivity.class);
+
+    private Context context;
+    private QyRobotInfoBinding binding;
+    private HashMap<String,String> mHashMap;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        binding = QyRobotInfoBinding.inflate(getLayoutInflater());
+        setContentView(binding.getRoot());
+        x.view().inject(this);
+        context = this;
+        initCommonTop2();
+        init();
+    }
+
+    @SuppressLint("ClickableViewAccessibility")
+    public void init(){
+        if(Constant.user!=null) {
+            binding.tvLoginName.setText(Constant.user.getReal_name());
+        }else{
+            binding.tvLoginName.setText("未登录");
+        }
+        binding.tvWorkStation.setText("操作员");
+        binding.tvVersion.setText(VersionUtils.getVerName(context));
+        binding.tvDeviceSeq.setText(getMac());
+        binding.versionUpdate.setOnClickListener(view->{
+            updateApp();
+        });
+        binding.exit.setOnClickListener(view->{
+            logout();
+        });
+    }
+
+    private void updateApp(){
+        try {
+            boolean haveInstallPermission = context.getPackageManager().canRequestPackageInstalls();
+            Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES);
+            if (!haveInstallPermission) {
+                context.startActivity(intent);
+            }
+        }catch (NoSuchMethodError e){
+            e.printStackTrace();
+        }
+        if(isUpdate()) {
+            ProjectUtils.init();
+            UpdateManager updateManager = new UpdateManager(context, mHashMap);
+            updateManager.showDownloadDialog();
+        }else {
+            ToastUtils.showToast(this, "已经是最新版本了");
+        }
+    }
+
+    public boolean isUpdate(){
+        try {
+            int versionCode = VersionUtils.getVerCode(this);
+            UpdateXmlService service = new UpdateXmlService();
+            String path = ProjectUtils.getProjectURL() + "/version.xml";
+            URL url = new URL(path);
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            conn.setReadTimeout(5 * 1000);
+            conn.setConnectTimeout(10000);
+            conn.setRequestMethod("GET");
+            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
+                    .permitAll().build();
+            StrictMode.setThreadPolicy(policy);
+            InputStream inStream = conn.getInputStream();
+            mHashMap = service.parseXml(inStream);
+            String current_version = mHashMap.get("version");
+            if (StringUtils.isEmpty(current_version)) {
+                return false;
+            }
+            if (null != mHashMap) {
+                int serviceCode = Integer.parseInt(current_version);
+                return serviceCode > versionCode;
+            }
+        } catch (SocketTimeoutException ex){
+            ToastUtils.showToast(this, "连接超过");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+
+    private void logout(){
+        AlertDialog alert = new AlertDialog.Builder(RobotInfoActivity.this)
+                .setTitle("提示")
+                .setMessage("确定退出系统吗?")
+                .setPositiveButton("确定",
+                        new DialogInterface.OnClickListener() {// 设置确定按钮
+                            @Override
+                            // 处理确定按钮点击事件
+                            public void onClick(DialogInterface dialog, int which) {
+                                Constant.user = null;
+                                CacheService.getInstance(context).clear(CACHE_BIND_CONTROL);
+                                CacheService.getInstance(context).clear(CACHE_LOGIN_KEY);
+                                Constant.ACCESS_TOKEN = null;
+                                Constant.REFRESH_TOKEN = null;
+                                try {
+                                    EventMessage message = new EventMessage(1, "退出");
+                                    EventBus.getDefault().post(message);
+                                }catch (Exception ex){
+                                    ex.printStackTrace();
+                                }
+                                dialog.cancel();// 对话框关闭。
+                                new Handler().postDelayed(()->{finish();}, 300);
+                            }
+                        })
+                .setNegativeButton("取消", null)
+                .setCancelable(true).create();
+        alert.show();
+    }
+
+    @Override
+    public void receiverTask(String barcode) {
+
+    }
+
+    @Override
+    protected String getCommonTopTitle() {
+        return "设备信息";
+    }
+
+    @Override
+    protected int getCommonTopICO() {
+        return 0;
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+}

+ 26 - 0
app/src/main/java/com/qy/agv/activity/model/EventMessage.java

@@ -0,0 +1,26 @@
+package com.qy.agv.activity.model;
+
+public class EventMessage {
+    private int type;
+    private String message;
+    public EventMessage(int type, String message) {
+        this.type = type;
+        this.message = message;
+    }
+    public int getType() {
+        return type;
+    }
+    public void setType(int type) {
+        this.type = type;
+    }
+    public String getMessage() {
+        return message;
+    }
+    public void setMessage(String message) {
+        this.message = message;
+    }
+    @Override
+    public String toString() {
+        return "type="+type+"--message= "+message;
+    }
+}

+ 18 - 8
app/src/main/java/com/qy/agv/update/UpdateManager.java

@@ -1,12 +1,14 @@
 package com.qy.agv.update;
 
 import android.annotation.SuppressLint;
+import android.app.AlertDialog;
 import android.app.AlertDialog.Builder;
 import android.app.Dialog;
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
@@ -38,6 +40,7 @@ import org.apache.log4j.Logger;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.InputStream;
+import java.lang.reflect.Field;
 import java.net.HttpURLConnection;
 import java.net.MulticastSocket;
 import java.net.SocketTimeoutException;
@@ -75,7 +78,7 @@ public class UpdateManager {
 	/* 更新进度条 */
 	private ProgressBar mProgress;
 	private TextView mProgressText;
-	private Dialog mDownloadDialog;
+	private AlertDialog mDownloadDialog;
 	private Dialog mShowDialog;
 	public static Logger mylog =Logger.getLogger(UpdateManager.class);
 	public String next_version;
@@ -142,8 +145,6 @@ public class UpdateManager {
 		if (isUpdate()) {
 			if(!StringUtils.isEmpty(next_version)){
 				ToastUtils.showToastL(mContext, "更新到版本"+next_version);
-			}else{
-				ToastUtils.showToastL(mContext, "正在更新");
 			}
 			ProjectUtils.init();
 			showDownloadDialog();
@@ -199,7 +200,7 @@ public class UpdateManager {
 	public void showDownloadDialog() {
 		// 构造软件下载对话框
 		Builder builder = new Builder(mContext);
-		builder.setTitle(R.string.soft_updating);
+		builder.setTitle(R.string.soft_update);
 		// 给下载对话框增加进度条
 		final LayoutInflater inflater = LayoutInflater.from(mContext);
 		View v = inflater.inflate(R.layout.softupdate_progress, null);
@@ -207,12 +208,21 @@ public class UpdateManager {
 		mProgressText = (TextView) v.findViewById(R.id.update_progress_text);
 		builder.setView(v);
 		// 取消更新
-//		builder.setNegativeButton(R.string.soft_update_close,(dialog,which)-> dialog.dismiss());
+		builder.setNegativeButton(R.string.soft_update_cancel,(dialog,which)-> {
+			cancelUpdate = true;
+			dialog.dismiss();
+		});
+		builder.setPositiveButton(R.string.sure,null);
 		mDownloadDialog = builder.create();
 		mDownloadDialog.setCancelable(false);
 		mDownloadDialog.setCanceledOnTouchOutside(false);
 		mDownloadDialog.show();
-		downloadApk();
+		mDownloadDialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
+			public void onClick(View v){
+				downloadApk();
+				v.setVisibility(View.GONE);
+			}
+		});
 	}
 
 	/**
@@ -306,7 +316,7 @@ public class UpdateManager {
 				mHandler.sendMessage(msg);
 			}
 			// 取消下载对话框显示
-//			mDownloadDialog.dismiss();
+			mDownloadDialog.dismiss();
 		}
 	};
 
@@ -337,7 +347,7 @@ public class UpdateManager {
 		install.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
 			install.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
-			Uri apkUri = FileProvider.getUriForFile(mContext, "com.byjr.app.fileprovider", apkfile);//在AndroidManifest中的android:authorities值
+			Uri apkUri = FileProvider.getUriForFile(mContext, "com.qy.agv.fileprovider", apkfile);//在AndroidManifest中的android:authorities值
 			install.setDataAndType(apkUri, "application/vnd.android.package-archive");
 			// 查询所有符合 intent 跳转目标应用类型的应用,注意此方法必须放置在 setDataAndType 方法之后
 			List<ResolveInfo> resolveLists = mContext.getPackageManager().queryIntentActivities(install, PackageManager.MATCH_DEFAULT_ONLY);

+ 5 - 2
app/src/main/java/com/qy/agv/util/Constant.java

@@ -18,9 +18,12 @@ public class Constant {
     public final static String DATETIME_CONTINUOUS_MILLI_FORMATE = "yyyyMMddHHmmssSSS";
     public final static String TIME_FORMATE = "HHmmss";
 
-//    public static String HTTP_URL = "http://39.107.106.144:85/api";
-    public static String HTTP_URL = "http://106.14.107.152:8100/api";
+    public static String server_ip = "39.107.106.144";
+//    public static String server_ip = "106.14.107.152";
+    public static String HTTP_URL = "http://"+server_ip+":85/api";
+//    public static String HTTP_URL = "http://"+server_ip+":8100/api";
 //    public static String HTTP_URL = "http://192.168.1.107:8081";
+    public static String UPDATE_URL = "http://"+server_ip+":9011";
     public static String ACCESS_TOKEN = "";
     public static String REFRESH_TOKEN = "";
     public static String TENANT_ID = "000000";

+ 2 - 2
app/src/main/java/com/qy/agv/util/ProjectUtils.java

@@ -22,7 +22,7 @@ public class ProjectUtils {
     /**
      * 项目路径
      */
-    public static final String PROJECT_PATH = ROOT_DIRECTORY.getAbsolutePath() + "/byjr/";
+    public static final String PROJECT_PATH = ROOT_DIRECTORY.getAbsolutePath() + "/qyagv/";
 
     /**
      * 缓存
@@ -86,6 +86,6 @@ public class ProjectUtils {
     }
 
     public static String getProjectURL(){
-        return Constant.HTTP_URL;
+        return Constant.UPDATE_URL;
     }
 }

+ 18 - 0
app/src/main/java/com/qy/agv/util/VersionUtils.java

@@ -8,6 +8,24 @@ import android.util.Log;
 
 public class VersionUtils {
 
+    /**
+     * 获取版本号
+     *
+     * @param context
+     * @return
+     */
+    public static int getVerCode(Context context) {
+        int verCode = -1;
+        try {
+            verCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0)
+                    .versionCode;
+        } catch (PackageManager.NameNotFoundException e) {
+            Log.e("versionCode", e.getMessage());
+        }
+        return verCode;
+    }
+
+
     /**
      * 获取软件版本号
      *

+ 10 - 0
app/src/main/res/drawable/btn_normal.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--  圆角  -->
+    <corners android:radius="10dp"/>
+    <!--  填充色  -->
+    <solid android:color="@color/status"/>
+    <!--  边框颜色与宽度  -->
+    <stroke android:color="#AAFFFFFF"
+        android:width="3dp"/>
+</shape>

+ 10 - 0
app/src/main/res/drawable/btn_press.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--  圆角  -->
+    <corners android:radius="10dp"/>
+    <!--  填充色  -->
+    <solid android:color="@color/status"/>
+    <!--  边框颜色与宽度  -->
+    <stroke android:color="#AAFFFFFF"
+        android:width="5dp"/>
+</shape>

+ 7 - 0
app/src/main/res/drawable/btn_shape.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--  普通样式  -->
+    <item android:drawable="@drawable/btn_normal" android:state_pressed="false"/>
+    <!--  点击后样式  -->
+    <item android:drawable="@drawable/btn_press" android:state_pressed="true"/>
+</selector>

+ 1 - 1
app/src/main/res/layout/activity_main.xml

@@ -39,7 +39,7 @@
         android:layout_height="match_parent"
         android:id="@+id/tv_empty"
         android:visibility="gone"
-        android:hint="没有已执行的任务"
+        android:hint="没有任务"
         android:textSize="25dp"
         android:gravity="center"
         />

+ 163 - 0
app/src/main/res/layout/qy_robot_info.xml

@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <include layout="@layout/common_top"></include>
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:id="@+id/scrollView">
+        <LinearLayout
+            android:orientation="vertical"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <LinearLayout
+                android:orientation="vertical"
+                android:paddingTop="10dp"
+                android:layout_width="match_parent"
+                android:background="@drawable/white"
+                android:layout_height="wrap_content">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="30dp"
+                    android:id="@+id/ll_robot_id"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_width="100dp"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:gravity="left"
+                        android:paddingLeft="10dp"
+                        android:text="帐号"/>
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:id="@+id/tv_login_name"
+                        android:layout_weight="1"
+                        android:text=""/>
+<!--                    <Button-->
+<!--                        android:id="@+id/robot_reload"-->
+<!--                        android:layout_width="wrap_content"-->
+<!--                        android:layout_height="match_parent"-->
+<!--                        android:background="@color/transparent"-->
+<!--                        android:textColor="@color/blue"-->
+<!--                        android:text="重置"-->
+<!--                        />-->
+                </LinearLayout>
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:layout_marginRight="10dp"
+                    android:layout_marginLeft="10dp"
+                    android:background="@color/dc_line"
+                    />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="40dp"
+                    android:gravity="center"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_width="100dp"
+                        android:layout_height="wrap_content"
+                        android:gravity="left"
+                        android:paddingLeft="10dp"
+                        android:id="@+id/tv_work_station"
+                        android:text="工位"/>
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:id="@+id/tv_ip"
+                        android:layout_weight="1"
+                        android:text=""/>
+                </LinearLayout>
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:layout_marginRight="10dp"
+                    android:layout_marginLeft="10dp"
+                    android:background="@color/dc_line"
+                    />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="40dp"
+                    android:gravity="center"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_width="100dp"
+                        android:layout_height="wrap_content"
+                        android:gravity="left"
+                        android:paddingLeft="10dp"
+                        android:text="版本"/>
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:id="@+id/tv_version"
+                        android:layout_weight="1"
+                        android:text=""/>
+                    <Button
+                        android:id="@+id/version_update"
+                        android:layout_width="wrap_content"
+                        android:layout_height="match_parent"
+                        android:background="@color/transparent"
+                        android:textColor="@color/blue"
+                        android:text="更新"
+                        />
+                </LinearLayout>
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:layout_marginRight="10dp"
+                    android:layout_marginLeft="10dp"
+                    android:background="@color/dc_line"
+                    />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="40dp"
+                    android:gravity="center"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_width="100dp"
+                        android:layout_height="wrap_content"
+                        android:gravity="left"
+                        android:paddingLeft="10dp"
+                        android:text="序列号"/>
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:id="@+id/tv_device_seq"
+                        android:layout_weight="1"
+                        android:text=""/>
+                </LinearLayout>
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:layout_marginRight="10dp"
+                    android:layout_marginLeft="10dp"
+                    android:background="@color/dc_line"
+                    />
+
+                <Button
+                    android:id="@+id/exit"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="30dp"
+                    android:layout_marginStart="30dp"
+                    android:layout_marginTop="30dp"
+                    android:textColor="@color/white"
+                    android:background="@drawable/btn_shape"
+                    android:text="退出" />
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+    </ScrollView>
+</LinearLayout>

BIN
app/src/main/res/mipmap-hdpi/logo.png


+ 2 - 0
app/src/main/res/values/strings.xml

@@ -3,5 +3,7 @@
     <string name="sure">确定</string>
     <string name="restart_success_">重启成功!</string>
     <string name="cancel">取消</string>
+    <string name="soft_update">是否更新</string>
     <string name="soft_updating">正在更新</string>
+    <string name="soft_update_cancel">取消</string>
 </resources>

+ 8 - 0
app/src/main/res/xml/file_paths.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <paths>
+        <external-path name="download" path="." />
+        <external-path name="image" path="/qyagv/IMG/" />
+    </paths>
+
+</resources>