Browse Source

1.添加2.5D的布局

Administrator 4 years ago
parent
commit
fdc7eb8e55
53 changed files with 8586 additions and 82 deletions
  1. 14 2
      app/build.gradle
  2. 4 3
      app/src/main/AndroidManifest.xml
  3. BIN
      app/src/main/assets/fonts/impact.ttf
  4. 15 0
      app/src/main/java/com/sunzee/base/BaseApplication.java
  5. 25 0
      app/src/main/java/com/sunzee/model/domain/CheckCodeBean.java
  6. 3 0
      app/src/main/java/com/sunzee/model/domain/Name.java
  7. 99 20
      app/src/main/java/com/sunzee/mvp/homeactivity/HomePageAPresenter.java
  8. 10 0
      app/src/main/java/com/sunzee/mvp/homeactivity/HomePageAView.java
  9. 5 0
      app/src/main/java/com/sunzee/retrofit/ApiStores.java
  10. 4 0
      app/src/main/java/com/sunzee/service/MyIntentService.java
  11. 4 16
      app/src/main/java/com/sunzee/service/MyService.java
  12. 192 19
      app/src/main/java/com/sunzee/ui/activity/HomePageAActivity.java
  13. 0 3
      app/src/main/java/com/sunzee/ui/fragment/HomepageFragment.java
  14. 31 4
      app/src/main/java/com/sunzee/ui/fragment/OtherFragment.java
  15. 110 0
      app/src/main/java/com/sunzee/ui/view/CustomSketchMapView.java
  16. 1 1
      app/src/main/java/com/sunzee/ui/view/CustomView.java
  17. 3 4
      app/src/main/java/com/sunzee/ui/view/CustomViewGrounp.java
  18. 257 0
      app/src/main/java/com/sunzee/ui/view/CustomViewSketchMapGrounp.java
  19. BIN
      app/src/main/res/drawable-hdpi/data.png
  20. BIN
      app/src/main/res/drawable-hdpi/in_use.png
  21. BIN
      app/src/main/res/drawable-hdpi/sketchmap.png
  22. BIN
      app/src/main/res/drawable-hdpi/sketchmap1.png
  23. BIN
      app/src/main/res/drawable-mdpi/data.png
  24. BIN
      app/src/main/res/drawable-mdpi/in_use.png
  25. BIN
      app/src/main/res/drawable-mdpi/sketchmap.png
  26. BIN
      app/src/main/res/drawable-mdpi/sketchmap1.png
  27. BIN
      app/src/main/res/drawable-xhdpi/data.png
  28. BIN
      app/src/main/res/drawable-xhdpi/in_use.png
  29. BIN
      app/src/main/res/drawable-xhdpi/sketchmap.png
  30. BIN
      app/src/main/res/drawable-xhdpi/sketchmap1.png
  31. BIN
      app/src/main/res/drawable-xxhdpi/data.png
  32. BIN
      app/src/main/res/drawable-xxhdpi/in_use.png
  33. BIN
      app/src/main/res/drawable-xxhdpi/sketchmap.png
  34. BIN
      app/src/main/res/drawable-xxhdpi/sketchmap1.png
  35. BIN
      app/src/main/res/drawable-xxxhdpi/data.png
  36. BIN
      app/src/main/res/drawable-xxxhdpi/in_use.png
  37. BIN
      app/src/main/res/drawable-xxxhdpi/sketchmap.png
  38. BIN
      app/src/main/res/drawable-xxxhdpi/sketchmap1.png
  39. 6 0
      app/src/main/res/drawable/shape_cleanwc_rounded_rectangle.xml
  40. 7 0
      app/src/main/res/drawable/shape_data_rounded_rectangle.xml
  41. 7 0
      app/src/main/res/drawable/shape_date2_rounded_rectangle.xml
  42. 3 3
      app/src/main/res/drawable/shape_headbottom_rectangle.xml
  43. 5 2
      app/src/main/res/drawable/shape_login_rounded_rectangle.xml
  44. 5 0
      app/src/main/res/drawable/shape_refresh_signin_code_rectangle.xml
  45. 53 4
      app/src/main/res/layout/activity_homeactivity.xml
  46. 574 0
      app/src/main/res/layout/activity_homeactivity25d.xml
  47. 49 0
      app/src/main/res/layout/fragment_other.xml
  48. 89 0
      app/tinker-support.gradle
  49. 3504 0
      app/tinker/app-0116-16-37-05/app-debug-R.txt
  50. BIN
      app/tinker/app-0116-16-37-05/app-debug.apk
  51. 3504 0
      app/tinker/app-0116-16-37-05/app-release-R.txt
  52. BIN
      app/tinker/app-0116-16-37-05/app-release.apk
  53. 3 1
      build.gradle

+ 14 - 2
app/build.gradle

@@ -15,8 +15,8 @@ android {
         applicationId "com.sunzee.cleanMachine"
         minSdkVersion 14
         targetSdkVersion 28
-        versionCode 1
-        versionName "1.0.7"
+        versionCode 8
+        versionName "1.0.8"
         manifestPlaceholders = [
                 //个推应用参数,请填写您申请的 GETUI_APP_ID,GETUI_APP_KEY,GETUI_APP_SECRET 值
                 GETUI_APP_ID    : "n4vsaIAi0eAbAkfBfqsUL7",
@@ -100,4 +100,16 @@ dependencies {
     implementation  'com.umeng.umsdk:asms:1.1.3' // asms包依赖(必选)
     implementation 'com.umeng.umsdk:crash:0.0.4' // native crash包依赖(必选)
 
+
+    //bugly
+    implementation "com.android.support:multidex:1.0.1" // 多dex配置
+    //注释掉原有bugly的仓库
+    //compile 'com.tencent.bugly:crashreport:latest.release'//其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.3.4
+    implementation 'com.tencent.bugly:crashreport_upgrade:1.3.6'
+    // 指定tinker依赖版本(注:应用升级1.3.5版本起,不再内置tinker)
+    implementation 'com.tencent.tinker:tinker-android-lib:1.9.13'
+    implementation 'com.tencent.bugly:nativecrashreport:latest.release' //其中latest.release指代最新版本号,也可以指定明确的版本号,例如2.2.0
 }
+
+// 依赖插件脚本
+apply from: 'tinker-support.gradle'

+ 4 - 3
app/src/main/AndroidManifest.xml

@@ -18,11 +18,12 @@
 
     <!--bugly所需权限-->
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission
-        android:name="android.permission.READ_LOGS"
-        tools:ignore="ProtectedPermissions" />
+    <uses-permission android:name="android.permission.READ_LOGS"/>
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+
 
     <application
         android:name=".base.BaseApplication"

BIN
app/src/main/assets/fonts/impact.ttf


+ 15 - 0
app/src/main/java/com/sunzee/base/BaseApplication.java

@@ -7,6 +7,7 @@ import android.database.sqlite.SQLiteDatabase;
 import android.graphics.Point;
 import android.os.Build;
 import android.os.Bundle;
+import android.support.multidex.MultiDex;
 import android.util.Log;
 import android.view.Display;
 import android.view.WindowManager;
@@ -23,6 +24,8 @@ import com.sunzee.service.MyService;
 import com.sunzee.utils.FileUtil;
 import com.sunzee.utils.LanguageUtils;
 import com.sunzee.utils.SharedPreferencesUtils;
+import com.tencent.bugly.Bugly;
+import com.tencent.bugly.beta.Beta;
 import com.umeng.commonsdk.UMConfigure;
 import com.umeng.commonsdk.UMConfigureImpl;
 import com.umeng.umcrash.UMCrash;
@@ -67,6 +70,18 @@ public class BaseApplication extends Application {
         UMConfigure.init(this, "5ee80e9fdbc2ec076dd49301", deviceId, UMConfigure.DEVICE_TYPE_PHONE, "");
         String ch = (String)SharedPreferencesUtils.getParam(Name.LANGUAGE_TYPE, "ch");
         LanguageUtils.set(ch);
+        // 这里实现SDK初始化,appId替换成你的在Bugly平台申请的appId
+        // 调试时,将第三个参数改为true
+        Bugly.init(this,"b764cadec8",true);
+    }
+
+    @Override
+    protected void attachBaseContext(Context base) {
+        super.attachBaseContext(base);
+        // you must install multiDex whatever tinker is installed!
+        MultiDex.install(base);
+        // 安装tinker
+        Beta.installTinker();
     }
 
     //获取屏幕高和宽:不包含虚拟按键部分的高和宽。

+ 25 - 0
app/src/main/java/com/sunzee/model/domain/CheckCodeBean.java

@@ -0,0 +1,25 @@
+package com.sunzee.model.domain;
+
+/**
+ * 签到码bean
+ * "rd_Pic":"img"
+ */
+
+public class CheckCodeBean {
+    String rd_Pic;
+
+    public String getRd_Pic() {
+        return rd_Pic;
+    }
+
+    public void setRd_Pic(String rd_Pic) {
+        this.rd_Pic = rd_Pic;
+    }
+
+    @Override
+    public String toString() {
+        return "CheckCodeBean{" +
+                "rd_Pic='" + rd_Pic + '\'' +
+                '}';
+    }
+}

+ 3 - 0
app/src/main/java/com/sunzee/model/domain/Name.java

@@ -86,4 +86,7 @@ public interface Name {
 
     //联系人
     String WAYCONTACTS = "waycontacts";
+
+    //示意图标移动
+    String WCLOCALTION = "wclocaltion";
 }

+ 99 - 20
app/src/main/java/com/sunzee/mvp/homeactivity/HomePageAPresenter.java

@@ -1,8 +1,14 @@
 package com.sunzee.mvp.homeactivity;
 
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
 import android.text.TextUtils;
+import android.util.Base64;
 import android.util.Log;
 
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
 import com.google.gson.Gson;
 import com.orhanobut.hawk.Hawk;
 import com.sunzee.base.BaseApplication;
@@ -12,6 +18,7 @@ import com.sunzee.model.Global;
 import com.sunzee.model.Heartbeat;
 import com.sunzee.model.HttpResult;
 import com.sunzee.model.HttpResult2;
+import com.sunzee.model.domain.CheckCodeBean;
 import com.sunzee.model.domain.CleaningBean;
 import com.sunzee.model.domain.Name;
 import com.sunzee.model.domain.ParameterBean;
@@ -23,6 +30,7 @@ import com.sunzee.utils.HexadecimalUtil;
 import org.greenrobot.greendao.query.QueryBuilder;
 import org.greenrobot.greendao.query.WhereCondition;
 
+import java.io.ByteArrayOutputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -50,7 +58,6 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
     }
 
 
-
     //-------------------------------------------------------------------------清洗规则 start--------------------------------------------------------------------------------------------
     public void requstCleanRule() {
         Map<String, String> params = new HashMap<>();
@@ -150,7 +157,7 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
                 threadGetParameter1.getValues()[4] = String.valueOf(get177Data(HexadecimalUtil.hex2dec(results.get(6))));
                 threadGetParameter1.getValues()[5] = String.valueOf(get177Data(HexadecimalUtil.hex2dec(results.get(7))));
 
-                Log.d(TAG, "D418setAdvanced: "+results.size());
+                Log.d(TAG, "D418setAdvanced: " + results.size());
             }
         } else if (name.equals("D426")) {
             if (!threadGetParameter1.isReceive1()) {
@@ -165,7 +172,7 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
                 threadGetParameter1.getValues()[13] = String.valueOf(HexadecimalUtil.hex2dec(results.get(6)));
                 threadGetParameter1.getValues()[14] = String.valueOf(HexadecimalUtil.hex2dec(results.get(7)));
                 threadGetParameter1.getValues()[15] = String.valueOf(HexadecimalUtil.hex2dec(results.get(8)));
-                Log.d(TAG, "D426setAdvanced: "+results.size());
+                Log.d(TAG, "D426setAdvanced: " + results.size());
             }
         }
         if (threadGetParameter1.isReceive1() &&
@@ -177,7 +184,7 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
     }
 
     private String get177Data(long l) {
-        return String.valueOf(Math.round((l/ Global.num)*10));
+        return String.valueOf(Math.round((l / Global.num) * 10));
     }
 
     public void updateAdvanced(ArrayList<ParameterBean> parameterBeans) {
@@ -231,11 +238,12 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
 
     /**
      * 上传厕所的使用状态
-     * @param sn  几号厕所
+     *
+     * @param sn     几号厕所
      * @param status 厕所使用状态
      */
-    public void sendStatusOfToiletUse(String sn,String status){
-        Log.d(TAG, "11onSuccess: "+Heartbeat.deviceId);
+    public void sendStatusOfToiletUse(String sn, String status) {
+        Log.d(TAG, "11onSuccess: " + Heartbeat.deviceId);
         Map<String, String> params = new HashMap<>();
         params.put("clientId", Heartbeat.deviceId + "");
         params.put("sn", sn);
@@ -244,7 +252,7 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
 
             @Override
             public void onSuccess(HttpResult<String> model) {
-                Log.d(TAG, "sendStatusOfToiletUse11onSuccess: "+model);
+                Log.d(TAG, "sendStatusOfToiletUse11onSuccess: " + model);
             }
 
             @Override
@@ -258,15 +266,15 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
         });
     }
 
-    public void createBox(int number){
+    public void createBox(int number) {
         Map<String, String> params = new HashMap<>();
         params.put("clientId", Heartbeat.deviceId + "");
-        params.put("number", number+"");
+        params.put("number", number + "");
         addSubscription(apiStores.createBox(params), new ApiCallback<HttpResult<String>>() {
 
             @Override
             public void onSuccess(HttpResult<String> model) {
-                Log.d(TAG, "createBox11onSuccess: "+model);
+                Log.d(TAG, "createBox11onSuccess: " + model);
             }
 
             @Override
@@ -284,13 +292,13 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
     /**
      * 查询今天的使用次数
      */
-    public CleaningBean queryTodayCleanCount(int number,int number2) {
+    public CleaningBean queryTodayCleanCount(int number, int number2) {
         QueryBuilder<CleaningBean> qb = cleaningBeanDao.queryBuilder();
         //tomorrowDateStr(0), tomorrowDateStr(1))
         List<CleaningBean> list = qb.where(new WhereCondition.StringCondition("TIME >= ? and TIME <= ?",
                 tomorrowDateStr(number), tomorrowDateStr(number2))).build().list();
-        Log.d(TAG, "tomorrowDateStronStartCommand: "+list.size());
-        if (list.size()<=0) {
+        Log.d(TAG, "tomorrowDateStronStartCommand: " + list.size());
+        if (list.size() <= 0) {
             //添加今天的数据,如果一直不关机呢?那么我们就需要当前时间如何重新插入数据。
             CleaningBean cleaningBean = new CleaningBean();
             cleaningBean.setOutCount("0");
@@ -300,24 +308,25 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
             cleaningBeanDao.insert(cleaningBean);
             return cleaningBean;
         }
-        return  list.get(0);
+        return list.get(0);
     }
 
     /**
      * 获取明天的日期字符串
+     *
      * @return
      */
-    public static long tomorrowDateStr(int number){
-        Date date=new Date();//取时间
+    public static long tomorrowDateStr(int number) {
+        Date date = new Date();//取时间
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(date);
         //把日期往后增加一天.整数往后推,负数往前移动
-        calendar.add(calendar.DATE,number);
+        calendar.add(calendar.DATE, number);
         //这个时间就是日期往后推一天的结果
-        date=calendar.getTime();
+        date = calendar.getTime();
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
         String tomorrowStr = formatter.format(date);
-        Date parse= null;
+        Date parse = null;
         try {
             parse = formatter.parse(tomorrowStr);
         } catch (ParseException e) {
@@ -325,4 +334,74 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
         }
         return parse.getTime();
     }
+
+
+    /**
+     * 获取签到码
+     */
+    public void getCheckCode() {
+        Map<String, String> params = new HashMap<>();
+        params.put("clientId", Heartbeat.deviceId + "");
+        addSubscription(apiStores.getCheckCode(params), new ApiCallback<HttpResult<String>>() {
+
+            @Override
+            public void onSuccess(HttpResult<String> model) {
+                Log.d(TAG, "getCheckCodeSuccess: " + model);
+                String data = model.getData();
+                if (data != null) {
+                    Gson gson = new Gson();
+                    CheckCodeBean imgOrderBean = gson.fromJson(data, CheckCodeBean.class);
+                    mvpView.showCheckCode(imgOrderBean.getRd_Pic());
+                }
+
+            }
+
+            @Override
+            public void onFailure(String msg) {
+                mvpView.getCheckCodeError();
+            }
+
+            @Override
+            public void onFinish() {
+
+            }
+        });
+    }
+
+    /**
+     * 是否为base64数据
+     *
+     * @param imgurl 图片地址
+     * @return
+     */
+    public boolean isBase64Img(String imgurl) {
+        if (!TextUtils.isEmpty(imgurl) &&
+                (imgurl.startsWith("data:image/png;base64,")
+                        || imgurl.startsWith("data:image/*;base64,")
+                        || imgurl.startsWith("data:image/jpg;base64,"))
+        ) {
+
+            return true;
+        }
+        return false;
+
+    }
+
+    /**
+     * base64转换成图片
+     *
+     * @param string
+     * @return
+     */
+    public Bitmap stringToBitmap(String string) {
+        Bitmap bitmap = null;
+        try {
+            byte[] bitmapArray = Base64.decode(string.split(",")[1], Base64.DEFAULT);
+            bitmap = BitmapFactory.decodeByteArray(bitmapArray, 0, bitmapArray.length);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return bitmap;
+    }
+
 }

+ 10 - 0
app/src/main/java/com/sunzee/mvp/homeactivity/HomePageAView.java

@@ -1,5 +1,6 @@
 package com.sunzee.mvp.homeactivity;
 
+import com.bumptech.glide.request.RequestOptions;
 import com.sunzee.base.BaseView;
 
 import java.io.File;
@@ -22,4 +23,13 @@ public interface HomePageAView extends BaseView {
      */
     void getDataSuccess();
 
+    /**
+     * 显示签到码
+     */
+    void showCheckCode(String data);
+
+    /**
+     * 签到码获取失败
+     */
+    void getCheckCodeError();
 }

+ 5 - 0
app/src/main/java/com/sunzee/retrofit/ApiStores.java

@@ -102,5 +102,10 @@ public interface ApiStores {
     //添加厕所格子(有多少个坑)
     @POST("/api/app_equipment/index/createBox.htm")
     Observable<HttpResult<String>> createBox(@QueryMap Map<String, String> params);
+
+    //获取签到二维码
+    @GET("/api/app_alarmRecord/clean/getCode.htm")
+    Observable<HttpResult<String>> getCheckCode(@QueryMap Map<String, String> params);
+
 }
 

+ 4 - 0
app/src/main/java/com/sunzee/service/MyIntentService.java

@@ -186,6 +186,10 @@ public class MyIntentService extends GTIntentService {
                 //远程开关机
                 openOrClose(gson, geTuiBean, kind);
                 break;
+            case "signed":
+                //刷新签到码
+                EventBus.getDefault().post(new ApiMessageEvent("signed",null));
+                break;
         }
 
     }

+ 4 - 16
app/src/main/java/com/sunzee/service/MyService.java

@@ -108,7 +108,7 @@ public class MyService extends Service {
     private String nextTime;
     private String[] lastTimeSplit;
     private String[] nextTimeSplit;
-    public static boolean isLate = true;//记录从后台查询是否过期的情况
+    public static boolean isLate = false;//记录从后台查询是否过期的情况。一开始为false,先让他不检测,得知结果后再执行,否则就会出现假象
 
     @Nullable
     @Override
@@ -1289,6 +1289,9 @@ public class MyService extends Service {
                         bodySensor(5, list2.get(12));
                         //监控6号厕所
                         bodySensor(6, list2.get(13));*/
+                        }else{
+                            ToastUtil.showToast("设备已过期,请充值后使用");
+                            Log.d(TAG, "startClean: "+"设备已过期");
                         }
                     } else if (name.equals("D2")) {
                         String data = String.valueOf(HexadecimalUtil.hex2dec(HexadecimalUtil.flipString(AsciiUtils.asciiByteArray2HexStr(responseFrame.getData())).get(0)));
@@ -1409,14 +1412,6 @@ public class MyService extends Service {
                                                             //是否会卡死,如果会卡死,那么就会复位,复位后不会执行下面的内容。
                                                             if (getLastNextCleanTitole(first))
                                                                 return;
-
-                                                          /*  if ((last == 1 || last == 2 || last == 3) && (first == 4 || first == 5 || first == 6)) {
-                                                                cleanCount = 0;
-                                                                mThreadPoolMyservice.stopWriteMM3();
-                                                                mThreadPoolMyservice.startWriteMM3("M3");
-                                                                Log.d(TAG, "isClean: 开始复位4");
-                                                                return;
-                                                            }*/
                                                             //判断是否有人,是否可以清洗,如果可以,那么继续走下去,如果不可以,直接移除
                                                             if ("1".equals(holeInformation.getBodySensor())) {//这里使用的判断不对,因为一开始就是false
                                                                 Log.d(TAG, "run: 人体传感器检测到还有人,那么单纯靠人体传感器来执行。");
@@ -1594,7 +1589,6 @@ public class MyService extends Service {
 
         int state = holeInformation.getState();
         if (state == 3) {
-
             holeInformation.setState(4);
             holeInformation.setOutTimeDuration(System.currentTimeMillis());//存储他上厕所的时间
         } else if (holeInformation.getState() == 4) {
@@ -1619,12 +1613,6 @@ public class MyService extends Service {
                         if (last != null) {
                             if (getLastNextCleanTitole(number))
                                 return;
-                           /* if ((last == 1 || last == 2 || last == 3) && (number == 4 || number == 5 || number == 6)) {
-                                Log.d(TAG, "isClean: 開始复位1");
-                                mThreadPoolMyservice.stopWriteMM3();
-                                mThreadPoolMyservice.startWriteMM3("M3");
-                                return;
-                            }*/
                         }
                         if (!isCleanOK) {//不再清洗的时候才去清洗。
                             cleanCount++;

+ 192 - 19
app/src/main/java/com/sunzee/ui/activity/HomePageAActivity.java

@@ -1,8 +1,11 @@
 package com.sunzee.ui.activity;
 
 import android.annotation.SuppressLint;
+import android.content.Context;
 import android.content.Intent;
+import android.graphics.Bitmap;
 import android.graphics.Color;
+import android.graphics.Typeface;
 import android.os.Bundle;
 import android.os.Handler;
 import android.support.annotation.Nullable;
@@ -18,16 +21,21 @@ import android.view.Gravity;
 import android.view.KeyEvent;
 import android.view.MenuItem;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.WindowManager;
+import android.widget.Button;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
 import com.hboxs.serialport.frame.ResponseFrame;
 import com.hboxs.serialport.message.Message;
 import com.hboxs.serialport.util.AsciiUtils;
 import com.orhanobut.hawk.Hawk;
 import com.sunzee.R;
-import com.sunzee.adapter.DebugParameterXAdapter;
 import com.sunzee.adapter.HomePageAAdapter;
 import com.sunzee.base.BaseApplication;
 import com.sunzee.base.MvpActivity;
@@ -37,26 +45,35 @@ import com.sunzee.model.HoleInformation;
 import com.sunzee.model.domain.CleaningBean;
 import com.sunzee.model.domain.Name;
 import com.sunzee.model.domain.ParameterBean;
+import com.sunzee.model.message.ApiMessageEvent;
 import com.sunzee.mvp.homeactivity.HomePageAPresenter;
 import com.sunzee.mvp.homeactivity.HomePageAView;
 import com.sunzee.service.MyService;
 import com.sunzee.thread.advanceparameter.ThreadPoolAdvanceParameter;
 import com.sunzee.thread.homepageA.homepage.ThreadPoolHomepageA;
+import com.sunzee.ui.view.CustomSketchMapView;
+import com.sunzee.ui.view.CustomView;
+import com.sunzee.ui.view.CustomViewGrounp;
+import com.sunzee.ui.view.CustomViewSketchMapGrounp;
 import com.sunzee.utils.AdvacedUtil;
 import com.sunzee.utils.GeTuiUtil;
 import com.sunzee.utils.HexadecimalUtil;
 import com.sunzee.utils.LongClickUtils;
+import com.sunzee.utils.PreventSpeedClickUtil;
 import com.sunzee.utils.ToastUtil;
 import com.sunzee.utils.UiUtil;
+import com.wuxiaolong.androidutils.library.LogUtil;
 
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 
+import java.io.ByteArrayOutputStream;
 import java.lang.ref.WeakReference;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.Timer;
 import java.util.TimerTask;
 
@@ -96,23 +113,56 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
     private LinearLayout llSigin;
     private RecyclerView rvToiletState;
     private HomePageAAdapter homePageAAdapter;
+    private ImageView ivSigninCode;
+    private LinearLayout llSigninCodeError;
+    private Button btnFlushCheckCode;
+    private TextView mTvCommit;
+    private static boolean sIsLocation = false;
+    private Boolean wcLocaltion;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_homeactivity);
+        setContentView(R.layout.activity_homeactivity25d);
         EventBus.getDefault().register(this);
         //打开个推
         mGeTuiUtil = new GeTuiUtil(this);
         mGeTuiUtil.geTui();
         initView();
+        initViewCV();
         initEvent();
         //获取实际屏幕参数
         WindowManager manager = this.getWindowManager();
         DisplayMetrics outMetrics = new DisplayMetrics();
         manager.getDefaultDisplay().getMetrics(outMetrics);
+        mvpPresenter.getCheckCode();
     }
 
+    private CustomViewSketchMapGrounp mCustomViewGrounp;
+
+    private void initViewCV() {
+        //为控件设置数据
+        mCustomViewGrounp = findViewById(R.id.cv_custom);
+        List<String> list = new ArrayList<>();
+        for (int i = 0; i < MyService.TOTAL_SUM + 1; i++) {//厕所个数可控。
+            list.add(i + 1 + "");
+        }
+        mCustomViewGrounp.setTextList(list);
+        Map<String, List<Float>> location = Hawk.get("wc_location", null);
+        if (location != null) {
+            for (int i = 0; i < mCustomViewGrounp.getChildCount(); i++) {
+                List list1 = location.get(i + "");
+                if (list1 == null) {
+                    continue;
+                }
+                View childAt = mCustomViewGrounp.getChildAt(i);
+                childAt.setX(Float.valueOf(String.valueOf(list1.get(0))));
+                childAt.setY(Float.valueOf(String.valueOf(list1.get(1))));
+            }
+        }
+    }
+
+
     private void initEvent() {
         //长按事件
         LongClickUtils.setLongClick(new Handler(), tvDate, 2000, new View.OnLongClickListener() {
@@ -137,7 +187,7 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
             @Override
             public void onClick(View v) {
                 drawerLayout.openDrawer(Gravity.LEFT);
-                Log.d(TAG, "openDrawer: "+navigationView.isSelected());
+                Log.d(TAG, "openDrawer: " + navigationView.isSelected());
             }
         });
         ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawerLayout,
@@ -158,6 +208,47 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
             }
         };
         drawerLayout.addDrawerListener(toggle);
+        btnFlushCheckCode.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //防止快速点击
+                if (!PreventSpeedClickUtil.isFastClick()) {
+                    ToastUtil.showToast("点击过快!!!");
+                    return;
+                }
+                mvpPresenter.getCheckCode();
+            }
+        });
+
+        mTvCommit.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //保存位置
+                Map<String, List<Float>> integerMap = mCustomViewGrounp.getIntegerMap1();
+                if (integerMap.size() == 0) {
+                    return;
+                }
+                Map<String, List<Float>> location = Hawk.get("wc_location", null);
+                if (location != null) {
+                    //给控件新位置,替换之前的位置。
+                    for (String s : location.keySet()) {
+                        if (integerMap.containsKey(s)) {
+                            location.put(s, integerMap.get(s));
+                        }
+                    }
+                    //没有变化过位置的也加进去。
+                    for (String s : integerMap.keySet()) {
+                        if (!location.containsKey(s)) {
+                            location.put(s, integerMap.get(s));
+                        }
+                    }
+                    Hawk.put("wc_location", location);
+                } else {
+                    Hawk.put("wc_location", integerMap);
+                }
+                ToastUtil.showToast("保存成功");
+            }
+        });
     }
 
     private Timer timerSigin;
@@ -172,10 +263,10 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
                 myHandler.sendEmptyMessage(4);
             }
         };
-        timerSigin.schedule(timeSiginTimerTak,60*1000);
+        timerSigin.schedule(timeSiginTimerTak, 60 * 1000);
     }
 
-    private void stopSigin(){
+    private void stopSigin() {
         if (timerSigin != null) {
             timerSigin.cancel();
             timerSigin = null;
@@ -186,9 +277,23 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         }
     }
 
+    public static void applyFont(final Context context, final View root, final String fontName) {
+        try {
+            if (root instanceof ViewGroup) {
+                ViewGroup viewGroup = (ViewGroup) root;
+                for (int i = 0; i < viewGroup.getChildCount(); i++)
+                    applyFont(context, viewGroup.getChildAt(i), fontName);
+            } else if (root instanceof TextView)
+                ((TextView) root).setTypeface(Typeface.createFromAsset(context.getAssets(), fontName));
+        } catch (Exception e) {
+            Log.e(TAG, String.format("Error occured when trying to apply %s font for %s view", fontName, root));
+            e.printStackTrace();
+        }
+    }
 
 
     private void initView() {
+        btnFlushCheckCode = findViewById(R.id.btn_refresh_signin_code);
         myHandler = new MyHandler(this);
         mTvTime = findViewById(R.id.tv_time1);
         tvDate = findViewById(R.id.tv_date);
@@ -197,6 +302,7 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         tvWcUser = findViewById(R.id.tv_wcuser);
         tvWcEmpty = findViewById(R.id.tv_wcempty);
         tvWashingTime = findViewById(R.id.tv_washingtime);
+
         tvIn = findViewById(R.id.tv_in);
         tvYesterday = findViewById(R.id.tv_yesterday);
         tvOut = findViewById(R.id.tv_out);
@@ -207,6 +313,15 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         tvCompany = findViewById(R.id.tv_company);
         tvContacts = findViewById(R.id.tv_contacts);
         llSigin = findViewById(R.id.ll_sigin);
+        ivSigninCode = findViewById(R.id.iv_signin_code);
+        llSigninCodeError = findViewById(R.id.ll_signin_code_error);
+        mTvCommit = findViewById(R.id.tv_commit);
+        wcLocaltion = Hawk.get(Name.WCLOCALTION, false);
+        if (wcLocaltion) {
+            mTvCommit.setVisibility(View.VISIBLE);
+        } else {
+            mTvCommit.setVisibility(View.GONE);
+        }
         //设备编号只显示6位
         mTvEquipmentNo = findViewById(R.id.tv_equipment_no1);
         if (Heartbeat.deviceId != null && Heartbeat.deviceId.length() > 7) {
@@ -225,8 +340,8 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         threadPoolHomepageA.stopAll();
         threadPoolHomepageA.startAll();
         mvpPresenter.createBox(MyService.TOTAL_SUM);
-        tvCompany.setText("公司:"+Hawk.get(Name.COMPANY,""));
-        tvContacts.setText("联系人:"+Hawk.get(Name.WAYCONTACTS,""));
+        tvCompany.setText("公司:" + Hawk.get(Name.COMPANY, ""));
+        tvContacts.setText("联系人:" + Hawk.get(Name.WAYCONTACTS, ""));
 
         drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
         navigationView = (NavigationView) findViewById(R.id.navigation_view);
@@ -243,10 +358,19 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         homePageAAdapter = new HomePageAAdapter(MyService.sHoleInformationList);
         rvToiletState.setAdapter(homePageAAdapter);
 
-    }
-
-
+        //设置字体
+        applyFont(this, tvWashingTime, "fonts/impact.ttf");
+        applyFont(this, tvIn, "fonts/impact.ttf");
+        applyFont(this, tvOut, "fonts/impact.ttf");
+        applyFont(this, tvAmmonia, "fonts/impact.ttf");
+        applyFont(this, tvWcUser, "fonts/impact.ttf");
+        applyFont(this, tvWcEmpty, "fonts/impact.ttf");
+        applyFont(this, tvWcToilets, "fonts/impact.ttf");
+        applyFont(this, tvHumidity, "fonts/impact.ttf");
+        applyFont(this, tvTemperature, "fonts/impact.ttf");
+        applyFont(this, tvDate, "fonts/impact.ttf");
 
+    }
 
 
     @Override
@@ -268,6 +392,32 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
     }
 
     @Override
+    public void showCheckCode(String data) {
+        if (mvpPresenter.isBase64Img(data)) {
+            Bitmap bitmap = mvpPresenter.stringToBitmap(data);
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
+            byte[] bytes = baos.toByteArray();
+            //禁止缓存
+            RequestOptions options = new RequestOptions()
+                    .diskCacheStrategy(DiskCacheStrategy.NONE)
+                    .skipMemoryCache(true);
+            Glide.with(BaseApplication.getContext())
+                    .load(bytes)
+                    .apply(options)
+                    .into(ivSigninCode);
+            ivSigninCode.setVisibility(View.VISIBLE);
+            llSigninCodeError.setVisibility(View.GONE);
+        }
+    }
+
+    @Override
+    public void getCheckCodeError() {
+        ivSigninCode.setVisibility(View.GONE);
+        llSigninCodeError.setVisibility(View.VISIBLE);
+    }
+
+    @Override
     protected void onStop() {
         super.onStop();
         Log.d(TAG, "onStoponStop: ");
@@ -309,6 +459,15 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
     }
 
     @Subscribe(threadMode = ThreadMode.MAIN)
+    public void event(ApiMessageEvent messageEvent) {
+        switch (messageEvent.getName()) {
+            case "signed":
+                mvpPresenter.getCheckCode();
+                break;
+        }
+    }
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
     public void event(Message messageEvent) {
         switch (messageEvent.getType()) {
             case connected:
@@ -386,6 +545,7 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         return advertisingPresenter;
     }
 
+
     /**
      * 主要用于更新系统时间
      */
@@ -413,11 +573,23 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
                     activity.tvWcUser.setText(activity.use + "");
                     activity.tvWcEmpty.setText(activity.empty + "");
                     //厕所示意图
-                    if (MyService.sHoleInformationList.size() >= 0) {
+                    for (int i = 0; i < MyService.sHoleInformationList.size(); i++) {
+                        getXValue(MyService.sHoleInformationList.get(i), i, activity.rvToiletState);
+                    }
+                    if (!wcLocaltion) {
                         for (int i = 0; i < MyService.sHoleInformationList.size(); i++) {
-                            getXValue(MyService.sHoleInformationList.get(i),i,activity.rvToiletState);
+                            CustomSketchMapView childAt = (CustomSketchMapView) mCustomViewGrounp.getChildAt(i);
+                            HoleInformation holeInformation = MyService.sHoleInformationList.get(i);
+                            if (holeInformation.isUserAndEmpty()) {
+                                childAt.setText("有");
+                                childAt.setVisibility(View.VISIBLE);
+                            } else {
+                                childAt.setText("无");
+                                childAt.setVisibility(View.GONE);
+                            }
                         }
                     }
+
                     break;
                 case 3://清洗次数的读取。
                     activity.tvIn.setText(activity.cleaningBean.getInCount());
@@ -429,7 +601,7 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
                     break;
                 case 4:
                     if (activity.drawerLayout != null) {
-                        activity. drawerLayout.closeDrawer(GravityCompat.START);
+                        activity.drawerLayout.closeDrawer(GravityCompat.START);
                     }
                     break;
             }
@@ -440,7 +612,8 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
          *
          * @param position 要改变的图片的位置
          */
-        private void getXValue(HoleInformation holeInformation,int position, RecyclerView recyclerView) {
+        private void getXValue(HoleInformation holeInformation, int position, RecyclerView recyclerView) {
+            Log.d(TAG, "厕所" + position + "号," + (holeInformation.isUserAndEmpty() ? "有人" : "无人"));
             View view = recyclerView.getLayoutManager().findViewByPosition(position);
             if (view == null) {
                 Log.d("空1", "getXYValue: p=" + position + "  index=" + position);
@@ -507,20 +680,20 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
             @Override
             public void run() {
                 //上传厕所状态
-                if (useLastToiletsStatus==null) {
+                if (useLastToiletsStatus == null) {
                     useLastToiletsStatus = new ArrayList<>();
                     for (int i = 0; i < MyService.TOTAL_SUM; i++) {
                         useLastToiletsStatus.add("5");
                     }
-                   return;
+                    return;
                 }
                 synchronized (MyService.sCleaningLocationList) {
-                    if (MyService.sHoleInformationList != null&& MyService.sHoleInformationList.size()>0) {
+                    if (MyService.sHoleInformationList != null && MyService.sHoleInformationList.size() > 0) {
                         for (int i = 0; i < MyService.TOTAL_SUM; i++) {
                             String userStates = MyService.sHoleInformationList.get(i).getUserStates();
                             if (!useLastToiletsStatus.get(i).equals(userStates)) {
-                                mvpPresenter.sendStatusOfToiletUse((i+1)+"号",userStates);
-                                useLastToiletsStatus.add(i,userStates);
+                                mvpPresenter.sendStatusOfToiletUse((i + 1) + "号", userStates);
+                                useLastToiletsStatus.add(i, userStates);
                             }
                         }
                     }

+ 0 - 3
app/src/main/java/com/sunzee/ui/fragment/HomepageFragment.java

@@ -11,11 +11,8 @@ import android.widget.TextView;
 
 import com.hboxs.serialport.SerialPortDevice;
 import com.hboxs.serialport.SerialPortManager;
-import com.hboxs.serialport.SerialPortSendQueue;
 import com.hboxs.serialport.frame.ResponseFrame;
-import com.hboxs.serialport.frame.WriteCommandFrame;
 import com.hboxs.serialport.message.Message;
-import com.hboxs.serialport.util.HexUtils;
 import com.orhanobut.hawk.Hawk;
 import com.sunzee.R;
 import com.sunzee.base.MvpFragment;

+ 31 - 4
app/src/main/java/com/sunzee/ui/fragment/OtherFragment.java

@@ -25,6 +25,7 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.LinearLayout;
 import android.widget.RadioButton;
+import android.widget.RadioGroup;
 import android.widget.RelativeLayout;
 import android.widget.SeekBar;
 
@@ -46,8 +47,6 @@ import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 
-import java.io.CharArrayWriter;
-
 /**
  * 其他页界面 fragment
  * 1.4G和wifi的切换的功能
@@ -57,7 +56,7 @@ import java.io.CharArrayWriter;
  * 5.长按退出程序
  * 6.长按重启触摸屏。
  */
-public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherView, SeekBar.OnSeekBarChangeListener, View.OnClickListener {
+public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherView, SeekBar.OnSeekBarChangeListener, View.OnClickListener, RadioGroup.OnCheckedChangeListener {
 
     private SeekBar mSbLight;
     private SeekBar mSbVoice;
@@ -87,6 +86,9 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
     private Button btnContractUpdate;
     private EditText etWayContacts;
     private EditText etContract;
+    private RadioGroup rgIcomMove;
+    private RadioButton rbOpen;
+    private RadioButton rbClose;
 
     @Nullable
     @Override
@@ -123,6 +125,7 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
         btnCheckUpdate.setOnClickListener(this);
         btRrestorationcontractUpdate.setOnClickListener(this);
         btnContractUpdate.setOnClickListener(this);
+        rgIcomMove.setOnCheckedChangeListener(this);
     }
 
     private void initView(View inflate) {
@@ -146,8 +149,18 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
         btnContractUpdate = inflate.findViewById(R.id.btn_contract_update);
         etWayContacts = inflate.findViewById(R.id.et_way_contacts);
         etContract = inflate.findViewById(R.id.et_contract);
+        rgIcomMove = inflate.findViewById(R.id.rg_iconmove);
+        rgIcomMove.setOnCheckedChangeListener(this);
+        rbOpen = inflate.findViewById(R.id.rb_moveopen);
+        rbClose = inflate.findViewById(R.id.rb_moveclose);
+        if (Hawk.get(Name.WCLOCALTION, false)) {
+            rbOpen.setChecked(true);
+            Log.d(TAG, "WCLOCALTION rbOpen: "+Hawk.get(Name.WCLOCALTION, false));
+        } else {
+            rbClose.setChecked(true);
+            Log.d(TAG, "WCLOCALTION rbClose: "+Hawk.get(Name.WCLOCALTION, false));
 
-
+        }
         appCompatCheckBoxes = new AppCompatCheckBox[MyService.TOTAL_SUM];
         appCompatPeopleCheckBoxes = new AppCompatCheckBox[MyService.TOTAL_SUM];
         etPlcContent.setText(Hawk.get(Name.SERIALNUMBER, "4"));
@@ -195,6 +208,7 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
 
         btnCheckUpdate = inflate.findViewById(R.id.btn_tcheckupdate);
 
+
     }
 
     private AppCompatCheckBox getAppCompatCheckBox(int i, boolean isSelectCheckBox) {
@@ -495,4 +509,17 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
     }
 
 
+    @Override
+    public void onCheckedChanged(RadioGroup group, int checkedId) {
+        switch (checkedId) {
+            case R.id.rb_moveopen:
+                boolean put = Hawk.put(Name.WCLOCALTION, true);
+                Log.d(TAG, "WCLOCALTION: "+put);
+                break;
+            case R.id.rb_moveclose:
+                boolean put1 = Hawk.put(Name.WCLOCALTION,false);
+                Log.d(TAG, "WCLOCALTION: "+put1);
+                break;
+        }
+    }
 }

+ 110 - 0
app/src/main/java/com/sunzee/ui/view/CustomSketchMapView.java

@@ -0,0 +1,110 @@
+package com.sunzee.ui.view;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.TextView;
+
+import com.orhanobut.hawk.Hawk;
+import com.sunzee.model.domain.Name;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 可拖动控件
+ */
+@SuppressLint("AppCompatCustomView")
+public class CustomSketchMapView extends TextView {
+    private int moveX;
+    private int moveY;
+    private InformationLocation informationLocation;
+    private List<Float> arr = new ArrayList<>();
+
+
+    public boolean isIsmove() {
+        return ismove;
+    }
+
+    private boolean ismove;
+
+    public CustomSketchMapView(Context context) {
+        this(context, null);
+    }
+
+    public CustomSketchMapView(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public CustomSketchMapView(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    private static final String TAG = "CustomView1";
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent event) {
+        return super.dispatchTouchEvent(event);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        super.onTouchEvent(event);
+        if (Hawk.get(Name.WCLOCALTION, false)) {//如果为true,说明是可以调整的,那么就可以移动。
+            int x = (int) event.getX();
+            int y = (int) event.getY();
+            switch (event.getAction()) {
+                case MotionEvent.ACTION_DOWN:
+                    moveX = x;
+                    moveY = y;
+                    ismove = false;
+                    Log.d(TAG, "ACTION_DOWN: " + ismove);
+                    break;
+                case MotionEvent.ACTION_MOVE:
+                    //计算移动的距离
+                    int mOffsetX = x - moveX;
+                    int mOffsetY = y - moveY;
+                    Log.d(TAG, "mOffsetX: " + mOffsetX);
+                    Log.d(TAG, "mOffsetY: " + mOffsetY);
+                    if (mOffsetX > 2 || mOffsetY > 2 || mOffsetX < -2 || mOffsetY < -2) {
+                        ismove = true;
+                        Log.d(TAG, "ACTION_MOVE: " + ismove);
+                    }
+                    offsetLeftAndRight(mOffsetX);
+                    offsetTopAndBottom(mOffsetY);
+                    break;
+                case MotionEvent.ACTION_UP:
+                    arr.add(getX());
+                    arr.add(getY());
+                    informationLocation.setInformationLocationListener(this, arr, ismove);
+                    break;
+            }
+
+            //调用layout方法来重新放置它的位置
+            if (getX() >= 1422) {
+                setX(1400);
+            } else if (getX() <= 0) {
+                setX(10);
+            }
+            if (getY() >= 770) {
+                setY(760);
+            } else if (getY() <= -1) {
+                setY(10);
+            }
+        }
+        return true;
+    }
+
+
+    public void setInformationLocation(InformationLocation informationLocation) {
+        this.informationLocation = informationLocation;
+    }
+
+    //提供控件的位置和id
+    public interface InformationLocation {
+        void setInformationLocationListener(View view, List<Float> list, boolean ismove);
+    }
+}

+ 1 - 1
app/src/main/java/com/sunzee/ui/view/CustomView.java

@@ -40,7 +40,7 @@ public class CustomView extends TextView {
         super(context, attrs, defStyleAttr);
     }
 
-    private static final String TAG = "CustomView";
+    private static final String TAG = "CustomView1";
 
     @Override
     public boolean dispatchTouchEvent(MotionEvent event) {

+ 3 - 4
app/src/main/java/com/sunzee/ui/view/CustomViewGrounp.java

@@ -47,7 +47,7 @@ public class CustomViewGrounp extends ViewGroup implements CustomView.Informatio
         //先清空布局的子元素
         removeAllViews();
         //添加子view进来
-        Log.d(TAG, "setUpChildren: " + mData.size());
+        Log.d(TAG, "setUpChildren1: " + mData.size());
         for (int i = 0; i < mData.size(); i++) {
             CustomView customView = new CustomView(getContext());
             customView.setId(UiUtil.getResId("cv_" + i, R.id.class));
@@ -60,13 +60,13 @@ public class CustomViewGrounp extends ViewGroup implements CustomView.Informatio
             customView.setOnClickListener(this);
             //设置TextView的相关属性,编剧,位置,颜色等等。
             addView(customView);
-            Log.d(TAG, "setUpChildren: ");
+            Log.d(TAG, "setUpChildren2: ");
         }
 
     }
 
     @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {//如果尺寸不是和match,那么就会出现问题。
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
         measureChildren(widthMeasureSpec, heightMeasureSpec);
 
@@ -84,7 +84,6 @@ public class CustomViewGrounp extends ViewGroup implements CustomView.Informatio
         } else if (heightMode == MeasureSpec.AT_MOST) {
             setMeasuredDimension(width, getTotalHeight());
         }
-
     }
 
     public CustomViewGrounp(Context context) {

+ 257 - 0
app/src/main/java/com/sunzee/ui/view/CustomViewSketchMapGrounp.java

@@ -0,0 +1,257 @@
+package com.sunzee.ui.view;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.orhanobut.hawk.Hawk;
+import com.sunzee.R;
+import com.sunzee.utils.UiUtil;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+/**
+ * 写代码看视频,看完一个视频,先写代码,不要拖,而不是全部看完再写
+ */
+
+/**
+ * 1.继承viewGroup
+ * 2.声明属性,,,getDimension使用float接收
+ */
+public class CustomViewSketchMapGrounp extends ViewGroup implements CustomSketchMapView.InformationLocation, View.OnClickListener {
+    //存储数据
+    private List<String> mData = new ArrayList<>();
+    private Map<String, List<Float>> mIntegerMap = new LinkedHashMap<>();
+    private Map<String, List<Float>> mIntegerMap1 = Hawk.get("wc_location", mIntegerMap);
+    private boolean ismove;
+    private onClickCleaning onClickCleaning;
+
+    public Map<String, List<Float>> getIntegerMap1() {
+        return mIntegerMap1;
+    }
+
+    public void setTextList(List<String> data) {
+        this.mData.clear();
+        this.mData.addAll(data);
+        setUpChildren();
+    }
+
+    private static final String TAG = "CustomViewGrounp";
+
+    private void setUpChildren() {
+        //先清空布局的子元素
+        removeAllViews();
+        //添加子view进来
+        Log.d(TAG, "setUpChildren12: " + mData.size());
+        for (int i = 0; i < mData.size(); i++) {
+            CustomSketchMapView customSketchMapView = new CustomSketchMapView(getContext());
+            customSketchMapView.setId(UiUtil.getResId("cv_" + i, R.id.class));
+            customSketchMapView.setWidth(12);
+            customSketchMapView.setHeight(19);
+            customSketchMapView.setBackgroundResource(R.drawable.in_use);
+            customSketchMapView.setGravity(Gravity.CENTER);
+            customSketchMapView.setTextSize(20);
+            customSketchMapView.setText(mData.get(i));
+            //设置TextView的相关属性,编剧,位置,颜色等等。
+            addView(customSketchMapView);
+            Log.d(TAG, "setUpChildren2: ");
+        }
+
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {//如果尺寸不是和match,那么就会出现问题。
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        measureChildren(widthMeasureSpec, heightMeasureSpec);
+
+        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+        int width = MeasureSpec.getSize(widthMeasureSpec);
+        int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+        int height = MeasureSpec.getSize(heightMeasureSpec);
+
+        if (widthMode == MeasureSpec.AT_MOST && heightMode == MeasureSpec.AT_MOST) {
+            int groupWidth = getMaxWidth();
+            int groupHeight = getTotalHeight();
+            setMeasuredDimension(groupWidth, groupHeight);
+        } else if (widthMode == MeasureSpec.AT_MOST) {
+            setMeasuredDimension(getMaxWidth(), height);
+        } else if (heightMode == MeasureSpec.AT_MOST) {
+            setMeasuredDimension(width, getTotalHeight());
+        }
+    }
+
+    public CustomViewSketchMapGrounp(Context context) {
+        this(context, null);
+    }
+
+    public CustomViewSketchMapGrounp(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public CustomViewSketchMapGrounp(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        int childCount = getChildCount();
+        for (int i = 0; i < childCount; i++) {
+            CustomSketchMapView childAt = (CustomSketchMapView) getChildAt(i);
+            childAt.setInformationLocation(this);
+            childAt.layout(i, i, childAt.getMeasuredWidth(), childAt.getMeasuredHeight());
+        }
+    }
+
+    private int getMaxWidth() {
+        int count = getChildCount();
+        int maxWidth = 0;
+        for (int i = 0; i < count; i++) {
+            int currentWidth = getChildAt(i).getMeasuredWidth();
+            if (maxWidth < currentWidth) {
+                maxWidth = currentWidth;
+            }
+        }
+        return maxWidth;
+    }
+
+    private int getTotalHeight() {
+        int count = getChildCount();
+        int totalHeight = 0;
+        for (int i = 0; i < count; i++) {
+            totalHeight += getChildAt(i).getMeasuredHeight();
+        }
+        return totalHeight;
+    }
+
+
+    @Override
+    public void setInformationLocationListener(View view, List<Float> list, boolean ismove) {
+        this.ismove = ismove;
+        Log.d(TAG, "setInformationLocationListener: "+view.getId());
+        switch (view.getId()) {
+            case R.id.cv_0:
+                Log.d(TAG, "setInformationLocationListener: cv_0");
+                mIntegerMap1.put("0", list);
+                break;
+            case R.id.cv_1:
+                Log.d(TAG, "setInformationLocationListener: cv_1");
+                mIntegerMap1.put("1", list);
+                break;
+            case R.id.cv_2:
+                Log.d(TAG, "setInformationLocationListener: cv_2");
+                mIntegerMap1.put("2", list);
+                break;
+            case R.id.cv_3:
+                mIntegerMap1.put("3", list);
+                break;
+            case R.id.cv_4:
+                mIntegerMap1.put("4", list);
+                break;
+            case R.id.cv_5:
+                mIntegerMap1.put("5", list);
+                break;
+            case R.id.cv_6:
+                mIntegerMap1.put("6", list);
+                break;
+            case R.id.cv_7:
+                mIntegerMap1.put("7", list);
+                break;
+            case R.id.cv_8:
+                mIntegerMap1.put("8", list);
+                break;
+            case R.id.cv_9:
+                mIntegerMap1.put("9", list);
+                break;
+            case R.id.cv_10:
+                mIntegerMap1.put("10", list);
+                break;
+            case R.id.cv_11:
+                mIntegerMap1.put("11", list);
+                break;
+            case R.id.cv_12:
+                mIntegerMap1.put("12", list);
+                break;
+            case R.id.cv_13:
+                mIntegerMap1.put("13", list);
+                break;
+            case R.id.cv_14:
+                mIntegerMap1.put("14", list);
+                break;
+            case R.id.cv_15:
+                mIntegerMap1.put("15", list);
+                break;
+        }
+    }
+
+    @Override
+    public void onClick(View v) {
+        Log.d(TAG, "onClick: "+ismove);
+        if (!ismove) {
+            switch (v.getId()) {
+                case R.id.cv_0:
+                    onClickCleaning.setOnCLickCleaning(1);
+                    break;
+                case R.id.cv_1:
+                    onClickCleaning.setOnCLickCleaning(2);
+                    break;
+                case R.id.cv_2:
+                    onClickCleaning.setOnCLickCleaning(3);
+                    break;
+                case R.id.cv_3:
+                    onClickCleaning.setOnCLickCleaning(4);
+                    break;
+                case R.id.cv_4:
+                    onClickCleaning.setOnCLickCleaning(5);
+                    break;
+                case R.id.cv_5:
+                    onClickCleaning.setOnCLickCleaning(6);
+                    break;
+                case R.id.cv_6:
+                    onClickCleaning.setOnCLickCleaning(7);
+                    break;
+                case R.id.cv_7:
+                    onClickCleaning.setOnCLickCleaning(8);
+                    break;
+                case R.id.cv_8:
+                    onClickCleaning.setOnCLickCleaning(9);
+                    break;
+                case R.id.cv_9:
+                    onClickCleaning.setOnCLickCleaning(10);
+                    break;
+                case R.id.cv_10:
+                    onClickCleaning.setOnCLickCleaning(11);
+                    break;
+                case R.id.cv_11:
+                    onClickCleaning.setOnCLickCleaning(12);
+                    break;
+                case R.id.cv_12:
+                    onClickCleaning.setOnCLickCleaning(13);
+                    break;
+                case R.id.cv_13:
+                    onClickCleaning.setOnCLickCleaning(14);
+                    break;
+                case R.id.cv_14:
+                    onClickCleaning.setOnCLickCleaning(15);
+                    break;
+                case R.id.cv_15:
+                    onClickCleaning.setOnCLickCleaning(16);
+                    break;
+            }
+        }
+    }
+
+    public void setOnClickCleaning(onClickCleaning onClickCleaning) {
+        this.onClickCleaning = onClickCleaning;
+    }
+
+    //客户点击了,那么我们需要进行清洗
+    public interface onClickCleaning {
+        void setOnCLickCleaning(int i);
+    }
+}

BIN
app/src/main/res/drawable-hdpi/data.png


BIN
app/src/main/res/drawable-hdpi/in_use.png


BIN
app/src/main/res/drawable-hdpi/sketchmap.png


BIN
app/src/main/res/drawable-hdpi/sketchmap1.png


BIN
app/src/main/res/drawable-mdpi/data.png


BIN
app/src/main/res/drawable-mdpi/in_use.png


BIN
app/src/main/res/drawable-mdpi/sketchmap.png


BIN
app/src/main/res/drawable-mdpi/sketchmap1.png


BIN
app/src/main/res/drawable-xhdpi/data.png


BIN
app/src/main/res/drawable-xhdpi/in_use.png


BIN
app/src/main/res/drawable-xhdpi/sketchmap.png


BIN
app/src/main/res/drawable-xhdpi/sketchmap1.png


BIN
app/src/main/res/drawable-xxhdpi/data.png


BIN
app/src/main/res/drawable-xxhdpi/in_use.png


BIN
app/src/main/res/drawable-xxhdpi/sketchmap.png


BIN
app/src/main/res/drawable-xxhdpi/sketchmap1.png


BIN
app/src/main/res/drawable-xxxhdpi/data.png


BIN
app/src/main/res/drawable-xxxhdpi/in_use.png


BIN
app/src/main/res/drawable-xxxhdpi/sketchmap.png


BIN
app/src/main/res/drawable-xxxhdpi/sketchmap1.png


+ 6 - 0
app/src/main/res/drawable/shape_cleanwc_rounded_rectangle.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="1dp"
+        android:color="#0e59e1"/>
+</shape>

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

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="1dp"
+        android:color="#1057df" />
+    <solid android:color="#041445"/>
+</shape>

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

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <gradient
+        android:angle="90"
+        android:endColor="#021e78"
+        android:startColor="#0a1a4f" />
+</shape>

+ 3 - 3
app/src/main/res/drawable/shape_headbottom_rectangle.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <corners android:radius="@dimen/dp_15"/>
-    <solid android:color="@color/logo_blue"/>
-</shape>
+<solid android:color="#014DA1"/>
+<corners android:radius="@dimen/dp_50"/>
+</shape>

+ 5 - 2
app/src/main/res/drawable/shape_login_rounded_rectangle.xml

@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <solid android:color="#014DA1"/>
-    <corners android:radius="@dimen/dp_50"/>
+    <stroke
+        android:width="2dp"
+        android:color="#1057df" />
+    <corners android:radius="@dimen/dp_15"/>
+    <solid android:color="#0a1a4f"/>
 </shape>

+ 5 - 0
app/src/main/res/drawable/shape_refresh_signin_code_rectangle.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners android:radius="@dimen/dp_15"/>
+    <solid android:color="@color/logo_blue"/>
+</shape>

+ 53 - 4
app/src/main/res/layout/activity_homeactivity.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
@@ -8,6 +8,7 @@
     android:gravity="center"
     android:background="#011f4b">
 
+
     <android.support.v4.widget.DrawerLayout
         android:id="@+id/drawer_layout"
         android:layout_width="match_parent"
@@ -69,8 +70,8 @@
         <LinearLayout
             android:id="@+id/ll_wcstate"
             android:layout_width="@dimen/dp_226"
-            android:layout_height="@dimen/dp_329"
-            android:layout_centerVertical="true"
+            android:layout_height="@dimen/dp_250"
+            android:layout_marginTop="@dimen/dp_10"
             android:layout_marginLeft="@dimen/dp_31"
             android:background="@drawable/icon1"
             android:orientation="horizontal"
@@ -81,6 +82,53 @@
                 android:layout_height="wrap_content"
                 android:layout_marginRight="@dimen/dp_6" />
         </LinearLayout>
+        <LinearLayout
+            android:layout_width="@dimen/dp_50"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/ll_wcstate"
+            android:layout_marginTop="@dimen/dp_12"
+            android:orientation="vertical"
+            android:layout_marginLeft="@dimen/dp_31">
+            <ImageView
+                android:id="@+id/iv_signin_code"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_50"
+                android:src="@drawable/icon_no_gongzonghao"
+                android:visibility="gone"/>
+            <LinearLayout
+                android:id="@+id/ll_signin_code_error"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_50"
+                android:background="@drawable/icon_no_gongzonghao">
+                <TextView
+                    android:background="#cc000000"
+                    android:textColor="@color/white"
+                    android:gravity="center"
+                    android:padding="@dimen/dp_4"
+                    android:textSize="@dimen/dp_5"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:text="获取失败,请点击下方按钮进行刷新"/>
+            </LinearLayout>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="@dimen/sp_6"
+                android:gravity="center"
+                android:layout_marginTop="@dimen/dp_2"
+                android:text="扫一扫上面的签到码,进行签到"/>
+            <Button
+                android:layout_marginTop="@dimen/dp_2"
+                android:id="@+id/btn_refresh_signin_code"
+                android:layout_width="match_parent"
+                android:textSize="@dimen/dp_5"
+                android:textColor="@color/white"
+                android:gravity="center"
+                android:background="@drawable/shape_login_rounded_rectangle"
+                android:layout_height="@dimen/dp_12"
+                android:text="刷新签到码"/>
+        </LinearLayout>
 
 
         <LinearLayout
@@ -445,6 +493,7 @@
             android:gravity="center"
             android:layout_marginLeft="@dimen/dp_8"
             android:layout_centerVertical="true"
+            android:visibility="gone"
             android:orientation="vertical">
 
             <TextView
@@ -469,4 +518,4 @@
 
 
 
-</LinearLayout>
+</RelativeLayout>

+ 574 - 0
app/src/main/res/layout/activity_homeactivity25d.xml

@@ -0,0 +1,574 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#030e2c"
+    android:orientation="vertical">
+
+    <android.support.v4.widget.DrawerLayout
+        android:id="@+id/drawer_layout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+
+
+        <RelativeLayout
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent">
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/rv_toilet_state"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/dp_6"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/tv_yesterday"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1"
+                android:text="昨日合计进:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/sp_8"
+                android:visibility="gone" />
+
+            <ImageView
+                android:id="@+id/iv_sketchmap"
+                android:layout_width="@dimen/dp_345"
+                android:layout_height="match_parent"
+                android:background="@drawable/sketchmap" />
+            <com.sunzee.ui.view.CustomViewSketchMapGrounp
+                android:id="@+id/cv_custom"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent" />
+
+            <TextView
+                android:id="@+id/tv_commit"
+                android:layout_width="@dimen/dp_50"
+                android:layout_height="@dimen/dp_20"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:background="@drawable/shape_login_rounded_rectangle"
+                android:gravity="center"
+                android:layout_toLeftOf="@id/ll_dataright"
+                android:text="保存位置修改"
+                android:textColor="@color/white"
+                android:textSize="@dimen/sp_6" />
+
+            <LinearLayout
+                android:layout_width="@dimen/dp_50"
+                android:layout_height="wrap_content"
+                android:layout_above="@id/ll_navigation"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginBottom="@dimen/dp_10"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:id="@+id/iv_signin_code"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/dp_50"
+                    android:src="@drawable/icon_no_gongzonghao"
+                    android:visibility="gone" />
+
+                <LinearLayout
+                    android:id="@+id/ll_signin_code_error"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/dp_50"
+                    android:background="@drawable/icon_no_gongzonghao">
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="#cc000000"
+                        android:gravity="center"
+                        android:padding="@dimen/dp_4"
+                        android:text="获取失败,请点击下方按钮进行刷新"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/dp_5" />
+                </LinearLayout>
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/dp_2"
+                    android:gravity="center"
+                    android:text="扫一扫上面的签到码,进行签到"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_6" />
+
+                <Button
+                    android:id="@+id/btn_refresh_signin_code"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/dp_12"
+                    android:layout_marginTop="@dimen/dp_2"
+                    android:background="@drawable/shape_login_rounded_rectangle"
+                    android:gravity="center"
+                    android:text="刷新签到码"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/dp_5" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_dataright"
+                android:layout_toRightOf="@id/iv_sketchmap"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <RelativeLayout
+                    android:layout_width="@dimen/dp_310"
+                    android:layout_height="match_parent"
+                    android:layout_toRightOf="@id/iv_sketchmap">
+
+                    <TextView
+                        android:id="@+id/tv_operationaldata"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="@dimen/dp_12"
+                        android:text="实时运营数据"
+                        android:textColor="#E6EAFDFF"
+                        android:textSize="@dimen/sp_11" />
+
+                    <TextView
+                        android:id="@+id/tv_date"
+                        android:layout_width="@dimen/dp_180"
+                        android:layout_height="wrap_content"
+                        android:layout_alignParentRight="true"
+                        android:layout_marginTop="@dimen/dp_14"
+                        android:text="2021年01月15日 星期五 09:33:11"
+                        android:textColor="#E6EAFDFF"
+                        android:textSize="@dimen/sp_13" />
+
+                    <TextView
+                        android:id="@+id/tv_date2"
+                        android:layout_width="@dimen/dp_56"
+                        android:layout_height="@dimen/dp_14"
+                        android:layout_below="@id/tv_operationaldata"
+                        android:layout_alignLeft="@id/tv_operationaldata"
+                        android:layout_marginTop="@dimen/dp_7"
+                        android:background="@drawable/shape_data_rounded_rectangle"
+                        android:drawableLeft="@drawable/data"
+                        android:gravity="center"
+                        android:paddingVertical="@dimen/dp_2"
+                        android:paddingLeft="@dimen/dp_4"
+                        android:text="数据统计"
+                        android:textColor="#E6EAFDFF"
+                        android:textSize="@dimen/sp_7" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/dp_1"
+                        android:layout_alignBottom="@id/tv_date2"
+                        android:layout_marginLeft="@dimen/dp_11"
+                        android:layout_toRightOf="@id/tv_date2"
+                        android:background="#00259a" />
+
+                    <LinearLayout
+                        android:id="@+id/ll_cleandata"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_below="@id/tv_date2"
+                        android:layout_alignLeft="@id/tv_operationaldata"
+                        android:layout_marginTop="@dimen/dp_6">
+
+                        <LinearLayout
+                            android:layout_width="@dimen/dp_98"
+                            android:layout_height="@dimen/dp_42"
+                            android:layout_below="@id/tv_date2"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:layout_marginTop="@dimen/dp_6"
+                            android:layout_marginRight="@dimen/dp_7"
+                            android:background="@drawable/shape_date2_rounded_rectangle"
+                            android:orientation="vertical"
+                            android:paddingLeft="@dimen/dp_10"
+                            android:paddingTop="@dimen/dp_3">
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="今日清洗合计(次数)"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_6" />
+
+                            <TextView
+                                android:id="@+id/tv_washingtime"
+                                android:layout_width="match_parent"
+                                android:layout_height="wrap_content"
+                                android:gravity="center"
+                                android:text="8,5322,3"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_20" />
+                        </LinearLayout>
+
+                        <LinearLayout
+                            android:layout_width="@dimen/dp_98"
+                            android:layout_height="@dimen/dp_42"
+                            android:layout_below="@id/tv_date2"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:layout_marginTop="@dimen/dp_6"
+                            android:layout_marginRight="@dimen/dp_7"
+                            android:background="@drawable/shape_date2_rounded_rectangle"
+                            android:orientation="vertical"
+                            android:paddingLeft="@dimen/dp_10"
+                            android:paddingTop="@dimen/dp_3">
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="今日合计进厕所(次数)"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_6" />
+
+                            <TextView
+                                android:id="@+id/tv_in"
+                                android:layout_width="match_parent"
+                                android:layout_height="wrap_content"
+                                android:gravity="center"
+                                android:text="8,5322,3"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_20" />
+                        </LinearLayout>
+
+                        <LinearLayout
+                            android:layout_width="@dimen/dp_98"
+                            android:layout_height="@dimen/dp_42"
+                            android:layout_below="@id/tv_date2"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:layout_marginTop="@dimen/dp_6"
+                            android:background="@drawable/shape_date2_rounded_rectangle"
+                            android:orientation="vertical"
+                            android:paddingLeft="@dimen/dp_10"
+                            android:paddingTop="@dimen/dp_3">
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="今日合计出厕所(次数)"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_6" />
+
+                            <TextView
+                                android:id="@+id/tv_out"
+                                android:layout_width="match_parent"
+                                android:layout_height="wrap_content"
+                                android:gravity="center"
+                                android:text="8,5322,3"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_20" />
+                        </LinearLayout>
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:id="@+id/ll_cleandata2"
+                        android:layout_width="@dimen/dp_310"
+                        android:layout_height="wrap_content"
+                        android:layout_below="@id/ll_cleandata"
+                        android:layout_alignLeft="@id/tv_operationaldata"
+                        android:layout_marginTop="@dimen/dp_6">
+
+                        <LinearLayout
+                            android:layout_width="@dimen/dp_98"
+                            android:layout_marginRight="@dimen/dp_7"
+                            android:layout_height="@dimen/dp_42"
+                            android:layout_below="@id/tv_date2"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:layout_marginTop="@dimen/dp_6"
+                            android:background="@drawable/shape_date2_rounded_rectangle"
+                            android:orientation="vertical"
+                            android:paddingLeft="@dimen/dp_10"
+                            android:paddingTop="@dimen/dp_3">
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="当前室内温度(°C)"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_6" />
+
+                            <TextView
+                                android:id="@+id/tv_temperature"
+                                android:layout_width="match_parent"
+                                android:layout_height="wrap_content"
+                                android:gravity="center"
+                                android:text="20°C"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_20" />
+                        </LinearLayout>
+
+                        <LinearLayout
+                            android:layout_width="@dimen/dp_98"
+                            android:layout_height="@dimen/dp_42"
+                            android:layout_below="@id/tv_date2"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:layout_marginTop="@dimen/dp_6"
+                            android:layout_marginRight="@dimen/dp_7"
+                            android:background="@drawable/shape_date2_rounded_rectangle"
+                            android:orientation="vertical"
+                            android:paddingLeft="@dimen/dp_10"
+                            android:paddingTop="@dimen/dp_3">
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="当前室内湿度(%)"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_6" />
+
+                            <TextView
+                                android:id="@+id/tv_humidity"
+                                android:layout_width="match_parent"
+                                android:layout_height="wrap_content"
+                                android:gravity="center"
+                                android:text="56%"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_20" />
+                        </LinearLayout>
+
+                        <LinearLayout
+                            android:layout_width="@dimen/dp_98"
+                            android:layout_height="@dimen/dp_42"
+                            android:layout_below="@id/tv_date2"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:layout_marginTop="@dimen/dp_6"
+                            android:background="@drawable/shape_date2_rounded_rectangle"
+                            android:orientation="vertical"
+                            android:paddingLeft="@dimen/dp_10"
+                            android:paddingTop="@dimen/dp_3">
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:text="室内氨气(PPM)"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_6" />
+
+                            <TextView
+                                android:id="@+id/tv_ammonia"
+                                android:layout_width="match_parent"
+                                android:layout_height="wrap_content"
+                                android:gravity="center"
+                                android:text="0.1PPM"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_20" />
+                        </LinearLayout>
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:id="@+id/ll_cleandata3"
+                        android:layout_width="@dimen/dp_310"
+                        android:layout_height="@dimen/dp_80"
+                        android:layout_below="@id/ll_cleandata2"
+                        android:layout_alignLeft="@id/tv_operationaldata"
+                        android:layout_marginTop="@dimen/dp_10"
+                        android:background="@drawable/shape_date2_rounded_rectangle"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/tv_date3"
+                            android:layout_width="@dimen/dp_56"
+                            android:layout_height="@dimen/dp_14"
+                            android:layout_below="@id/tv_operationaldata"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:drawableLeft="@drawable/data"
+                            android:gravity="center"
+                            android:paddingVertical="@dimen/dp_2"
+                            android:paddingLeft="@dimen/dp_4"
+                            android:text="数据统计"
+                            android:textColor="#E6EAFDFF"
+                            android:textSize="@dimen/sp_7" />
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:gravity="center">
+
+                            <LinearLayout
+                                android:layout_width="@dimen/dp_82"
+                                android:layout_height="@dimen/dp_47"
+                                android:layout_marginRight="@dimen/dp_11"
+                                android:background="@drawable/shape_cleanwc_rounded_rectangle"
+                                android:gravity="center"
+                                android:orientation="vertical">
+
+                                <TextView
+                                    android:id="@+id/tv_wctoilets"
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:text="11"
+                                    android:textColor="#FF2164"
+                                    android:textSize="@dimen/sp_20" />
+
+                                <TextView
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:text="厕所总数"
+                                    android:textColor="#E6EAFDFF"
+                                    android:textSize="@dimen/sp_8" />
+                            </LinearLayout>
+
+                            <LinearLayout
+                                android:layout_width="@dimen/dp_82"
+                                android:layout_height="@dimen/dp_47"
+                                android:layout_marginRight="@dimen/dp_11"
+                                android:background="@drawable/shape_cleanwc_rounded_rectangle"
+                                android:gravity="center"
+                                android:orientation="vertical">
+
+                                <TextView
+                                    android:id="@+id/tv_wcuser"
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:text="11"
+                                    android:textColor="#1FFF8F"
+                                    android:textSize="@dimen/sp_20" />
+
+                                <TextView
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:text="使用中"
+                                    android:textColor="#E6EAFDFF"
+                                    android:textSize="@dimen/sp_8" />
+                            </LinearLayout>
+
+                            <LinearLayout
+                                android:layout_width="@dimen/dp_82"
+                                android:layout_height="@dimen/dp_47"
+                                android:background="@drawable/shape_cleanwc_rounded_rectangle"
+                                android:gravity="center"
+                                android:orientation="vertical">
+
+                                <TextView
+                                    android:id="@+id/tv_wcempty"
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:text="11"
+                                    android:textColor="#FFCC21"
+                                    android:textSize="@dimen/sp_20" />
+
+                                <TextView
+                                    android:layout_width="wrap_content"
+                                    android:layout_height="wrap_content"
+                                    android:text="空置"
+                                    android:textColor="#E6EAFDFF"
+                                    android:textSize="@dimen/sp_8" />
+                            </LinearLayout>
+                        </LinearLayout>
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:layout_width="@dimen/dp_310"
+                        android:layout_height="@dimen/dp_80"
+                        android:layout_below="@id/ll_cleandata3"
+                        android:layout_alignLeft="@id/tv_operationaldata"
+                        android:layout_marginTop="@dimen/dp_10"
+                        android:background="@drawable/shape_date2_rounded_rectangle"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/tv_date4"
+                            android:layout_width="@dimen/dp_56"
+                            android:layout_height="@dimen/dp_14"
+                            android:layout_below="@id/tv_operationaldata"
+                            android:layout_alignLeft="@id/tv_operationaldata"
+                            android:drawableLeft="@drawable/data"
+                            android:gravity="center"
+                            android:paddingVertical="@dimen/dp_2"
+                            android:paddingLeft="@dimen/dp_4"
+                            android:text="查看物料"
+                            android:textColor="#E6EAFDFF"
+                            android:textSize="@dimen/sp_7" />
+
+                        <LinearLayout
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent">
+
+                            <TextView
+                                android:layout_width="match_parent"
+                                android:layout_height="match_parent"
+                                android:gravity="center"
+                                android:text="暂无"
+                                android:textColor="#E6EAFDFF"
+                                android:textSize="@dimen/sp_10" />
+                        </LinearLayout>
+                    </LinearLayout>
+                </RelativeLayout>
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_navigation"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_16"
+                android:layout_alignParentBottom="true"
+                android:background="@drawable/shape_date2_rounded_rectangle"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/tv_equipment_no1"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_toLeftOf="@id/tv_company"
+                    android:text="设备编号:"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_6"
+                    android:textStyle="bold" />
+
+                <TextView
+                    android:id="@+id/tv_company"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_12"
+                    android:layout_toLeftOf="@id/tv_contacts"
+                    android:paddingLeft="@dimen/dp_2"
+                    android:text="公司:"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_6"
+                    android:textStyle="bold" />
+
+                <TextView
+                    android:id="@+id/tv_contacts"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignRight="@id/ll_useCount"
+                    android:layout_marginLeft="@dimen/dp_12"
+                    android:paddingLeft="@dimen/dp_2"
+                    android:text="联系人:"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_6"
+                    android:textStyle="bold" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_sigin"
+                android:layout_width="@dimen/dp_41"
+                android:layout_height="@dimen/dp_41"
+                android:layout_centerVertical="true"
+                android:layout_marginLeft="@dimen/dp_8"
+                android:background="@drawable/shape_radio_signin"
+                android:gravity="center"
+                android:orientation="vertical"
+                android:visibility="gone">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="签到"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_12" />
+            </LinearLayout>
+
+            <android.support.design.widget.NavigationView
+                android:id="@+id/navigation_view"
+                android:layout_width="@dimen/dp_120"
+                android:layout_height="match_parent"
+                android:layout_gravity="start"
+                android:background="#011f4b"
+                android:visibility="gone"
+                app:headerLayout="@layout/header"
+                app:itemIconTint="@color/colorAccent" />
+        </RelativeLayout>
+    </android.support.v4.widget.DrawerLayout>
+</RelativeLayout>

+ 49 - 0
app/src/main/res/layout/fragment_other.xml

@@ -575,6 +575,55 @@
                 android:text="@string/update"
                 android:textColor="@color/white"
                 android:textSize="@dimen/dp_8" />
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/tv_listeningPeople"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:orientation="horizontal">
+                <TextView
+                    android:id="@+id/tv_iconmove"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/dp_40"
+                    android:text="示意图标移动"
+                    android:textColor="@color/logo_blue"
+                    android:textSize="@dimen/dp_12" />
+
+                <RadioGroup
+                    android:id="@+id/rg_iconmove"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/dp_20"
+                    android:layout_toRightOf="@id/tv_net_choose"
+                    android:orientation="horizontal">
+
+                    <RadioButton
+                        android:id="@+id/rb_moveopen"
+                        android:layout_width="@dimen/dp_94"
+                        android:layout_height="@dimen/dp_50"
+                        android:layout_marginLeft="@dimen/dp_30"
+                        android:background="@drawable/selector_net_bg"
+                        android:button="@null"
+                        android:gravity="center"
+                        android:text="开启"
+                        android:textColor="@color/logo_blue"
+                        android:textSize="@dimen/sp_12" />
+
+                    <RadioButton
+                        android:id="@+id/rb_moveclose"
+                        android:layout_width="@dimen/dp_94"
+                        android:layout_height="@dimen/dp_50"
+                        android:layout_marginLeft="@dimen/dp_30"
+                        android:background="@drawable/selector_net_bg"
+                        android:button="@null"
+                        android:gravity="center"
+                        android:text="关闭"
+                        android:textColor="@color/logo_blue"
+                        android:textSize="@dimen/sp_12" />
+                </RadioGroup>
+            </LinearLayout>
         </RelativeLayout>
     </ScrollView>
 

+ 89 - 0
app/tinker-support.gradle

@@ -0,0 +1,89 @@
+apply plugin: 'com.tencent.bugly.tinker-support'
+
+def bakPath = file("${buildDir}/bakApk/")
+
+/**
+ * 此处填写每次构建生成的基准包目录
+ */
+def baseApkDir = "app-0118-09-54-04"
+
+/**
+ * 对于插件各参数的详细解析请参考
+ */
+tinkerSupport {
+
+    // 开启tinker-support插件,默认值true
+    enable = true
+
+    // 指定归档目录,默认值当前module的子目录tinker
+    autoBackupApkDir = "${bakPath}"
+
+    // 是否启用覆盖tinkerPatch配置功能,默认值false
+    // 开启后tinkerPatch配置不生效,即无需添加tinkerPatch
+    overrideTinkerPatchConfiguration = true
+
+    // 编译补丁包时,必需指定基线版本的apk,默认值为空
+    // 如果为空,则表示不是进行补丁包的编译
+    // @{link tinkerPatch.oldApk }
+    baseApk = "${bakPath}/${baseApkDir}/app-release.apk"
+
+    // 对应tinker插件applyMapping
+   // baseApkProguardMapping = "${bakPath}/${baseApkDir}/app-release-mapping.txt"
+
+    // 对应tinker插件applyResourceMapping
+    baseApkResourceMapping = "${bakPath}/${baseApkDir}/app-release-R.txt"
+
+    // 构建基准包和补丁包都要指定不同的tinkerId,并且必须保证唯一性
+    tinkerId = "patch-1.0.10"
+
+    // 构建多渠道补丁时使用
+    // buildAllFlavorsDir = "${bakPath}/${baseApkDir}"
+
+    // 是否启用加固模式,默认为false.(tinker-spport 1.0.7起支持)
+    // isProtectedApp = true
+
+    // 是否开启反射Application模式
+    enableProxyApplication = true
+
+    // 是否支持新增非export的Activity(注意:设置为true才能修改AndroidManifest文件)
+    supportHotplugComponent = true
+
+}
+
+/**
+ * 一般来说,我们无需对下面的参数做任何的修改
+ * 对于各参数的详细介绍请参考:
+ * https://github.com/Tencent/tinker/wiki/Tinker-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97
+ */
+tinkerPatch {
+    //oldApk ="${bakPath}/${appName}/app-release.apk"
+    ignoreWarning = false
+    useSign = true
+    dex {
+        dexMode = "jar"
+        pattern = ["classes*.dex"]
+        loader = []
+    }
+    lib {
+        pattern = ["lib/*/*.so"]
+    }
+
+    res {
+        pattern = ["res/*", "r/*", "assets/*", "resources.arsc", "AndroidManifest.xml"]
+        ignoreChange = []
+        largeModSize = 100
+    }
+
+    packageConfig {
+    }
+    sevenZip {
+        zipArtifact = "com.tencent.mm:SevenZip:1.1.10"
+//        path = "/usr/local/bin/7za"
+    }
+    buildConfig {
+        keepDexApply = false
+        //tinkerId = "1.0.1-base"
+        //applyMapping = "${bakPath}/${appName}/app-release-mapping.txt" //  可选,设置mapping文件,建议保持旧apk的proguard混淆方式
+        //applyResourceMapping = "${bakPath}/${appName}/app-release-R.txt" // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配
+    }
+}

File diff suppressed because it is too large
+ 3504 - 0
app/tinker/app-0116-16-37-05/app-debug-R.txt


BIN
app/tinker/app-0116-16-37-05/app-debug.apk


File diff suppressed because it is too large
+ 3504 - 0
app/tinker/app-0116-16-37-05/app-release-R.txt


BIN
app/tinker/app-0116-16-37-05/app-release.apk


+ 3 - 1
build.gradle

@@ -7,11 +7,13 @@ buildscript {
         maven { url 'https://dl.bintray.com/umsdk/release' }
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.5.2'
+        classpath 'com.android.tools.build:gradle:3.4.2'
 // add greendao plugin
         classpath 'org.greenrobot:greendao-gradle-plugin:3.2.0'//greenDao生产代码插件
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
+        // tinkersupport插件, 其中lastest.release指拉取最新版本,也可以指定明确版本号,例如1.0.4
+        classpath "com.tencent.bugly:tinker-support:1.1.5"
     }
 }