소스 검색

1.增加需要监听的厕所自定义
2.增加需要监听的人体传感器自定义
3.增加次厕所清洗多少次可以复位自定义
4.优化单点清洗功能
5.增加不需要复位也可以上传清洗的订单

Administrator 4 년 전
부모
커밋
356aa155a1
27개의 변경된 파일1330개의 추가작업 그리고 559개의 파일을 삭제
  1. 1 1
      app/build.gradle
  2. 3 1
      app/src/main/AndroidManifest.xml
  3. 9 0
      app/src/main/java/com/sunzee/model/Global.java
  4. 1 1
      app/src/main/java/com/sunzee/model/Heartbeat.java
  5. 18 0
      app/src/main/java/com/sunzee/model/domain/Name.java
  6. 7 1
      app/src/main/java/com/sunzee/mvp/home/HomePresenter.java
  7. 4 3
      app/src/main/java/com/sunzee/mvp/homeactivity/HomePageAPresenter.java
  8. 17 0
      app/src/main/java/com/sunzee/receiver/BootBroadcastReceiver.java
  9. 1 1
      app/src/main/java/com/sunzee/retrofit/ApiStores.java
  10. 3 0
      app/src/main/java/com/sunzee/service/DownPresenter.java
  11. 7 0
      app/src/main/java/com/sunzee/service/DownServer.java
  12. 26 6
      app/src/main/java/com/sunzee/service/MyIntentService.java
  13. 149 72
      app/src/main/java/com/sunzee/service/MyService.java
  14. 37 8
      app/src/main/java/com/sunzee/ui/activity/HomeActivity.java
  15. 116 34
      app/src/main/java/com/sunzee/ui/activity/HomePageAActivity.java
  16. 2 0
      app/src/main/java/com/sunzee/ui/activity/LoginActivity.java
  17. 5 1
      app/src/main/java/com/sunzee/ui/dialog/CheckUpdatesDialog.java
  18. 74 33
      app/src/main/java/com/sunzee/ui/fragment/HomepageFragment.java
  19. 152 0
      app/src/main/java/com/sunzee/ui/fragment/OtherFragment.java
  20. 4 0
      app/src/main/res/drawable/shape_home_mannedtoilet.xml
  21. 1 1
      app/src/main/res/drawable/shape_lt_lb.xml
  22. 1 1
      app/src/main/res/drawable/shape_other_rounded_rectangle.xml
  23. 5 3
      app/src/main/res/layout/activity_home.xml
  24. 397 377
      app/src/main/res/layout/activity_homeactivity.xml
  25. 9 5
      app/src/main/res/layout/activity_login.xml
  26. 277 9
      app/src/main/res/layout/fragment_other.xml
  27. 4 1
      app/src/main/res/values/styles.xml

+ 1 - 1
app/build.gradle

@@ -16,7 +16,7 @@ android {
         minSdkVersion 14
         targetSdkVersion 28
         versionCode 1
-        versionName "1.0.2"
+        versionName "1.0.6"
         manifestPlaceholders = [
                 //个推应用参数,请填写您申请的 GETUI_APP_ID,GETUI_APP_KEY,GETUI_APP_SECRET 值
                 GETUI_APP_ID    : "n4vsaIAi0eAbAkfBfqsUL7",

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

@@ -38,7 +38,9 @@
 
         <activity
             android:name=".ui.activity.HomeActivity"
-            android:windowSoftInputMode="stateHidden|adjustPan"/>
+            android:windowSoftInputMode="stateHidden|adjustPan">
+
+        </activity>
 
         <activity android:name=".ui.activity.LoginActivity" />
         <activity android:name=".ui.activity.AdvertisingActivity">

+ 9 - 0
app/src/main/java/com/sunzee/model/Global.java

@@ -9,7 +9,16 @@ public class Global {
      */
     public static int alarmNumber = 0;
 
+    /**
+     * plc读取负数转换
+     */
     public static final double num = 177.778;
 
+    /**
+     * 串口默认值
+     */
     public static final String dev = "/dev/ttyS"+ Hawk.get(Name.SERIALNUMBER, "4");
+
+    //厕所清洗多少次进行复位。默认是10个。
+    public static final int cleanCount = Hawk.get(Name.CLEANCOUNT,10);
 }

+ 1 - 1
app/src/main/java/com/sunzee/model/Heartbeat.java

@@ -19,7 +19,7 @@ public class Heartbeat {
     //消毒水余量
     public static int disinfectant= 0;
     //气味浓度
-    public static Integer odorConcentration= 1;
+    public static Integer odorConcentration= 2;
     //清洁剂余量
     public static int cleaner= 0;
 

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

@@ -59,4 +59,22 @@ public interface Name {
     String TOILETSNUMBER= "toiletsnumber";
 
 
+    /**
+     * 需要监听的厕所
+     */
+    String ISSELECTCHECKBOX = "isselectcheckbox";
+
+    /**
+     * 需要监听的人体传感器
+     */
+    String ISSELECTPEOPLECHECKBOX ="isselectpeoplecheckbox";
+    //厕所次数
+    String CLEANCOUNT = "cleancount";
+    //上次清洗的厕所
+    String LASTTIME = "lasttime";
+    //下次清洗的厕所
+    String NEXTTIME = "nexttime";
+
+    //单点清洗
+    String SINGLEPOINTCLEANING = "singlepointcleaning";
 }

+ 7 - 1
app/src/main/java/com/sunzee/mvp/home/HomePresenter.java

@@ -27,6 +27,11 @@ import java.util.Map;
  */
 public class HomePresenter extends BasePresenter<HomeView> {
     private static final String TAG = "HomePresenter";
+    private Intent downloadApkIntent;
+
+    public Intent getDownloadApkIntent() {
+        return downloadApkIntent;
+    }
 
     public HomePresenter(HomeView view) {
         attachView(view);
@@ -113,7 +118,7 @@ public class HomePresenter extends BasePresenter<HomeView> {
      */
     public void downloadApk(String url, int version) {
         //开始下载
-        Intent downloadApkIntent = new Intent(BaseApplication.getContext(), DownServer.class);
+        downloadApkIntent = new Intent(BaseApplication.getContext(), DownServer.class);
         Bundle bundle = new Bundle();
         bundle.putString("downloadApkUrl", url);
         bundle.putString("title", "mht" + ".apk");
@@ -121,4 +126,5 @@ public class HomePresenter extends BasePresenter<HomeView> {
         downloadApkIntent.putExtra("download", bundle);
         BaseApplication.getContext().startService(downloadApkIntent);
     }
+
 }

+ 4 - 3
app/src/main/java/com/sunzee/mvp/homeactivity/HomePageAPresenter.java

@@ -284,10 +284,11 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
     /**
      * 查询今天的使用次数
      */
-    public CleaningBean queryTodayCleanCount() {
+    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(0), tomorrowDateStr(1))).build().list();
+                tomorrowDateStr(number), tomorrowDateStr(number2))).build().list();
         Log.d(TAG, "tomorrowDateStronStartCommand: "+list.size());
         if (list.size()<=0) {
             //添加今天的数据,如果一直不关机呢?那么我们就需要当前时间如何重新插入数据。
@@ -297,7 +298,7 @@ public class HomePageAPresenter extends BasePresenter<HomePageAView> {
             cleaningBean.setCleanCount("0");
             cleaningBean.setTime(System.currentTimeMillis());
             cleaningBeanDao.insert(cleaningBean);
-            return null;
+            return cleaningBean;
         }
         return  list.get(0);
     }

+ 17 - 0
app/src/main/java/com/sunzee/receiver/BootBroadcastReceiver.java

@@ -1,8 +1,11 @@
 package com.sunzee.receiver;
 
+import android.app.AlarmManager;
+import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
+import android.os.SystemClock;
 
 import com.sunzee.ui.activity.HomePageAActivity;
 
@@ -11,6 +14,20 @@ public class BootBroadcastReceiver extends BroadcastReceiver {
 
     @Override
     public void onReceive(Context context, Intent intent) {
+        // 启动完成
+        Intent i = new Intent(context, Alarmreceiver.class);
+        i.setAction("arui.alarm.action");
+        PendingIntent sender = PendingIntent.getBroadcast(context, 0,
+                i, 0);
+        long firstime = SystemClock.elapsedRealtime();
+        AlarmManager am = (AlarmManager) context
+                .getSystemService(Context.ALARM_SERVICE);
+
+        // 10秒一个周期,不停的发送广播
+        am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstime,
+                60 * 1000, sender);
+
+
         if (intent.getAction().equals(ACTION)) {
             Intent mainActivityIntent = new Intent(context, HomePageAActivity.class);  // 要启动的Activity
             mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

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

@@ -87,7 +87,7 @@ public interface ApiStores {
     @GET("api/app_alarmRecord/clean/getTime.htm")
     Observable<HttpResult<String>> getBackgroundTime();
 
-    //可以清洗机器开始清洗了,向上面报告
+    //可以清洗机器开始清洗了,向上面报告 0是:定时清洗  1是:随机清洗
     @GET("api/app_alarmRecord/clean/cleanReport.htm")
     Observable<HttpResult<String>> getCleanReport(@QueryMap Map<String, String> params);
 

+ 3 - 0
app/src/main/java/com/sunzee/service/DownPresenter.java

@@ -141,6 +141,9 @@ public class DownPresenter {
 
         return mDownloadManager.enqueue(request);
     }
+    public void remove() {
+        mDownloadManager.remove(mTaskId);
+    }
 
 
     /**

+ 7 - 0
app/src/main/java/com/sunzee/service/DownServer.java

@@ -29,4 +29,11 @@ public class DownServer extends Service {
         mDownPresenter.onStartCommand(intent, flags, startId);
         return super.onStartCommand(intent, flags, startId);
     }
+
+    @Override
+    public void onDestroy() {
+        mDownPresenter.remove();
+        super.onDestroy();
+
+    }
 }

+ 26 - 6
app/src/main/java/com/sunzee/service/MyIntentService.java

@@ -120,10 +120,10 @@ public class MyIntentService extends GTIntentService {
         switch (kind) {
             case "clean":
                 //一键清洗:也就是全蹲位清洗。
-                if (!HomeActivity.isStartingUp) {
+             /*   if (!HomeActivity.isStartingUp) {
                     ToastUtil.showToast("你好,此操作需要在开机后才能操作");
                     break;
-                }
+                }*/
                 //全蹲位清洗,需要在开机的状态才能执行。
                 synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
                     if (MyService.sCleaningLocationList.size()>0) {//大于0的时候才需要处理。
@@ -131,11 +131,18 @@ public class MyIntentService extends GTIntentService {
                         MyService.sCleaningLocationList.clear();
                         MyService. sCleaningLocationList.addFirst(integer);
                     }
-                    for (int i = 1; i <=MyService.TOTAL_SUM; i++) {
-                        if (i==4) {
-                            continue;
+                    boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX,null);
+                    if (isSelectCheckBox != null) {
+                        for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                            if (!isSelectCheckBox[i - 1]) {
+                                continue;
+                            }
+                            MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
+                        }
+                    }else{
+                        for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                            MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                         }
-                        MyService. sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                     }
                     if (!MyService.isCleanOK) {//清洗中,那麼我們就什麼都不做,如果不是清洗中,那麼我們需要進行復位。
                         //开始清洗。
@@ -178,10 +185,23 @@ public class MyIntentService extends GTIntentService {
                 //局部清洗:根据后台传递的序号来决定要清洗的厕所。
                 cleanPositionNum(gson, geTuiBean, kind);
                 break;
+            case "eqeStatus":
+                //远程开关机
+                openOrClose(gson, geTuiBean, kind);
+                break;
         }
 
     }
 
+    private void openOrClose(Gson gson, GeTuiBean geTuiBean, String kind) {
+        String kind_data = geTuiBean.getKind_data();
+        if (kind_data.equals("1")) {
+            //开机
+//            EventBus.getDefault().post(new ApiMessageEvent(Name.BOOTIME, "开机"));
+            EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING,0));
+        }
+    }
+
     public void requestCleanTimeAndRemaining() {
         Map<String, String> params = new HashMap<>();
         params.put("clientId", Heartbeat.deviceId);

+ 149 - 72
app/src/main/java/com/sunzee/service/MyService.java

@@ -1,9 +1,7 @@
 package com.sunzee.service;
 
-import android.app.AlarmManager;
 import android.app.Notification;
 import android.app.NotificationManager;
-import android.app.PendingIntent;
 import android.app.Service;
 import android.content.Context;
 import android.content.Intent;
@@ -12,7 +10,6 @@ import android.os.Bundle;
 import android.os.Environment;
 import android.os.Handler;
 import android.os.IBinder;
-import android.os.SystemClock;
 import android.support.annotation.Nullable;
 import android.support.annotation.RequiresApi;
 import android.text.TextUtils;
@@ -46,13 +43,11 @@ import com.sunzee.model.domain.TimeRuleBean;
 import com.sunzee.model.domain.WarringBean;
 import com.sunzee.model.message.ApiMessageEvent;
 import com.sunzee.model.message.DownLoadMessageEvent;
-import com.sunzee.receiver.Alarmreceiver;
 import com.sunzee.retrofit.ApiCallback;
 import com.sunzee.retrofit.ApiClient;
 import com.sunzee.retrofit.ApiStores;
 import com.sunzee.thread.advanceparameter.ThreadPoolAdvanceParameter;
 import com.sunzee.thread.myservice.ThreadPoolMyservice;
-import com.sunzee.ui.activity.HomeActivity;
 import com.sunzee.ui.dialog.WarringDialog;
 import com.sunzee.utils.FileUtil;
 import com.sunzee.utils.HexadecimalUtil;
@@ -76,6 +71,7 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.LinkedList;
@@ -97,7 +93,7 @@ public class MyService extends Service {
     private boolean isRead = true;
     private boolean isRegularCleaning = false;
     private ThreadPoolAdvanceParameter mPoolAdvanceParameter = new ThreadPoolAdvanceParameter();
-    public final static int TOTAL_SUM = Hawk.get(Name.TOILETSNUMBER,2);
+    public static int TOTAL_SUM = Hawk.get(Name.TOILETSNUMBER, 2);
 
     //存储两个数据:是否上过厕所,一开始上厕所的时间是什么时候
     //CopyOnWriteArrayList并不是完全意义上的线程安全,如果涉及到remove操作,一定要谨慎处理。
@@ -106,10 +102,13 @@ public class MyService extends Service {
     public static final List<HoleInformation> sHoleInformationList = new LinkedList<>();
     //厕所序号从1开始。
     public static final LinkedList<Integer> sCleaningLocationList = new LinkedList<>();//存储要清洗的位置。
-
-    public static volatile boolean isCleanOK = false;
-    private static volatile boolean isToiletClean = true;
+    public static volatile boolean isCleanOK = false;//判断是否清洗中
+    private static volatile boolean isToiletClean = true;//控制只能清洗完毕一次。
     private volatile Integer last;
+    private String lastTime;
+    private String nextTime;
+    private String[] lastTimeSplit;
+    private String[] nextTimeSplit;
 
     @Nullable
     @Override
@@ -128,6 +127,7 @@ public class MyService extends Service {
             }
         }
         EventBus.getDefault().register(this);
+        stopRefreshTime();
         startRefreshime();
     }
 
@@ -139,9 +139,7 @@ public class MyService extends Service {
         if (intent != null) {
             extras = intent.getExtras();
         }
-
         if (extras != null) {
-
             int heartbeat = extras.getInt("heartbeat");
             if (heartbeat == 3) {
                 stopHeartbeat();
@@ -159,10 +157,8 @@ public class MyService extends Service {
         }
         //进程保活相关
         flags = START_STICKY;
-
         //启用前台服务,主要是startForeground()
         String ns = Context.NOTIFICATION_SERVICE;
-
         //获得通知管理器
         NotificationManager manager1 = (NotificationManager) getSystemService(ns);
 
@@ -177,18 +173,6 @@ public class MyService extends Service {
         //定义通知行为
         manager1.notify(0, notification);
 
-        AlarmManager manager = (AlarmManager) getSystemService(ALARM_SERVICE);
-        //读者可以修改此处的Minutes从而改变提醒间隔时间
-        //此处是设置每隔55分钟启动一次
-        //这是55分钟的毫秒数
-        int Minutes = 55 * 60 * 1000;
-        //SystemClock.elapsedRealtime()表示1970年1月1日0点至今所经历的时间
-        long triggerAtTime = SystemClock.elapsedRealtime() + Minutes;
-        //此处设置开启AlarmReceiver这个Service
-        Intent i = new Intent(this, Alarmreceiver.class);
-        PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, 0);
-        //ELAPSED_REALTIME_WAKEUP表示让定时任务的出发时间从系统开机算起,并且会唤醒CPU。
-        manager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, triggerAtTime, pi);
         if (warringDialog == null) {
             warringBeanDao = BaseApplication.getInstances().getDaoSession().getWarringBeanDao();
         }
@@ -207,7 +191,7 @@ public class MyService extends Service {
             if (list.size()<=0) {
                 //添加今天的数据,如果一直不关机呢?那么我们就需要当前时间如何重新插入数据。
                 CleaningBean cleaningBean = new CleaningBean();
-                cleaningBean.setOutCount("0");
+                cleaningBean.setOutCount("0");m
                 cleaningBean.setInCount("0");
                 cleaningBean.setCleanCount("0");
                 cleaningBean.setTime(System.currentTimeMillis());
@@ -222,10 +206,8 @@ public class MyService extends Service {
             mThreadPoolMyservice.stopReadD2();
             mThreadPoolMyservice.startALLRead();
         }
-        //startRead();
         return super.onStartCommand(intent, flags, startId);
         //进程保活相关
-        //return START_STICKY ;
     }
 
 
@@ -247,7 +229,6 @@ public class MyService extends Service {
         }
     }
 
-
     /**
      * 获取明天的日期字符串
      *
@@ -404,24 +385,31 @@ public class MyService extends Service {
 //                isCleaned();//todo 不需要金额也可以清洗
                 //全蹲位清洗,需要在开机的状态才能执行。
                 synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
-                    if (MyService.sCleaningLocationList.size()>0) {//大于0的时候才需要处理。
+                    if (MyService.sCleaningLocationList.size() > 0) {//大于0的时候才需要处理。
                         Integer integer = MyService.sCleaningLocationList.removeFirst();//如果清洗中,那么我们不能全部移除,否则清洗完毕的时候会漏掉一个厕所没有清洗,所以我们留存下来。在假如。
                         MyService.sCleaningLocationList.clear();
-                        MyService. sCleaningLocationList.addFirst(integer);
+                        MyService.sCleaningLocationList.addFirst(integer);
                     }
-                    for (int i = 1; i <=MyService.TOTAL_SUM; i++) {
-                        if (i==4) {
-                            continue;
+                    boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX,null);
+                    if (isSelectCheckBox != null) {
+                        for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                            if (!isSelectCheckBox[i - 1]) {
+                                continue;
+                            }
+                            MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
+                        }
+                    }else{
+                        for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                            MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                         }
-                        MyService. sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                     }
                     if (!MyService.isCleanOK) {//清洗中,那麼我們就什麼都不做,如果不是清洗中,那麼我們需要進行復位。
                         //开始清洗。
                         //EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING,MyService. sCleaningLocationList.getFirst()));
                         //復位成功後,會自己過去清洗的。所以我們不需要管他。
-                        EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING,MyService. sCleaningLocationList.getFirst()));
+                        EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING, MyService.sCleaningLocationList.getFirst()));
                         ToastUtil.showToast("开始复位,准备开始全蹲位清洗,如果有人在里面使用,会等待人出来以后进行清洗。");
-                    }else{
+                    } else {
                         ToastUtil.showToast("已添加入清洗队列,等待本次清洗完成后开始清洗");
                     }
 
@@ -460,15 +448,17 @@ public class MyService extends Service {
                 cleanPositionNum(messageEvent.getData());
                 break;
             case "allcleaning":
-                if (!PreventSpeedClickUtil.isFastClick()) {
-                    return;
-                }
+                Log.d(TAG, "event: 全蹲位执行");
                 if (mThreadPoolMyservice != null) {
                     //监听开机按钮的全蹲位清洗
                     mThreadPoolMyservice.stopWriteMM3();
                     mThreadPoolMyservice.startWriteMM3("M3");
                 }
                 break;
+            case Name.SINGLEPOINTCLEANING://单点清洗
+                Integer needCleaning = (Integer)messageEvent.getData();
+                cleanPositionNumX20(needCleaning,5);
+                break;
             default:
                 break;
 
@@ -543,7 +533,7 @@ public class MyService extends Service {
         });
 
     }
-
+    //可以清洗机器开始清洗了,向上面报告 0是:定时清洗  1是:随机清洗,暂时只作为上传报告的功能。
     private void getCleanReport(int i) {
         Map<String, String> params = new HashMap<>();
         params.put("clientId", Heartbeat.deviceId);
@@ -555,34 +545,41 @@ public class MyService extends Service {
             @Override
             public void onSuccess(HttpResult<String> model) {
                 Log.d(TAG, "getCleanReportonSuccess: " + model);
-                if ("success".equals(model.getData())) {
+                /*if ("success".equals(model.getData())) {
                     //startClean();
                     //全蹲位清洗,需要在开机的状态才能执行。
                     synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
-                        if (MyService.sCleaningLocationList.size()>0) {//大于0的时候才需要处理。
+                        if (MyService.sCleaningLocationList.size() > 0) {//大于0的时候才需要处理。
                             Integer integer = MyService.sCleaningLocationList.removeFirst();//如果清洗中,那么我们不能全部移除,否则清洗完毕的时候会漏掉一个厕所没有清洗,所以我们留存下来。在假如。
                             MyService.sCleaningLocationList.clear();
-                            MyService. sCleaningLocationList.addFirst(integer);
+                            MyService.sCleaningLocationList.addFirst(integer);
                         }
-                        for (int i = 1; i <=MyService.TOTAL_SUM; i++) {
-                            if (i==4) {
-                                continue;
+                        boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX,null);
+                        if (isSelectCheckBox != null) {
+                            for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                                if (!isSelectCheckBox[i - 1]) {
+                                    continue;
+                                }
+                                MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
+                            }
+                        }else{
+                            for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                                MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                             }
-                            MyService. sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                         }
                         if (!MyService.isCleanOK) {//清洗中,那麼我們就什麼都不做,如果不是清洗中,那麼我們需要進行復位。
                             //开始清洗。
                             //EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING,MyService. sCleaningLocationList.getFirst()));
                             //復位成功後,會自己過去清洗的。所以我們不需要管他。
-                            EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING,MyService. sCleaningLocationList.getFirst()));
+                            EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING, MyService.sCleaningLocationList.getFirst()));
                             ToastUtil.showToast("开始复位,准备开始全蹲位清洗,如果有人在里面使用,会等待人出来以后进行清洗。");
-                        }else{
+                        } else {
                             ToastUtil.showToast("已添加入清洗队列,等待本次清洗完成后开始清洗");
                         }
 
                     }
                 } else {
-                }
+                }*/
             }
 
             @Override
@@ -778,8 +775,6 @@ public class MyService extends Service {
             showSugar.put(i, getAdBeansBackup.get(i));
             showOut.put(i, getAdBeansBackup.get(i));
         }
-//        Hawk.put("show_sugar", showSugar);
-//        Hawk.put("show_out", showOut);
 
         getFilesDir();
         LogUtil.d(TAG, "initView: " + getFilesDir().getName());
@@ -1082,7 +1077,6 @@ public class MyService extends Service {
                         mThreadPoolMyservice.startSetM8();
                     }
                 } else if (messageEvent.getName().equals("M8")) {
-
                     mThreadPoolMyservice.stopSetM8();
                     Log.d(TAG, "addCleanTime120event: 開始清洗");
                 } else if (messageEvent.getName().equals("MM3")) {
@@ -1172,20 +1166,63 @@ public class MyService extends Service {
                         String s = Arrays.toString(list2.toArray());
                         Log.d(TAG, "X12event1: " + s);
                         //如果没有开机,那么这里面的代码不会执行。
-                        if (!HomeActivity.isStartingUp) {
+                      /*  if (!HomeActivity.isStartingUp) {
                             return;
-                        }
+                        }*/
                         //监控1号厕所:门锁,以及人体传感器。根据厕所的个数来决定要监听的厕所的个数
-                        for (int i = 1; i<=TOTAL_SUM;i++){
-                            if (i==5 |i==6) {
-                                monitoring(list2.get(i+1), i, "0");
-                                bodySensor(i, list2.get(i+7));
-                                continue;
+                        boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX, null);
+                        boolean[] isSelectPeopleCheckbox = Hawk.get(Name.ISSELECTPEOPLECHECKBOX, null);
+
+                        if (isSelectCheckBox == null) {//厕所状态为空,说明还没设置,也就是全部都监听
+                            for (int i = 1; i <= TOTAL_SUM; i++) {//什么都监听
+                                monitoring(list2.get(i + 1), i, list2.get(i + 7));
+                                bodySensor(i, list2.get(i + 7));
+                            }
+                        } else {//设置过厕所,说明有些不需要监听。
+                            for (int i = 1; i <= TOTAL_SUM; i++) {//判断有哪些不需要监听的。
+                                //是否监听指定的厕所。
+                                if (!isSelectCheckBox[i - 1]) {//true为选中,false为未选中,不需要监听的,我们就过。
+                                    continue;
+                                }
+                                //厕所需要监听,那么我们判断她是否监听指定的人体传感器
+                                if (isSelectPeopleCheckbox == null || isSelectPeopleCheckbox[i - 1]) {//为空,说明害没设置,就是全部监听
+                                    monitoring(list2.get(i + 1), i, list2.get(i + 7));
+                                    bodySensor(i, list2.get(i + 7));
+                                } else {
+                                    monitoring(list2.get(i + 1), i, "0");
+                                    bodySensor(i, list2.get(i + 7));
+                                }
                             }
-                            monitoring(list2.get(i+1), i, list2.get(i+7));
-                            bodySensor(i, list2.get(i+7));
                         }
 
+                        /**
+                         *  if (isSelectCheckBox == null) {//厕所状态为空,说明还没设置,也就是全部都监听
+                         *                             for (int i = 1; i <= TOTAL_SUM; i++) {//什么都监听
+                         *                                 monitoring(list2.get(i + 1), i, list2.get(i + 7));
+                         *                                 bodySensor(i, list2.get(i + 7));
+                         *                             }
+                         *                         } else {//设置过厕所,说明有些不需要监听。
+                         *                             for (int i = 1; i <= TOTAL_SUM; i++) {//判断有哪些不需要监听的。
+                         *                                 //是否监听指定的厕所。
+                         *                                 if (!isSelectCheckBox[i - 1]) {//true为选中,false为未选中,不需要监听的,我们就过。
+                         *                                     continue;
+                         *                                 }
+                         *                                 //厕所需要监听,那么我们判断她是否监听指定的人体传感器
+                         *                                 if (isSelectPeopleCheckbox == null ||isSelectPeopleCheckbox[i-1]) {//为空,说明害没设置,就是全部监听
+                         *                                     monitoring(list2.get(i + 1), i, list2.get(i + 7));
+                         *                                     bodySensor(i, list2.get(i + 7));
+                         *                                 }else{
+                         *                                     if (!isSelectPeopleCheckbox[i-1]) {//true为选中,false为未选中,未选中就是不监听。
+                         *                                         monitoring(list2.get(i + 1), i, "0");
+                         *                                         bodySensor(i, list2.get(i + 7));
+                         *                                         continue;
+                         *                                     }
+                         *                                 }
+                         *
+                         *                             }
+                         *                         }
+                         */
+
                         //监控1号厕所:门锁,以及人体传感器。
                        /* monitoring(list2.get(2), 1, list2.get(8));
                         //监控2号厕所
@@ -1298,6 +1335,7 @@ public class MyService extends Service {
                                         isCleanOK = false;
 
                                         new Handler().postDelayed(new Runnable() {
+
                                             @Override
                                             public void run() {
                                                 synchronized (sCleaningLocationList) {//移除这里出现了问题。
@@ -1309,7 +1347,7 @@ public class MyService extends Service {
                                                     Log.d(TAG, "被移除了2: " + first);
                                                     last = sCleaningLocationList.removeFirst();
                                                     //准备清洗下一个厕所,如果为10次,那么就需要复位。移除之后再复位。
-                                                    if (cleanCount >= 10) {
+                                                    if (cleanCount >= Global.cleanCount) {
                                                         cleanCount = 0;
                                                         mThreadPoolMyservice.stopWriteMM3();
                                                         mThreadPoolMyservice.startWriteMM3("M3");
@@ -1328,13 +1366,17 @@ public class MyService extends Service {
                                                             Log.d(TAG, "被移除了3: " + first);
                                                             sCleaningLocationList.removeFirst();
                                                         } else {
-                                                            if ((last == 1 || last == 2 || last == 3) && (first == 4 || first == 5 || first == 6)) {
+                                                            //是否会卡死,如果会卡死,那么就会复位,复位后不会执行下面的内容。
+                                                            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: 人体传感器检测到还有人,那么单纯靠人体传感器来执行。");
@@ -1369,6 +1411,35 @@ public class MyService extends Service {
         }
     }
 
+    private boolean getLastNextCleanTitole(Integer first) {
+        lastTime = Hawk.get(Name.LASTTIME, "123");
+        nextTime = Hawk.get(Name.NEXTTIME, "456");
+        lastTimeSplit = lastTime.split("");
+        nextTimeSplit = nextTime.split("");
+        boolean isLastTime = false;
+        boolean isNextTime = false;
+        for (int i = 1; i < lastTimeSplit.length; i++) {
+            if (last==Integer.valueOf(lastTimeSplit[i])){
+                isLastTime=true;
+                break;
+            }
+        }
+        for (int i = 1; i < nextTimeSplit.length; i++) {
+            if (first==Integer.valueOf(nextTimeSplit[i])){
+                isNextTime=true;
+                break;
+            }
+        }
+        if (isLastTime && isNextTime) {
+            cleanCount = 0;
+            mThreadPoolMyservice.stopWriteMM3();
+            mThreadPoolMyservice.startWriteMM3("M3");
+            Log.d(TAG, "isClean: 开始复位4");
+            return true;
+        }
+        return false;
+    }
+
     private void bodySensor(int position, String isSomeone1) {
         synchronized (sCleaningLocationList) {
             HoleInformation holeInformation = sHoleInformationList.get(position - 1);
@@ -1392,12 +1463,14 @@ public class MyService extends Service {
                     if (last == null) {
                         return;
                     }
-                    if ((last == 1 || last == 2 || last == 3) && (position == 4 || position == 5 || position == 6)) {
+                    if (getLastNextCleanTitole(position))
+                        return;
+                   /* if ((last == 1 || last == 2 || last == 3) && (position == 4 || position == 5 || position == 6)) {
                         Log.d(TAG, "isClean: 開始复位1");
                         mThreadPoolMyservice.stopWriteMM3();
                         mThreadPoolMyservice.startWriteMM3("M3");
                         return;
-                    }
+                    }*/
                     if (!isCleanOK) {//还没清洗的时候去处理
                         cleanCount++;
                         addTodayCleanCount(1, 0, 1);
@@ -1417,6 +1490,7 @@ public class MyService extends Service {
 
 
     private void monitoring(String number, int position, String isSomeone1) {
+        //todo 取出一个对象,判断是否需要监听。这种方式会增加一个判断和一个赋值
         synchronized (sCleaningLocationList) {//多线程操作需要加上同步锁
             if ("0".equals(number)) {//没人
                 //是否加入清洗
@@ -1438,7 +1512,7 @@ public class MyService extends Service {
         HoleInformation holeInformation = sHoleInformationList.get(number - 1);
         holeInformation.setBodySensor(isSomeone);
         holeInformation.setUserAndEmpty(true);
-        if (!isCleanOK) holeInformation.setUserStates("0");
+        if (!isCleanOK) holeInformation.setUserStates("1");
         if (holeInformation.getState() != 1 && holeInformation.getState() != 3) {
             holeInformation.setState(1);//上厕所
             holeInformation.setTimeDuration(System.currentTimeMillis());//存储他上厕所的时间
@@ -1476,7 +1550,7 @@ public class MyService extends Service {
         HoleInformation holeInformation = sHoleInformationList.get(number - 1);
         holeInformation.setBodySensor(isSomeone);
         holeInformation.setUserAndEmpty(false);
-        if (!isCleanOK) holeInformation.setUserStates("1");
+        if (!isCleanOK) holeInformation.setUserStates("0");
 
         int state = holeInformation.getState();
         if (state == 3) {
@@ -1503,12 +1577,14 @@ public class MyService extends Service {
                         sCleaningLocationList.addLast(number);
                         Log.d(TAG, "为零isCleannumber4: " + number);
                         if (last != null) {
-                            if ((last == 1 || last == 2 || last == 3) && (number == 4 || number == 5 || number == 6)) {
+                            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++;
@@ -1560,6 +1636,7 @@ public class MyService extends Service {
         Log.d(TAG, "cleanPositionNumX20厕所: " + number);
         mThreadPoolMyservice.stopWriteDD120();
         mThreadPoolMyservice.startWriteDD120("D120", "000" + data);
+        getCleanReport(1);
     }
 
     private boolean isOpenReadWarring = true;

+ 37 - 8
app/src/main/java/com/sunzee/ui/activity/HomeActivity.java

@@ -30,6 +30,7 @@ import android.widget.TextView;
 import com.hboxs.serialport.SerialPortSendQueue;
 import com.hboxs.serialport.frame.SetCommandFrame;
 import com.hboxs.serialport.message.Message;
+import com.orhanobut.hawk.Hawk;
 import com.sunzee.R;
 import com.sunzee.base.BaseFragment;
 import com.sunzee.base.MvpActivity;
@@ -46,6 +47,7 @@ import com.sunzee.service.MyService;
 import com.sunzee.ui.dialog.ManagementSystemDialog;
 import com.sunzee.ui.dialog.CheckUpdatesDialog;
 import com.sunzee.ui.dialog.ShutdownDialog;
+import com.sunzee.ui.fragment.HomepageFragment;
 import com.sunzee.utils.FileUtil;
 import com.sunzee.utils.HomePagerSimpleFactory;
 import com.sunzee.utils.LongClickUtils;
@@ -75,7 +77,6 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
     private TextView mTvSystemId;
     private ManagementSystemDialog mManagementSystemDialog;
     private static final String TAG = "HomeActivity";
-    private TextView mTvVersion;
     private TextView mTvUpdataAPK;
     private LinearLayout mLlBlack;
     private ImageView mIvShutownLogo;
@@ -100,7 +101,7 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
     private void initView() {
         mNavigationView = findViewById(R.id.bnv_main_navigationbar);
         mTvVersion1 = findViewById(R.id.tv_version);
-        mTvVersion = findViewById(R.id.tv_version);
+        mTvVersion1.setText(UiUtil.getStringRes(R.string.version_name) + getVersionName());
         mTvUpdataAPK = findViewById(R.id.tv_updatapk);
         mLlBlack = findViewById(R.id.ll_black);
         mIvShutownLogo = findViewById(R.id.iv_shutown_logo);
@@ -123,6 +124,21 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
 
     }
 
+    public String getVersionName() {
+        //获取packagemanager的实例
+        PackageManager packageManager = getPackageManager();
+        //getPackageName()是你当前类的包名,0代表是获取版本信息
+        PackageInfo packInfo = null;
+        try {
+            packInfo = packageManager.getPackageInfo(getPackageName(), 0);
+        } catch (PackageManager.NameNotFoundException e) {
+            e.printStackTrace();
+        }
+        Log.e("TAG", "版本号" + packInfo.versionCode);
+        Log.e("TAG", "版本名" + packInfo.versionName);
+        return packInfo.versionName;
+    }
+
     private void initEvent() {
         mNavigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
             @Override
@@ -404,6 +420,9 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
                     case R.id.btn_confirm:
                         if (isUpdate) {
                             //更新 下载
+                            if (mvpPresenter.getDownloadApkIntent() != null) {
+                                stopService(mvpPresenter.getDownloadApkIntent());
+                            }
                             mvpPresenter.downloadApk(url, version);
                         } else {
                             //不更新
@@ -411,7 +430,10 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
                         }
                         break;
                     case R.id.btn_cancel:
-                        ToastUtil.showToast("取消");
+                        if (mvpPresenter.getDownloadApkIntent() != null) {
+                            stopService(mvpPresenter.getDownloadApkIntent());
+                        }
+                        ToastUtil.showToast("取消下载");
                         updateDialog.dismiss();
                         break;
                 }
@@ -442,7 +464,6 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
             public void onClickListener(int type) {
                 switch (type) {
                     case R.id.btn_confirm:
-
                         //开机
                         //防止快速点击
                         if (!mPreventSpeedClickUtil.isFastClick()) {
@@ -451,6 +472,7 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
                         isStartingUp = true;
                         stopTimerSet();
                         startTimerSet("M3");
+                        HomepageFragment.lastTimeClean = 1;
                         //todo 清空数据
                         synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
                             MyService.sHoleInformationList.clear();
@@ -472,11 +494,18 @@ public class HomeActivity extends MvpActivity<HomePresenter> implements HomeView
                                 MyService.sCleaningLocationList.clear();
                                 MyService.sCleaningLocationList.addFirst(integer);
                             }
-                            for (int i = 1; i <= MyService.TOTAL_SUM+1; i++) {
-                                if (i == 4) {
-                                    continue;
+                            boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX,null);
+                            if (isSelectCheckBox != null) {
+                                for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                                    if (!isSelectCheckBox[i - 1]) {
+                                        continue;
+                                    }
+                                    MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
+                                }
+                            }else{
+                                for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
+                                    MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                                 }
-                                MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
                             }
                             if (!MyService.isCleanOK) {//清洗中,那麼我們就什麼都不做,如果不是清洗中,那麼我們需要進行復位。
                                 //开始清洗。

+ 116 - 34
app/src/main/java/com/sunzee/ui/activity/HomePageAActivity.java

@@ -23,12 +23,12 @@ import com.sunzee.model.Global;
 import com.sunzee.model.Heartbeat;
 import com.sunzee.model.HoleInformation;
 import com.sunzee.model.domain.CleaningBean;
+import com.sunzee.model.domain.HeartbeatBean;
 import com.sunzee.model.domain.ParameterBean;
 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.homepage.ThreadPoolHomepage;
 import com.sunzee.thread.homepageA.homepage.ThreadPoolHomepageA;
 import com.sunzee.utils.AdvacedUtil;
 import com.sunzee.utils.GeTuiUtil;
@@ -44,6 +44,7 @@ import org.greenrobot.eventbus.ThreadMode;
 import java.lang.ref.WeakReference;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Timer;
 import java.util.TimerTask;
 
@@ -54,7 +55,6 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
 
     private static final String TAG = "AdvertisingActivity";
     private GeTuiUtil mGeTuiUtil;
-    private RelativeLayout mRlRoot;
     private TextView mTvTime;
     private MyHandler myHandler;
     private TextView mTvEquipmentNo;
@@ -75,6 +75,9 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
     private TextView tvAmmonia;
     private TextView tvHumidity;
     private TextView tvTemperature;
+    private CleaningBean yesterdayBean;
+    private TextView tvYesterday;
+    private List<String> useLastToiletsStatus;//上一次厕所的使用状态
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -94,7 +97,7 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
 
     private void initEvent() {
         //长按事件
-        LongClickUtils.setLongClick(new Handler(), tvDate, 3000, new View.OnLongClickListener() {
+        LongClickUtils.setLongClick(new Handler(), tvDate, 2000, new View.OnLongClickListener() {
             @Override
             public boolean onLongClick(View v) {
                 Intent intent = new Intent(HomePageAActivity.this, LoginActivity.class);
@@ -107,15 +110,15 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
 
     private void initView() {
         myHandler = new MyHandler(this);
-        mRlRoot = findViewById(R.id.rl_root);
         mTvTime = findViewById(R.id.tv_time1);
         tvDate = findViewById(R.id.tv_date);
         tvWcToilets = findViewById(R.id.tv_wctoilets);
-        tvWcToilets.setText(MyService.TOTAL_SUM+"");
+        tvWcToilets.setText(MyService.TOTAL_SUM + "");
         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);
         tvToiletdiagram1 = findViewById(R.id.tv_toiletdiagram1);
         tvToiletdiagram2 = findViewById(R.id.tv_toiletdiagram2);
@@ -125,11 +128,14 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         //设备编号只显示6位
         mTvEquipmentNo = findViewById(R.id.tv_equipment_no1);
         if (Heartbeat.deviceId != null && Heartbeat.deviceId.length() > 7) {
-            mTvEquipmentNo.setText( UiUtil.getStringRes(R.string.equipment)+(Heartbeat.deviceId != null ? Heartbeat.deviceId.substring(Heartbeat.deviceId.length() - 6) : ""));
+            mTvEquipmentNo.setText(UiUtil.getStringRes(R.string.equipment) + (Heartbeat.deviceId != null ? Heartbeat.deviceId.substring(Heartbeat.deviceId.length() - 6) : ""));
 
         }
+        //关闭RefreshTime、UserState
+        stopRefreshTime();
         startRefreshime();
         startUserState();
+        UpdatetUserState();
         //读取进阶参数
         mPoolAdvanceParameter.stopAll();
         mPoolAdvanceParameter.startALLRead();
@@ -137,7 +143,7 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         mPoolAdvanceParameter.startReadD403();
         threadPoolHomepageA.stopAll();
         threadPoolHomepageA.startAll();
-     //   mvpPresenter.createBox(6);
+        mvpPresenter.createBox(MyService.TOTAL_SUM);
     }
 
 
@@ -163,15 +169,16 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
     protected void onStop() {
         super.onStop();
 
+
     }
 
     @Override
     protected void onDestroy() {
         super.onDestroy();
+        EventBus.getDefault().unregister(this);
         stopRefreshTime();
         mPoolAdvanceParameter.stopAll();
         threadPoolHomepageA.stopALLRead();
-        EventBus.getDefault().unregister(this);
         myHandler.removeCallbacksAndMessages(null);
         myHandler = null;
     }
@@ -225,23 +232,32 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
                         mPoolAdvanceParameter.stopReadD403();
                         Log.d(TAG, "11event: " + (int) HexadecimalUtil.hex2dec(results.get(0)));
                         mvpPresenter.sendPositionNum((int) HexadecimalUtil.hex2dec(results.get(0)));
-                    }else if ("D169".equals(name)) {
+                    } else if ("D169".equals(name)) {
                         Heartbeat.cabinetTm = String.valueOf(HexadecimalUtil.hex2dec(results.get(0)) / 10);
-                        tvTemperature.setText(Heartbeat.cabinetTm+"°C");
-                    }else if ("D170".equals(name)) {
-                        Heartbeat.cabinetHd= String.valueOf(HexadecimalUtil.hex2dec(results.get(0)) / 10);
-                        tvHumidity.setText(Heartbeat.cabinetHd+"%");
-                    }else if ("D172".equals(name)) {
-                        String cabinetTm = String.valueOf(getRealData(results));
-                        tvAmmonia.setText(cabinetTm);
-
-                    }else {
+                        tvTemperature.setText(Heartbeat.cabinetTm + "°C");
+                    } else if ("D170".equals(name)) {
+                        Heartbeat.cabinetHd = String.valueOf(HexadecimalUtil.hex2dec(results.get(0)) / 10);
+                        tvHumidity.setText(Heartbeat.cabinetHd + "%");
+                    } else if ("D172".equals(name)) {
+                        try {
+                            Integer integer = Integer.valueOf(getRealData(results));
+                            if (integer < 0) {
+                                Heartbeat.odorConcentration = 0;
+                            } else {
+                                Heartbeat.odorConcentration = integer;
+                            }
+                        } catch (Exception e) {
+                        }
+                        ;
+                        tvAmmonia.setText(Heartbeat.odorConcentration + "");
+                    } else {
                         mvpPresenter.setAdvanced(name, results, mPoolAdvanceParameter);
                     }
                 }
                 break;
         }
     }
+    //变化的时候,有没有超过30秒
 
     private String getRealData(ArrayList<String> results) {
         String realData = "";
@@ -252,7 +268,7 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         String s1 = Integer.toBinaryString(integer);
         if (s1.length() < 16) {
             //正数
-            realData = String.valueOf(Math.round((l/ Global.num)*10));
+            realData = String.valueOf(Math.round((l / Global.num) * 10));
         } else {
             //负数
             realData = AdvacedUtil.getRealData(s1);
@@ -292,24 +308,24 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
                     break;
                 case 2://厕所的使用状态。
                     //使用个数,空置个数
-                    activity.tvWcUser.setText(activity.use+"");
-                    activity.tvWcEmpty.setText(activity.empty+"");
+                    activity.tvWcUser.setText(activity.use + "");
+                    activity.tvWcEmpty.setText(activity.empty + "");
                     //厕所示意图
-                    if (MyService.sHoleInformationList.size()>=0) {
+                    if (MyService.sHoleInformationList.size() >= 0) {
                         if (MyService.sHoleInformationList.get(0).isUserAndEmpty()) {
-                            activity.tvToiletdiagram1.setBackgroundColor(activity.getResources().getColor(R.color.state_blue));
+                            activity.tvToiletdiagram1.setBackgroundResource(R.drawable.shape_home_mannedtoilet);
                             activity.tvToiletdiagram1.setText("有人");
                             activity.tvToiletdiagram1.setTextColor(Color.WHITE);
-                        }else{
+                        } else {
                             activity.tvToiletdiagram1.setBackgroundResource(R.drawable.icon9);
                             activity.tvToiletdiagram1.setText("无人");
                             activity.tvToiletdiagram1.setTextColor(activity.getResources().getColor(R.color.state_green));
                         }
                         if (MyService.sHoleInformationList.get(1).isUserAndEmpty()) {
-                            activity.tvToiletdiagram2.setBackgroundColor(activity.getResources().getColor(R.color.state_blue));
+                            activity.tvToiletdiagram2.setBackgroundResource(R.drawable.shape_home_mannedtoilet);
                             activity.tvToiletdiagram2.setText("有人");
                             activity.tvToiletdiagram2.setTextColor(Color.WHITE);
-                        }else{
+                        } else {
                             activity.tvToiletdiagram2.setBackgroundResource(R.drawable.icon9);
                             activity.tvToiletdiagram2.setText("无人");
                             activity.tvToiletdiagram2.setTextColor(activity.getResources().getColor(R.color.state_green));
@@ -319,7 +335,11 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
                 case 3://清洗次数的读取。
                     activity.tvIn.setText(activity.cleaningBean.getInCount());
                     activity.tvOut.setText(activity.cleaningBean.getOutCount());
+                    if (activity.yesterdayBean != null) {
+                        activity.tvYesterday.setText("昨日合计”进“:" + activity.yesterdayBean.getInCount());
+                    }
                     activity.tvWashingTime.setText(activity.cleaningBean.getCleanCount());
+
                     break;
             }
         }
@@ -334,7 +354,9 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         timerGetTimerTak = new TimerTask() {
             @Override
             public void run() {
-                myHandler.sendEmptyMessage(1);
+                if (myHandler != null) {
+                    myHandler.sendEmptyMessage(1);
+                }
             }
         };
         timerGetTime.schedule(timerGetTimerTak, 0, 1000);
@@ -359,15 +381,59 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
         timerUseState.schedule(timerUseStateTimerTak, 0, 2000);
     }
 
+
+    private Timer timerUpdateUseState;
+    private TimerTask timerUpdateUseStateTimerTak;
+
+    //上传厕所使用状态的更新
+    private void UpdatetUserState() {
+        timerUpdateUseState = new Timer();
+        timerUpdateUseStateTimerTak = new TimerTask() {
+            @Override
+            public void run() {
+                //上传厕所状态
+
+                if (useLastToiletsStatus==null) {
+                    useLastToiletsStatus = new ArrayList<>();
+                    for (int i = 0; i < MyService.TOTAL_SUM; i++) {
+                        useLastToiletsStatus.add("5");
+                    }
+                   return;
+                }
+                synchronized (MyService.sCleaningLocationList) {
+                    if (MyService.sHoleInformationList != null&& MyService.sHoleInformationList.size()>0) {
+                        for (int i = 0; i < MyService.TOTAL_SUM; i++) {
+                            String userStates = MyService.sHoleInformationList.get(i).getUserStates();
+                            Log.d(TAG, "useLastToiletsStatusrun1: "+useLastToiletsStatus.get(i));
+                            Log.d(TAG, "userStatesrun1: "+userStates);
+                            if (!useLastToiletsStatus.get(i).equals(userStates)) {
+                                mvpPresenter.sendStatusOfToiletUse((i+1)+"号",userStates);
+                                useLastToiletsStatus.add(i,userStates);
+                            }
+                        }
+                    }
+                }
+            }
+        };
+        timerUpdateUseState.schedule(timerUpdateUseStateTimerTak, 0, 3000);
+    }
+
+
     /**
      * 查询今天的使用次数
      */
     private void queryTodayCleanCount() {
-        CleaningBean bean = mvpPresenter.queryTodayCleanCount();
+        CleaningBean bean = mvpPresenter.queryTodayCleanCount(0, 1);
+        CleaningBean yesterday = mvpPresenter.queryTodayCleanCount(-1, 0);
         if (bean != null) {
+            this.yesterdayBean = yesterday;
             cleaningBean = bean;
-            myHandler.sendEmptyMessage(3);
+            if (myHandler != null) {
+                myHandler.sendEmptyMessage(3);
+            }
         }
+
+
     }
 
     /**
@@ -378,24 +444,26 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
             use = 0;
             empty = 0;
             if (MyService.sCleaningLocationList != null) {
-                synchronized (MyService.sCleaningLocationList){
+                synchronized (MyService.sCleaningLocationList) {
                     for (int i = 0; i < MyService.sHoleInformationList.size(); i++) {
                         HoleInformation holeInformation = MyService.sHoleInformationList.get(i);
                         if (holeInformation.isUserAndEmpty()) {//有人
                             use++;
-                        }else{                                  //无人
+                        } else {                                  //无人
                             empty++;
                         }
-                        mvpPresenter.sendStatusOfToiletUse((i+1)+"号",holeInformation.getUserStates());
+                        //发送太过频繁会导致出现问题。
+                        //mvpPresenter.sendStatusOfToiletUse((i+1)+"号",holeInformation.getUserStates());
+                    }
+                    if (myHandler != null) {
+                        myHandler.sendEmptyMessage(2);
                     }
-                    myHandler.sendEmptyMessage(2);
                 }
             }
         }
     }
 
 
-
     private void stopRefreshTime() {
         if (timerGetTime != null) {
             timerGetTime.cancel();
@@ -410,5 +478,19 @@ public class HomePageAActivity extends MvpActivity<HomePageAPresenter> implement
             timerUseState.cancel();
             timerUseState = null;
         }
+
+        if (timerUseStateTimerTak != null) {
+            timerUseStateTimerTak.cancel();
+            timerUseStateTimerTak = null;
+        }
+
+        if (timerUpdateUseState != null) {
+            timerUpdateUseState.cancel();
+            timerUpdateUseState = null;
+        }
+        if (timerUpdateUseStateTimerTak != null) {
+            timerUpdateUseStateTimerTak.cancel();
+            timerUpdateUseStateTimerTak = null;
+        }
     }
 }

+ 2 - 0
app/src/main/java/com/sunzee/ui/activity/LoginActivity.java

@@ -92,6 +92,7 @@ public class LoginActivity extends MvpActivity<LoginPresenter> implements LoginV
                 imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
                 break;
             case R.id.tv_userlogin:
+               // showLoading();
                 //登录功能,只需要提供字符串就可以进行一个判断。
                 mvpPresenter.login(mEtUserName.getText().toString().trim(), mEtUserPassword.getText().toString().trim());
                 break;
@@ -102,6 +103,7 @@ public class LoginActivity extends MvpActivity<LoginPresenter> implements LoginV
     }
 
     private void gotoAdvertisingActivity() {
+      //  hideLoading();
         startActivity(new Intent(LoginActivity.this, HomePageAActivity.class));
         finish();
     }

+ 5 - 1
app/src/main/java/com/sunzee/ui/dialog/CheckUpdatesDialog.java

@@ -12,7 +12,9 @@ import android.widget.TextView;
 
 import com.sunzee.R;
 import com.sunzee.model.domain.Name;
+import com.sunzee.utils.PreventSpeedClickUtil;
 import com.sunzee.utils.SharedPreferencesUtils;
+import com.sunzee.utils.ToastUtil;
 import com.sunzee.utils.UiUtil;
 
 /**
@@ -166,11 +168,13 @@ public class CheckUpdatesDialog extends Dialog implements View.OnClickListener {
 
     @Override
     public void onClick(View v) {
-
         switch (v.getId()) {
             case R.id.btn_cancel:
                 dismiss();
                 break;
+            case R.id.btn_confirm:
+                btnCancel.setText("取消下载");
+                break;
         }
         listener.onClickListener(v.getId());
 

+ 74 - 33
app/src/main/java/com/sunzee/ui/fragment/HomepageFragment.java

@@ -50,6 +50,7 @@ public class HomepageFragment extends MvpFragment<HomePagePresenter> implements
     private PreventSpeedClickUtil mPreventSpeedClickUtil;
     private ThreadPoolHomepage mThreadPoolHomepage = new ThreadPoolHomepage();
     private int cleaningLocation = 1;
+    public static int lastTimeClean = -1;//记录上次清洗的是不是三号厕所
 
     @Nullable
     @Override
@@ -71,18 +72,15 @@ public class HomepageFragment extends MvpFragment<HomePagePresenter> implements
                     return;
                 }
                 Map<String, List<Float>> location = Hawk.get("location", null);
-                Log.d(TAG, "onClick: " + location);
                 if (location != null) {
                     //给控件新位置,替换之前的位置。
                     for (String s : location.keySet()) {
-                        Log.d(TAG, "onClick: " + s);
                         if (integerMap.containsKey(s)) {
                             location.put(s, integerMap.get(s));
                         }
                     }
                     //没有变化过位置的也加进去。
                     for (String s : integerMap.keySet()) {
-                        Log.d(TAG, "onClick: " + s);
                         if (!location.containsKey(s)) {
                             location.put(s, integerMap.get(s));
                         }
@@ -148,13 +146,6 @@ public class HomepageFragment extends MvpFragment<HomePagePresenter> implements
         mCustomViewGrounp = inflate.findViewById(R.id.cv_custom);
         List<String> list = new ArrayList<>();
         for (int i = 0; i < MyService.TOTAL_SUM+1; i++) {//厕所个数可控。
-            if (i == 6) {
-                list.add("走廊");
-                continue;
-            } else if (i == 7) {
-                list.add("洗手台");
-                continue;
-            }
             list.add(i + 1 + "号厕所");
         }
         mCustomViewGrounp.setTextList(list);
@@ -211,30 +202,35 @@ public class HomepageFragment extends MvpFragment<HomePagePresenter> implements
                         if (!mPreventSpeedClickUtil.isFastClick500()) {
                             return;
                         }
-                        //判断是否过期,或者是否次数以到。
-                        showLoading();
-                        Log.d(TAG, "onClickListener: " + cleaningLocation);
-//                        mvpPresenter.isCanWrite();// todo 判断是否有钱才可以清洗,我们现在使用的是无钱模式。
-                        startClean();
-                        /*//全蹲位清洗,需要在开机的状态才能执行。
-                        synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
-                            if (MyService.sCleaningLocationList.size() > 0) {//大于0的时候才需要处理。
-                                Integer integer = MyService.sCleaningLocationList.removeFirst();//如果清洗中,那么我们不能全部移除,否则清洗完毕的时候会漏掉一个厕所没有清洗,所以我们留存下来。在假如。
-                                MyService.sCleaningLocationList.clear();
-                                MyService.sCleaningLocationList.addFirst(integer);
-                            }
-                            MyService.sCleaningLocationList.addLast(cleaningLocation);//从尾部添加。如果集合中已经存在呢?
-                            if (!MyService.isCleanOK) {//清洗中,那麼我們就什麼都不做,如果不是清洗中,那麼我們需要進行復位。
-                                //开始清洗。
-                                //EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING,MyService. sCleaningLocationList.getFirst()));
-                                //復位成功後,會自己過去清洗的。所以我們不需要管他。
-                                EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING, MyService.sCleaningLocationList.getFirst()));
-                                ToastUtil.showToast("开始复位,准备开始清洗,如果有人在里面使用,会等待人出来以后进行清洗。");
-                            } else {
-                                ToastUtil.showToast("已添加入清洗队列,等待本次清洗完成后开始清洗");
+                        String nextTime = Hawk.get(Name.LASTTIME, "123");
+                        Log.d(TAG, "cleaningLocation onClickListener: "+cleaningLocation);
+                        Log.d(TAG, "nextTime onClickListener: "+nextTime);
+                        Log.d(TAG, "lastTimeClean onClickListener: "+lastTimeClean);
+                        String[] nextTimeSplit = nextTime.split("");
+                        boolean isNextTime = false;
+                        for (int i = 1; i < nextTimeSplit.length; i++) {
+                           /* if (cleaningLocation==Integer.valueOf(nextTimeSplit[i])) {
+                                ToastUtil.showToast("清洗完该号厕所需要再一次开机复位才能清洗其他厕所。");
+                            }*/
+                           //如果不等于这些,说明是45号厕所,那么就需要复位才能清洗。
+                            if (lastTimeClean!=-1) {
+                                if (lastTimeClean!=Integer.valueOf(nextTimeSplit[i])){
+                                    isNextTime=true;
+                                    break;
+                                }
                             }
-
-                        }*/
+                        }
+                        if (!isNextTime) {
+                            //判断是否过期,或者是否次数以到。
+                            showLoading();
+                            Log.d(TAG, "onClickListener: " + cleaningLocation);
+//                        mvpPresenter.isCanWrite();// todo 判断是否有钱才可以清洗,我们现在使用的是无钱模式。
+//                            startClean();
+                            addCleaning(cleaningLocation);
+                            lastTimeClean = cleaningLocation;
+                        }else{
+                            ToastUtil.showToast("需要再一次开机复位才能清洗其他厕所,因为轨迹不同。");
+                        }
                         mStartCleaningDialog.dismiss();
                         break;
                     case R.id.btn_cancel:
@@ -267,4 +263,49 @@ public class HomepageFragment extends MvpFragment<HomePagePresenter> implements
     public void haveExpired() {
         ToastUtil.showToast("已过期,请充值后使用哦。");
     }
+
+
+    private void addCleaning(int needCleaning){
+        synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
+            if (MyService.sCleaningLocationList.size() > 0) {//大于0的时候才需要处理。
+                Integer integer = MyService.sCleaningLocationList.removeFirst();//如果清洗中,那么我们不能全部移除,否则清洗完毕的时候会漏掉一个厕所没有清洗,所以我们留存下来。在假如。
+                MyService.sCleaningLocationList.clear();
+                MyService.sCleaningLocationList.addFirst(integer);
+                MyService.sCleaningLocationList.addLast(needCleaning);
+                ToastUtil.showToast("已添加入清洗队列,等待本次清洗完成后开始清洗");
+            }else{
+                MyService.sCleaningLocationList.addLast(needCleaning);
+                if (!MyService.isCleanOK) {
+                    EventBus.getDefault().post(new ApiMessageEvent(Name.SINGLEPOINTCLEANING, needCleaning));
+
+                    ToastUtil.showToast("准备开始清洗,如果有人在里面使用,会等待人出来以后进行清洗。");
+                }else{
+                    ToastUtil.showToast("已添加入清洗队列,等待本次清洗完成后开始清洗");
+                }
+            }
+
+        }
+    }
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 152 - 0
app/src/main/java/com/sunzee/ui/fragment/OtherFragment.java

@@ -11,6 +11,7 @@ import android.os.Bundle;
 import android.provider.Settings;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.v7.widget.AppCompatCheckBox;
 import android.telephony.TelephonyManager;
 import android.util.Log;
 import android.view.LayoutInflater;
@@ -22,6 +23,7 @@ import android.view.WindowManager;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
 import android.widget.EditText;
+import android.widget.LinearLayout;
 import android.widget.RadioButton;
 import android.widget.RelativeLayout;
 import android.widget.SeekBar;
@@ -35,6 +37,7 @@ import com.sunzee.model.message.NetMessageEvent;
 import com.sunzee.mvp.other.OtherPresenter;
 import com.sunzee.mvp.other.OtherView;
 import com.sunzee.receiver.NetworkConnectChangedReceiver;
+import com.sunzee.service.MyService;
 import com.sunzee.ui.dialog.WifiDialog;
 import com.sunzee.utils.ToastUtil;
 import com.sunzee.utils.UiUtil;
@@ -66,6 +69,19 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
     private Button btnSquattingContentUdate;
     private EditText etPlcContent;
     private EditText etSquattingContent;
+    private LinearLayout llCheckBox;
+    private AppCompatCheckBox[] appCompatCheckBoxes;//存储动态创建的check,监听厕所
+    private AppCompatCheckBox[] appCompatPeopleCheckBoxes;//存储动态创建的check,监听人体传感器
+    private Button btnCheckUpdate;
+    private boolean[] isSelectCheckBox;//厕所是否选中
+    private boolean[] isSelectPeopleCheckbox;//人体传感器是否选中
+    private LinearLayout llPeopleCheckBox;
+    private Button btnPCheckUpdate;
+    private EditText etCleanCountContent;
+    private Button btnCleanCount;
+    private EditText etRestorationcontract;
+    private EditText etRestorationwayContacts;
+    private Button btRrestorationcontractUpdate;
 
     @Nullable
     @Override
@@ -82,7 +98,9 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
         //如果进度条发生改变
         mSbVoice.setOnSeekBarChangeListener(this);
         mRbMobileNetWork.setOnClickListener(this);
+        btnPCheckUpdate.setOnClickListener(this);
         mRbWifi.setOnClickListener(this);
+        btnCleanCount.setOnClickListener(this);
         rlOther.setOnTouchListener(new View.OnTouchListener() {
             @SuppressLint("ClickableViewAccessibility")
             @Override
@@ -97,6 +115,8 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
         });
         btnPlcContentUdate.setOnClickListener(this);
         btnSquattingContentUdate.setOnClickListener(this);
+        btnCheckUpdate.setOnClickListener(this);
+        btRrestorationcontractUpdate.setOnClickListener(this);
     }
 
     private void initView(View inflate) {
@@ -111,6 +131,80 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
         etSquattingContent = inflate.findViewById(R.id.et_squatting_content);
         etPlcContent.setText(Hawk.get(Name.SERIALNUMBER, "4"));
         etSquattingContent.setText(Hawk.get(Name.TOILETSNUMBER,2)+"");
+        llCheckBox = inflate.findViewById(R.id.ll_toiletcheckBox);
+        btnPCheckUpdate = inflate.findViewById(R.id.btn_pcheckupdate);
+        llPeopleCheckBox = inflate.findViewById(R.id.ll_peoplecheckBox);
+        appCompatCheckBoxes = new AppCompatCheckBox[MyService.TOTAL_SUM];
+        appCompatPeopleCheckBoxes = new AppCompatCheckBox[MyService.TOTAL_SUM];
+        etCleanCountContent = inflate.findViewById(R.id.et_cleancount_content);
+        etCleanCountContent.setText(Hawk.get(Name.CLEANCOUNT,10)+"");
+        btnCleanCount = inflate.findViewById(R.id.btn_cleancount);
+        etRestorationcontract = inflate.findViewById(R.id.et_restorationway_contacts);
+        etRestorationwayContacts = inflate.findViewById(R.id.et_restorationcontract);
+        btRrestorationcontractUpdate = inflate.findViewById(R.id.btn_restorationcontract_update);
+        etRestorationcontract.setText(Hawk.get(Name.NEXTTIME,"456"));
+        etRestorationwayContacts.setText(Hawk.get(Name.LASTTIME,"123"));
+
+        //如果没有监听,那么我们默认赋值为true
+        isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX,null);
+        isSelectPeopleCheckbox = Hawk.get(Name.ISSELECTPEOPLECHECKBOX,null);
+        if (isSelectPeopleCheckbox==null) {//如果之前没有存储,那么我们重新创建,并初始化值。
+            isSelectPeopleCheckbox = initTotileCheckBox();
+        }else{
+            if (isSelectPeopleCheckbox.length!= MyService.TOTAL_SUM) {
+                isSelectPeopleCheckbox =  initTotileCheckBox();
+            }
+        }
+        for (int i = 0; i < MyService.TOTAL_SUM; i++) {
+            //生成一个厕所状态checkbox按钮
+            AppCompatCheckBox aCheckBox = getAppCompatCheckBox(i,isSelectPeopleCheckbox[i]);
+            //生成一个人体感应的checkbox按钮
+
+            appCompatPeopleCheckBoxes[i]=aCheckBox;
+            llPeopleCheckBox.addView(aCheckBox);
+        }
+
+
+
+        if (isSelectCheckBox==null) {//如果之前没有存储,那么我们重新创建,并初始化值。
+            isSelectCheckBox = initTotileCheckBox();
+        }else{
+            if (isSelectCheckBox.length!= MyService.TOTAL_SUM) {
+                isSelectCheckBox = initTotileCheckBox();
+            }
+        }
+        for (int i = 0; i < MyService.TOTAL_SUM; i++) {
+            //生成一个厕所状态checkbox按钮
+            AppCompatCheckBox aCheckBox = getAppCompatCheckBox(i,isSelectCheckBox[i]);
+            //生成一个人体感应的checkbox按钮
+
+            appCompatCheckBoxes[i]=aCheckBox;
+            llCheckBox.addView(aCheckBox);
+        }
+
+        btnCheckUpdate = inflate.findViewById(R.id.btn_tcheckupdate);
+
+    }
+
+    private AppCompatCheckBox getAppCompatCheckBox(int i,boolean isSelectCheckBox) {
+        AppCompatCheckBox aCheckBox =new AppCompatCheckBox(getContext());
+        aCheckBox.setText(i+1+"号");
+        aCheckBox.setChecked(isSelectCheckBox);
+        aCheckBox.setTextColor(UiUtil.getColorRes(R.color.logo_blue));
+        aCheckBox.setTextSize(UiUtil.getDimensionRes(R.dimen.sp_8));//不能直接写R.dimen.sp_7,否则直接获取60000多,而不是7sp
+        aCheckBox.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
+        return aCheckBox;
+    }
+
+    /**
+     * 初始化厕所
+     */
+    private boolean[] initTotileCheckBox() {
+        boolean[] totalSum = new boolean[MyService.TOTAL_SUM];
+        for (int i = 0; i < totalSum.length; i++) {
+            totalSum[i] = true;
+        }
+        return totalSum;
     }
 
     @Override
@@ -338,9 +432,67 @@ public class OtherFragment extends MvpFragment<OtherPresenter> implements OtherV
                     ToastUtil.showToast("请输入个数");
                     break;
                 }
+                MyService.TOTAL_SUM = Integer.valueOf(squattingContent);
                 Hawk.put(Name.TOILETSNUMBER,Integer.valueOf(squattingContent));
+                ToastUtil.showToast(UiUtil.getStringRes(R.string.update_success)+",重启触摸屏后生效");
+                break;
+            case R.id.btn_tcheckupdate:
+                for (int i = 0; i < appCompatCheckBoxes.length; i++) {
+                    //我们需要将状态存储起来,进来的时候需要读取,清洗的时候需要读取。
+                    isSelectCheckBox[i]= appCompatCheckBoxes[i].isChecked();
+                }
+                Hawk.put(Name.ISSELECTCHECKBOX,isSelectCheckBox);
+                ToastUtil.showToast(UiUtil.getStringRes(R.string.update_success)+",重启触摸屏后生效");
+                break;
+            case R.id.btn_pcheckupdate:
+                for (int i = 0; i < appCompatPeopleCheckBoxes.length; i++) {
+                    //我们需要将状态存储起来,进来的时候需要读取,清洗的时候需要读取。
+                 isSelectPeopleCheckbox[i] = appCompatPeopleCheckBoxes[i].isChecked();
+                }
+                Hawk.put(Name.ISSELECTPEOPLECHECKBOX,isSelectPeopleCheckbox);
+                ToastUtil.showToast(UiUtil.getStringRes(R.string.update_success)+",重启触摸屏后生效");
+                break;
+            case R.id.btn_cleancount:
+                String trim = etCleanCountContent.getText().toString().trim();
+                if (trim != null && !("".equals(trim))) {
+                    Hawk.put(Name.CLEANCOUNT,Integer.valueOf(trim));
+                }
                 ToastUtil.showToast(UiUtil.getStringRes(R.string.update_success));
                 break;
+            case R.id.btn_restorationcontract_update:
+                //123
+                String lastTime = etRestorationwayContacts.getText().toString().trim();//右边
+                //456
+                String nextTime = etRestorationcontract.getText().toString().trim();//左边
+                if ("".equals(lastTime) &&"".equals(nextTime)) {
+                    ToastUtil.showToast("修改失败");
+                    return;
+                }
+                Hawk.put(Name.LASTTIME,lastTime);
+                Hawk.put(Name.NEXTTIME,nextTime);
+                ToastUtil.showToast(UiUtil.getStringRes(R.string.update_success)+",重启触摸屏后生效");
+                /*String[] lastTimeSplit = lastTime.split("");
+                String[] nextTimeSplit = nextTime.split("");
+                Log.d(TAG, "SplitonClick1: "+lastTimeSplit.length);
+                Log.d(TAG, "SplitonClick1:"+nextTimeSplit.length);
+                boolean isLastTime = false;
+                boolean isNextTime = false;
+                for (int i = 1; i < lastTimeSplit.length; i++) {
+                    Log.d(TAG, "lastTimeSplitonClick: "+lastTimeSplit[i]);
+                    if (10==Integer.valueOf(lastTimeSplit[i])){
+                        isLastTime=true;
+                        break;
+                    }
+                }
+                for (int i = 1; i < nextTimeSplit.length; i++) {
+                    Log.d(TAG, "nextTimeSplitonClick: "+nextTimeSplit[i]);
+
+                    if (21==Integer.valueOf(nextTimeSplit[i])){
+                        isNextTime=true;
+                        break;
+                    }
+                }*/
+                break;
         }
     }
 

+ 4 - 0
app/src/main/res/drawable/shape_home_mannedtoilet.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#32a8ff" />
+</shape>

+ 1 - 1
app/src/main/res/drawable/shape_lt_lb.xml

@@ -2,7 +2,7 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="rectangle">
     <!-- 左上 左下 -->
-    <solid android:color="@color/logo_blue" />
+    <solid android:color="#EDF2FE" />
     <corners
         android:bottomLeftRadius="8dp"
         android:topLeftRadius="8dp"

+ 1 - 1
app/src/main/res/drawable/shape_other_rounded_rectangle.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <solid android:color="#CDD7ED" />
+    <solid android:color="@color/logo_blue" />
     <!-- 主体背景颜色值 -->
     <corners android:radius="@dimen/dp_5" />
 </shape>

+ 5 - 3
app/src/main/res/layout/activity_home.xml

@@ -64,9 +64,10 @@
         android:gravity="center">
 
         <TextView
+            android:gravity="center"
             android:id="@+id/tv_version"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_height="match_parent"
             android:layout_centerVertical="true"
             android:layout_marginLeft="@dimen/dp_16"
             android:text="@string/vsersion"
@@ -90,12 +91,13 @@
 
         <ImageView
             android:id="@+id/iv_shutown_logo"
-            android:layout_width="@dimen/dp_14"
-            android:layout_height="@dimen/dp_14"
+            android:layout_width="@dimen/dp_24"
+            android:layout_height="@dimen/dp_24"
             android:layout_alignParentRight="true"
             android:layout_centerVertical="true"
             android:layout_marginLeft="@dimen/dp_10"
             android:layout_marginRight="@dimen/dp_10"
+            android:padding="@dimen/dp_5"
             android:src="@drawable/shutdown" />
 
         <TextView

+ 397 - 377
app/src/main/res/layout/activity_homeactivity.xml

@@ -1,490 +1,510 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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:gravity="center"
     android:background="#011f4b">
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="> 厕所示意图"
-        android:layout_alignLeft="@+id/ll_wcstate"
-        android:textSize="@dimen/sp_6"
-        android:layout_marginTop="@dimen/dp_2"
-        android:textColor="#bfc0c1"/>
-
-    <TextView
-        android:id="@+id/tv_equipment_no1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="设备编号:"
-        android:layout_alignParentBottom="true"
-        android:padding="@dimen/dp_2"
-        android:textSize="@dimen/sp_6"
-        android:layout_alignRight="@id/ll_useCount"
-        android:layout_alignBottom="@id/ll_useCount"
-        android:layout_marginTop="@dimen/dp_2"
-        android:textColor="#bfc0c1"/>
-
-    <LinearLayout
-        android:id="@+id/ll_wcstate"
-        android:layout_width="@dimen/dp_226"
-        android:layout_height="@dimen/dp_329"
-        android:layout_centerVertical="true"
-        android:layout_marginLeft="@dimen/dp_31"
-        android:background="@drawable/icon1"
-        android:paddingLeft="@dimen/dp_8"
-        android:orientation="horizontal" >
 
-        <TextView
-            android:id="@+id/tv_toiletdiagram1"
-            android:layout_width="@dimen/dp_104"
-            android:layout_height="@dimen/dp_148"
-            android:textColor="@color/state_green"
-            android:background="@drawable/icon9"
-            android:gravity="center"
-            android:textSize="@dimen/sp_14"
-            android:text="无人"/>
-        <TextView
-            android:id="@+id/tv_toiletdiagram2"
-            android:layout_width="@dimen/dp_104"
-            android:layout_height="@dimen/dp_148"
-            android:textColor="@color/state_green"
-            android:gravity="center"
-            android:background="@drawable/icon9"
-            android:textSize="@dimen/sp_14"
-            android:text="无人"/>
-    </LinearLayout>
-
-
-    <LinearLayout
-        android:id="@+id/ll_wccount"
-        android:layout_width="@dimen/dp_135"
-        android:layout_height="@dimen/dp_219"
-        android:layout_alignTop="@id/ll_wcstate"
-        android:layout_marginLeft="@dimen/dp_31"
-        android:layout_toRightOf="@id/ll_wcstate"
-        android:background="@drawable/icon2"
-        android:orientation="vertical">
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent">
 
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="@dimen/dp_10"
-            android:layout_marginTop="@dimen/dp_17"
-            android:text="今日清洗次数:"
-            android:textColor="@color/white"
-            android:textSize="@dimen/sp_10" />
+            android:layout_alignLeft="@+id/ll_wcstate"
+            android:layout_marginTop="@dimen/sp_8"
+            android:text="> 厕所示意图"
+            android:textColor="#bfc0c1"
+            android:textSize="@dimen/sp_6" />
 
         <TextView
-            android:id="@+id/tv_washingtime"
-            android:layout_width="match_parent"
+            android:id="@+id/tv_equipment_no1"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/dp_17"
-            android:gravity="center"
-            android:text="0"
-            android:textColor="#32A8FF"
-            android:textSize="@dimen/sp_28" />
+            android:layout_alignRight="@id/ll_useCount"
+            android:layout_alignBottom="@id/ll_useCount"
+            android:layout_alignParentBottom="true"
+            android:layout_marginTop="@dimen/dp_2"
+            android:padding="@dimen/dp_2"
+            android:text="设备编号:"
+            android:textColor="#bfc0c1"
+            android:textSize="@dimen/sp_6" />
+
+        <LinearLayout
+            android:id="@+id/ll_wcstate"
+            android:layout_width="@dimen/dp_226"
+            android:layout_height="@dimen/dp_329"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="@dimen/dp_31"
+            android:background="@drawable/icon1"
+            android:orientation="horizontal"
+            android:paddingLeft="@dimen/dp_8">
+
+            <TextView
+                android:id="@+id/tv_toiletdiagram1"
+                android:layout_width="@dimen/dp_104"
+                android:layout_height="@dimen/dp_148"
+                android:background="@drawable/icon9"
+                android:gravity="center"
+                android:text="无人"
+                android:layout_marginRight="@dimen/dp_2"
+                android:textColor="@color/state_green"
+                android:textSize="@dimen/sp_14" />
+
+            <TextView
+                android:id="@+id/tv_toiletdiagram2"
+                android:layout_width="@dimen/dp_104"
+                android:layout_height="@dimen/dp_148"
+                android:background="@drawable/icon9"
+                android:gravity="center"
+                android:text="无人"
+                android:textColor="@color/state_green"
+                android:textSize="@dimen/sp_14" />
+        </LinearLayout>
+
+
+        <LinearLayout
+            android:id="@+id/ll_wccount"
+            android:layout_width="@dimen/dp_135"
+            android:layout_height="@dimen/dp_219"
+            android:layout_alignTop="@id/ll_wcstate"
+            android:layout_marginLeft="@dimen/dp_31"
+            android:layout_toRightOf="@id/ll_wcstate"
+            android:background="@drawable/icon2"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_17"
+                android:text="今日清洗次数:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/sp_10" />
+
+            <TextView
+                android:id="@+id/tv_washingtime"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/dp_17"
+                android:gravity="center"
+                android:text="0"
+                android:textColor="#32A8FF"
+                android:textSize="@dimen/sp_28" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_30"
+                android:text="剩余物料:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/sp_10" />
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center">
+
+                <LinearLayout
+                    android:layout_width="@dimen/dp_60"
+                    android:layout_height="@dimen/dp_60"
+                    android:background="@drawable/shape_radio_thumb"
+                    android:gravity="center"
+                    android:orientation="vertical">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="0%"
+                        android:textColor="#FFA632"
+                        android:textSize="@dimen/sp_14" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="消毒水"
+                        android:textColor="#FFA632"
+                        android:textSize="@dimen/sp_10" />
+                </LinearLayout>
+
+            </RelativeLayout>
+
+        </LinearLayout>
 
         <TextView
+            android:id="@+id/tv_date"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="@dimen/dp_10"
-            android:layout_marginTop="@dimen/dp_30"
-            android:text="剩余物料:"
+            android:layout_alignTop="@id/ll_wccount"
+            android:layout_marginLeft="@dimen/dp_20"
+            android:layout_toRightOf="@id/ll_wccount"
+            android:paddingBottom="@dimen/dp_8"
+            android:text="2020年11月17日 星期二 10:08"
             android:textColor="@color/white"
-            android:textSize="@dimen/sp_10" />
+            android:textSize="@dimen/sp_16" />
 
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="center">
+        <LinearLayout
+            android:id="@+id/ll_ammonia"
+            android:layout_width="@dimen/dp_198"
+            android:layout_height="@dimen/dp_60"
+            android:layout_alignTop="@id/tv_date"
+            android:layout_marginLeft="@dimen/dp_20"
+            android:layout_marginTop="@dimen/dp_42"
+            android:layout_toRightOf="@id/ll_wccount"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
 
             <LinearLayout
-                android:layout_width="@dimen/dp_60"
-                android:layout_height="@dimen/dp_60"
+                android:layout_width="@dimen/dp_51"
+                android:layout_height="@dimen/dp_51"
+                android:layout_marginRight="@dimen/dp_22"
                 android:background="@drawable/shape_radio_thumb"
                 android:gravity="center"
                 android:orientation="vertical">
 
                 <TextView
+                    android:id="@+id/tv_ammonia"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="0%"
+                    android:text="5.6PM"
                     android:textColor="#FFA632"
-                    android:textSize="@dimen/sp_14" />
+                    android:textSize="@dimen/sp_12" />
 
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="消毒水"
+                    android:text="氨气"
                     android:textColor="#FFA632"
-                    android:textSize="@dimen/sp_10" />
+                    android:textSize="@dimen/sp_8" />
             </LinearLayout>
 
-        </RelativeLayout>
+            <LinearLayout
+                android:layout_width="@dimen/dp_51"
+                android:layout_height="@dimen/dp_51"
+                android:layout_marginRight="@dimen/dp_22"
+                android:background="@drawable/shape_radio_red"
 
-    </LinearLayout>
+                android:gravity="center"
+                android:orientation="vertical">
 
-    <TextView
-        android:id="@+id/tv_date"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignTop="@id/ll_wccount"
-        android:layout_marginLeft="@dimen/dp_20"
-        android:layout_toRightOf="@id/ll_wccount"
-        android:text="2020年11月17日 星期二 10:08"
-        android:textColor="@color/white"
-        android:textSize="@dimen/sp_16" />
-
-    <LinearLayout
-        android:id="@+id/ll_ammonia"
-        android:gravity="center_vertical"
-        android:layout_marginTop="@dimen/dp_42"
-        android:layout_width="@dimen/dp_198"
-        android:layout_height="@dimen/dp_60"
-        android:layout_marginLeft="@dimen/dp_20"
-        android:layout_alignTop="@id/tv_date"
-        android:layout_toRightOf="@id/ll_wccount"
-        android:orientation="horizontal">
+                <TextView
+                    android:id="@+id/tv_temperature"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="30°C"
+                    android:textColor="@color/color_red"
+                    android:textSize="@dimen/sp_12" />
 
-        <LinearLayout
-            android:layout_width="@dimen/dp_51"
-            android:layout_height="@dimen/dp_51"
-            android:background="@drawable/shape_radio_thumb"
-            android:gravity="center"
-            android:layout_marginRight="@dimen/dp_22"
-            android:orientation="vertical">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="温度"
+                    android:textColor="@color/color_red"
+                    android:textSize="@dimen/sp_8" />
+            </LinearLayout>
 
-            <TextView
-                android:id="@+id/tv_ammonia"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="5.6PM"
-                android:textColor="#FFA632"
-                android:textSize="@dimen/sp_12" />
+            <LinearLayout
+                android:layout_width="@dimen/dp_51"
+                android:layout_height="@dimen/dp_51"
+                android:background="@drawable/shape_radio_thumbblue"
+                android:gravity="center"
+                android:orientation="vertical">
 
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="氨气"
-                android:textColor="#FFA632"
-                android:textSize="@dimen/sp_8" />
+                <TextView
+                    android:id="@+id/tv_humidity"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="39%"
+                    android:textColor="#32A8FF"
+                    android:textSize="@dimen/sp_12" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="湿度"
+                    android:textColor="#32A8FF"
+                    android:textSize="@dimen/sp_8" />
+            </LinearLayout>
         </LinearLayout>
 
-        <LinearLayout
-            android:layout_width="@dimen/dp_51"
-            android:layout_height="@dimen/dp_51"
-            android:background="@drawable/shape_radio_red"
-            android:gravity="center"
 
-            android:layout_marginRight="@dimen/dp_22"
+        <!--<LinearLayout
+            android:id="@+id/ll_environment"
+            android:gravity="center"
+            android:layout_marginTop="@dimen/dp_42"
+            android:layout_width="@dimen/dp_88"
+            android:layout_height="@dimen/dp_60"
+            android:layout_marginLeft="@dimen/dp_20"
+            android:layout_alignTop="@id/tv_date"
+            android:layout_toRightOf="@id/ll_ammonia"
             android:orientation="vertical">
 
-            <TextView
-                android:id="@+id/tv_temperature"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="30°C"
-                android:textColor="@color/color_red"
-                android:textSize="@dimen/sp_12" />
+            <LinearLayout
+
+                android:layout_width="@dimen/dp_60"
+                android:layout_height="@dimen/dp_60"
+                android:background="@drawable/shape_radio_thumbblue"
+                android:gravity="center"
+                android:orientation="vertical">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="优"
+                    android:textColor="#32A8FF"
+                    android:textSize="@dimen/sp_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="卫生评级"
+                    android:textColor="#32A8FF"
+                    android:textSize="@dimen/sp_10" />
+            </LinearLayout>
+        </LinearLayout>-->
 
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="温度"
-                android:textColor="@color/color_red"
-                android:textSize="@dimen/sp_8" />
-        </LinearLayout>
 
         <LinearLayout
-            android:layout_width="@dimen/dp_51"
-            android:layout_height="@dimen/dp_51"
-            android:background="@drawable/shape_radio_thumbblue"
-            android:gravity="center"
+            android:id="@+id/ll_enter"
+            android:layout_width="@dimen/dp_88"
+            android:layout_height="@dimen/dp_96"
+            android:layout_alignBottom="@id/ll_wccount"
+            android:layout_marginLeft="@dimen/dp_20"
+            android:layout_toRightOf="@id/ll_wccount"
+            android:background="@drawable/icon8"
             android:orientation="vertical">
 
             <TextView
-                android:id="@+id/tv_humidity"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="39%"
-                android:textColor="#32A8FF"
-                android:textSize="@dimen/sp_12" />
+                android:layout_margin="@dimen/dp_6"
+                android:text="今日合计进:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/sp_8" />
 
             <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="湿度"
+                android:id="@+id/tv_in"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:text="0"
                 android:textColor="#32A8FF"
-                android:textSize="@dimen/sp_8" />
-        </LinearLayout>
-    </LinearLayout>
+                android:textSize="@dimen/dp_27" />
 
+            <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" />
 
-    <!--<LinearLayout
-        android:id="@+id/ll_environment"
-        android:gravity="center"
-        android:layout_marginTop="@dimen/dp_42"
-        android:layout_width="@dimen/dp_88"
-        android:layout_height="@dimen/dp_60"
-        android:layout_marginLeft="@dimen/dp_20"
-        android:layout_alignTop="@id/tv_date"
-        android:layout_toRightOf="@id/ll_ammonia"
-        android:orientation="vertical">
+        </LinearLayout>
 
         <LinearLayout
 
-            android:layout_width="@dimen/dp_60"
-            android:layout_height="@dimen/dp_60"
-            android:background="@drawable/shape_radio_thumbblue"
-            android:gravity="center"
+            android:layout_width="@dimen/dp_88"
+            android:layout_height="@dimen/dp_96"
+            android:layout_alignBottom="@id/ll_wccount"
+            android:layout_marginLeft="@dimen/dp_20"
+            android:layout_toRightOf="@id/ll_enter"
+            android:background="@drawable/icon8"
             android:orientation="vertical">
 
             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="优"
-                android:textColor="#32A8FF"
-                android:textSize="@dimen/sp_14" />
+                android:layout_margin="@dimen/dp_6"
+                android:text="今日合计出:"
+                android:textColor="#0DAB37"
+                android:textSize="@dimen/sp_8" />
 
             <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="卫生评级"
-                android:textColor="#32A8FF"
-                android:textSize="@dimen/sp_10" />
+                android:id="@+id/tv_out"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:text="0"
+                android:textColor="#0DAB37"
+                android:textSize="@dimen/dp_27" />
+
         </LinearLayout>
-    </LinearLayout>-->
 
+        <LinearLayout
+            android:id="@+id/ll_useCount"
+            android:layout_width="@dimen/dp_351"
+            android:layout_height="@dimen/dp_98"
+            android:layout_alignParentBottom="true"
+            android:layout_marginLeft="@dimen/dp_31"
+            android:layout_marginBottom="@dimen/dp_23"
+            android:layout_toRightOf="@id/ll_wcstate"
+            android:background="@drawable/icon3"
+            android:gravity="center"
+            android:orientation="horizontal">
 
-    <LinearLayout
-        android:id="@+id/ll_enter"
-        android:layout_width="@dimen/dp_88"
-        android:layout_height="@dimen/dp_96"
-        android:layout_alignBottom="@id/ll_wccount"
-        android:layout_marginLeft="@dimen/dp_20"
-        android:layout_toRightOf="@id/ll_wccount"
-        android:background="@drawable/icon8"
-        android:orientation="vertical">
+            <LinearLayout
+                android:layout_width="@dimen/dp_94"
+                android:layout_height="@dimen/dp_56"
+                android:layout_marginRight="@dimen/dp_16"
+                android:background="@drawable/icon4"
+                android:gravity="center"
+                android:orientation="vertical">
 
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_margin="@dimen/dp_6"
-            android:text="今日合计进:"
-            android:textColor="@color/white"
-            android:textSize="@dimen/sp_8" />
+                <TextView
+                    android:id="@+id/tv_wctoilets"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="0"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_14" />
 
-        <TextView
-            android:id="@+id/tv_in"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="center"
-            android:text="0"
-            android:textColor="#32A8FF"
-            android:textSize="@dimen/dp_27" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="卫生间总数"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="@dimen/dp_94"
+                android:layout_height="@dimen/dp_56"
+                android:layout_marginRight="@dimen/dp_16"
+                android:background="@drawable/icon6"
+                android:gravity="center"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/tv_wcuser"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="0"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_14" />
 
-    </LinearLayout>
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="使用"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_14" />
+            </LinearLayout>
 
-    <LinearLayout
+            <LinearLayout
+                android:layout_width="@dimen/dp_94"
+                android:layout_height="@dimen/dp_56"
+                android:background="@drawable/icon5"
+                android:gravity="center"
+                android:orientation="vertical">
 
-        android:layout_width="@dimen/dp_88"
-        android:layout_height="@dimen/dp_96"
-        android:layout_alignBottom="@id/ll_wccount"
-        android:layout_marginLeft="@dimen/dp_20"
-        android:layout_toRightOf="@id/ll_enter"
-        android:background="@drawable/icon8"
-        android:orientation="vertical">
+                <TextView
+                    android:id="@+id/tv_wcempty"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="0"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_14" />
 
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_margin="@dimen/dp_6"
-            android:text="今日合计出:"
-            android:textColor="#0DAB37"
-            android:textSize="@dimen/sp_8" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="空置"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/sp_14" />
 
-        <TextView
-            android:id="@+id/tv_out"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="center"
-            android:text="0"
-            android:textColor="#0DAB37"
-            android:textSize="@dimen/dp_27" />
-
-    </LinearLayout>
-
-    <LinearLayout
-        android:id="@+id/ll_useCount"
-        android:layout_width="@dimen/dp_358"
-        android:layout_height="@dimen/dp_98"
-        android:layout_alignParentBottom="true"
-        android:layout_marginLeft="@dimen/dp_31"
-        android:layout_marginBottom="@dimen/dp_15"
-        android:layout_toRightOf="@id/ll_wcstate"
-        android:background="@drawable/icon3"
-        android:gravity="center"
-        android:orientation="horizontal">
+            </LinearLayout>
+        </LinearLayout>
+
+        <ImageView
+            android:layout_width="@dimen/dp_40"
+            android:layout_height="@dimen/dp_16"
+            android:layout_marginLeft="@dimen/dp_10"
+            android:layout_marginTop="@dimen/dp_6"
+            android:src="@drawable/login_logo"
+            android:visibility="gone" />
 
         <LinearLayout
-            android:layout_width="@dimen/dp_94"
-            android:layout_height="@dimen/dp_56"
-            android:layout_marginRight="@dimen/dp_16"
-            android:background="@drawable/icon4"
-            android:gravity="center"
-            android:orientation="vertical">
+            android:id="@+id/ll_service"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:background="@drawable/shape_system_btn_rounded_rectangle"
+            android:orientation="vertical"
+            android:textColor="#767988"
+            android:visibility="gone">
 
             <TextView
-                android:id="@+id/tv_wctoilets"
+                android:id="@+id/tv_servicecontact"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="0"
-                android:textColor="@color/white"
-                android:textSize="@dimen/sp_14" />
+                android:layout_marginRight="@dimen/dp_5"
+                android:layout_marginBottom="@dimen/dp_1"
+                android:padding="@dimen/dp_2"
+                android:textColor="#767988"
+                android:textSize="@dimen/dp_5" />
 
             <TextView
+                android:id="@+id/tv_serviceline"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="卫生间总数"
-                android:textColor="@color/white"
-                android:textSize="@dimen/sp_14" />
+                android:padding="@dimen/dp_2"
+                android:textColor="#767988"
+                android:textSize="@dimen/dp_5" />
+
         </LinearLayout>
 
-        <LinearLayout
-            android:layout_width="@dimen/dp_94"
-            android:layout_height="@dimen/dp_56"
-            android:layout_marginRight="@dimen/dp_16"
-            android:background="@drawable/icon6"
-            android:gravity="center"
-            android:orientation="vertical">
+        <RelativeLayout
+            android:id="@+id/rl_root"
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/dp_40"
+            android:layout_alignParentRight="true"
+            android:visibility="gone">
 
             <TextView
-                android:id="@+id/tv_wcuser"
+                android:id="@+id/tv_time"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="0"
+                android:layout_alignParentLeft="true"
+                android:text="@string/current_time1"
                 android:textColor="@color/white"
-                android:textSize="@dimen/sp_14" />
+                android:textSize="@dimen/sp_8" />
 
             <TextView
+                android:id="@+id/tv_time12"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="使用"
+                android:layout_toRightOf="@id/tv_time"
+                android:gravity="center_vertical"
+                android:text="2019-05-05 18:00:00"
                 android:textColor="@color/white"
-                android:textSize="@dimen/sp_14" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:layout_width="@dimen/dp_94"
-            android:layout_height="@dimen/dp_56"
-            android:background="@drawable/icon5"
-            android:gravity="center"
-            android:orientation="vertical">
+                android:textSize="@dimen/sp_8" />
 
             <TextView
-                android:id="@+id/tv_wcempty"
+                android:id="@+id/tv_equipment_no"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="0"
+                android:layout_below="@id/tv_time"
+                android:layout_alignParentLeft="true"
+                android:text="@string/equipment_no"
                 android:textColor="@color/white"
-                android:textSize="@dimen/sp_14" />
+                android:textSize="@dimen/sp_8" />
 
             <TextView
+                android:id="@+id/tv_equipment_no12"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="空置"
+                android:layout_below="@id/tv_time"
+                android:layout_toRightOf="@id/tv_equipment_no"
+                android:gravity="center_vertical"
+                android:text="1234567856"
                 android:textColor="@color/white"
-                android:textSize="@dimen/sp_14" />
-
-        </LinearLayout>
-    </LinearLayout>
-
-    <ImageView
-        android:layout_width="@dimen/dp_40"
-        android:layout_height="@dimen/dp_16"
-        android:layout_marginLeft="@dimen/dp_10"
-        android:layout_marginTop="@dimen/dp_6"
-        android:src="@drawable/login_logo"
-        android:visibility="gone" />
-
-    <LinearLayout
-        android:id="@+id/ll_service"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:background="@drawable/shape_system_btn_rounded_rectangle"
-        android:orientation="vertical"
-        android:textColor="#767988"
-        android:visibility="gone">
-
-        <TextView
-            android:id="@+id/tv_servicecontact"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginRight="@dimen/dp_5"
-            android:layout_marginBottom="@dimen/dp_1"
-            android:padding="@dimen/dp_2"
-            android:textColor="#767988"
-            android:textSize="@dimen/dp_5" />
-
-        <TextView
-            android:id="@+id/tv_serviceline"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:padding="@dimen/dp_2"
-            android:textColor="#767988"
-            android:textSize="@dimen/dp_5" />
-
-    </LinearLayout>
-
-    <RelativeLayout
-        android:id="@+id/rl_root"
-        android:layout_width="wrap_content"
-        android:layout_height="@dimen/dp_40"
-        android:layout_alignParentRight="true"
-        android:visibility="gone">
-
-        <TextView
-            android:id="@+id/tv_time"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentLeft="true"
-            android:text="@string/current_time1"
-            android:textColor="@color/white"
-            android:textSize="@dimen/sp_8" />
-
-        <TextView
-            android:id="@+id/tv_time12"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toRightOf="@id/tv_time"
-            android:gravity="center_vertical"
-            android:text="2019-05-05 18:00:00"
-            android:textColor="@color/white"
-            android:textSize="@dimen/sp_8" />
-
-        <TextView
-            android:id="@+id/tv_equipment_no"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/tv_time"
-            android:layout_alignParentLeft="true"
-            android:text="@string/equipment_no"
-            android:textColor="@color/white"
-            android:textSize="@dimen/sp_8" />
-
-        <TextView
-            android:id="@+id/tv_equipment_no12"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/tv_time"
-            android:layout_toRightOf="@id/tv_equipment_no"
-            android:gravity="center_vertical"
-            android:text="1234567856"
-            android:textColor="@color/white"
-            android:textSize="@dimen/sp_8" />
+                android:textSize="@dimen/sp_8" />
+        </RelativeLayout>
     </RelativeLayout>
-</RelativeLayout>
+</LinearLayout>

+ 9 - 5
app/src/main/res/layout/activity_login.xml

@@ -15,6 +15,7 @@
             android:layout_height="match_parent"
             android:layout_marginLeft="@dimen/dp_46"
             android:layout_weight="1"
+            android:gravity="center_vertical"
             android:orientation="vertical">
 
             <ImageView
@@ -91,11 +92,14 @@
                 tools:ignore="NotSibling" />
         </LinearLayout>
 
-        <ImageView
-            android:id="@+id/ll_left"
-            android:layout_width="@dimen/dp_315"
-            android:layout_height="match_parent"
-            android:src="@drawable/login_leftlogo" />
+
+            <ImageView
+                android:id="@+id/ll_left"
+                android:layout_width="@dimen/dp_315"
+                android:layout_height="match_parent"
+                android:scaleType="fitXY"
+                android:src="@drawable/login_leftlogo" />
+
     </LinearLayout>
 
 

+ 277 - 9
app/src/main/res/layout/fragment_other.xml

@@ -117,6 +117,12 @@
                 android:splitTrack="false"
                 android:thumb="@drawable/shape_radio_thumb_other" />
 
+
+
+
+
+
+
             <TextView
                 android:id="@+id/tv_robot_contacts"
                 android:layout_width="wrap_content"
@@ -139,7 +145,7 @@
                 android:background="@drawable/shape_lt_lb"
                 android:gravity="center"
                 android:text="@string/contact1"
-                android:textColor="@color/white"
+                android:textColor="@color/logo_blue"
                 android:textSize="@dimen/dp_8" />
 
             <EditText
@@ -169,7 +175,7 @@
                 android:background="@drawable/shape_lt_lb"
                 android:gravity="center"
                 android:text="@string/contact_phone_number"
-                android:textColor="@color/white"
+                android:textColor="@color/logo_blue"
                 android:textSize="@dimen/dp_8" />
 
             <EditText
@@ -198,14 +204,144 @@
                 android:layout_toRightOf="@id/et_way_contacts"
                 android:background="@drawable/shape_other_rounded_rectangle"
                 android:text="@string/update"
+                android:textColor="@color/white"
+                android:textSize="@dimen/dp_8" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+            <TextView
+                android:id="@+id/tv_restoration_contacts"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/et_way_contacts"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_40"
+                android:text="清洗完需复位的蹲位"
+                android:textColor="@color/logo_blue"
+                android:textSize="@dimen/dp_12" />
+
+            <TextView
+                android:id="@+id/tv_restorationcontacts"
+                android:layout_width="@dimen/dp_52"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/et_way_contacts"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_40"
+                android:layout_toRightOf="@id/tv_restoration_contacts"
+                android:background="@drawable/shape_lt_lb"
+                android:gravity="center"
+                android:text="清洗完复位"
                 android:textColor="@color/logo_blue"
                 android:textSize="@dimen/dp_8" />
 
+            <EditText
+
+                android:id="@+id/et_restorationcontract"
+                android:layout_width="@dimen/dp_70"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/et_way_contacts"
+                android:layout_marginTop="@dimen/dp_40"
+                android:layout_toRightOf="@id/tv_restorationcontacts"
+                android:background="@drawable/shape_rt_rb"
+                android:hint="上个清洗的厕所"
+                android:inputType="number"
+                android:paddingStart="@dimen/dp_5"
+                android:paddingLeft="@dimen/dp_2"
+                android:textColor="@color/colorHint"
+                android:textColorHint="@color/colorHint"
+                android:textSize="@dimen/dp_5" />
+
+            <TextView
+                android:id="@+id/tv_restorationway_contacts"
+                android:layout_width="@dimen/dp_52"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/tv_way_contacts"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_40"
+                android:layout_toRightOf="@id/et_restorationcontract"
+                android:background="@drawable/shape_lt_lb"
+                android:gravity="center"
+                android:text="其他蹲位"
+                android:textColor="@color/logo_blue"
+                android:textSize="@dimen/dp_8" />
+
+            <EditText
+                android:id="@+id/et_restorationway_contacts"
+                android:layout_width="@dimen/dp_70"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/tv_way_contacts"
+                android:layout_marginTop="@dimen/dp_40"
+                android:layout_toRightOf="@id/tv_restorationway_contacts"
+                android:background="@drawable/shape_rt_rb"
+                android:hint="下次需清洗的厕所"
+                android:paddingStart="@dimen/dp_5"
+                android:inputType="number"
+                android:paddingLeft="@dimen/dp_2"
+                android:textColor="@color/colorHint"
+                android:textColorHint="@color/colorHint"
+                android:textSize="@dimen/dp_6" />
+
+            <Button
+                android:id="@+id/btn_restorationcontract_update"
+                android:layout_width="@dimen/dp_44"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/btn_contract_update"
+                android:layout_marginLeft="@dimen/dp_15"
+                android:layout_marginTop="@dimen/dp_40"
+                android:layout_toRightOf="@id/et_restorationway_contacts"
+                android:background="@drawable/shape_other_rounded_rectangle"
+                android:text="@string/update"
+                android:textColor="@color/white"
+                android:textSize="@dimen/dp_8" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
             <TextView
                 android:id="@+id/tv_plc_serial_port"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_below="@id/et_way_contacts"
+                android:layout_below="@id/tv_restoration_contacts"
                 android:layout_marginLeft="@dimen/dp_20"
                 android:layout_marginTop="@dimen/dp_45"
                 android:text="PLC通信"
@@ -216,21 +352,21 @@
                 android:id="@+id/tv_plc"
                 android:layout_width="@dimen/dp_52"
                 android:layout_height="@dimen/dp_22"
-                android:layout_below="@id/et_way_contacts"
+                android:layout_below="@id/tv_restorationcontacts"
                 android:layout_marginLeft="@dimen/dp_20"
                 android:layout_marginTop="@dimen/dp_42"
                 android:layout_toRightOf="@id/tv_plc_serial_port"
                 android:background="@drawable/shape_lt_lb"
                 android:gravity="center"
                 android:text="串口号"
-                android:textColor="@color/white"
+                android:textColor="@color/logo_blue"
                 android:textSize="@dimen/dp_8" />
 
             <EditText
                 android:id="@+id/et_plc_content"
                 android:layout_width="@dimen/dp_112"
                 android:layout_height="@dimen/dp_22"
-                android:layout_below="@id/et_way_contacts"
+                android:layout_below="@id/et_restorationcontract"
                 android:layout_marginTop="@dimen/dp_42"
                 android:layout_toRightOf="@id/tv_plc"
                 android:background="@drawable/shape_rt_rb"
@@ -245,13 +381,13 @@
                 android:id="@+id/btn_plc_content_udate"
                 android:layout_width="@dimen/dp_44"
                 android:layout_height="@dimen/dp_22"
-                android:layout_below="@id/btn_contract_update"
+                android:layout_below="@id/et_restorationcontract"
                 android:layout_marginLeft="@dimen/dp_20"
                 android:layout_marginTop="@dimen/dp_42"
                 android:layout_toRightOf="@id/et_plc_content"
                 android:background="@drawable/shape_other_rounded_rectangle"
                 android:text="@string/update"
-                android:textColor="@color/logo_blue"
+                android:textColor="@color/white"
                 android:textSize="@dimen/dp_8" />
 
 
@@ -277,7 +413,7 @@
                 android:background="@drawable/shape_lt_lb"
                 android:gravity="center"
                 android:text="个数"
-                android:textColor="@color/white"
+                android:textColor="@color/logo_blue"
                 android:textSize="@dimen/dp_8" />
 
             <EditText
@@ -306,7 +442,139 @@
                 android:layout_toRightOf="@id/et_squatting_content"
                 android:background="@drawable/shape_other_rounded_rectangle"
                 android:text="@string/update"
+                android:textColor="@color/white"
+                android:textSize="@dimen/dp_8" />
+
+
+
+
+
+
+
+
+
+
+            <TextView
+                android:id="@+id/tv_cleanCount"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/tv_squatting_serial_port"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_45"
+                android:text="清洗几次复位"
+                android:textColor="@color/logo_blue"
+                android:textSize="@dimen/dp_12" />
+
+            <TextView
+                android:id="@+id/tv_cleancountsquatting"
+                android:layout_width="@dimen/dp_52"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/tv_squatting"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_42"
+                android:layout_toRightOf="@id/tv_cleanCount"
+                android:background="@drawable/shape_lt_lb"
+                android:gravity="center"
+                android:text="个数"
+                android:textColor="@color/logo_blue"
+                android:textSize="@dimen/dp_8" />
+
+            <EditText
+                android:id="@+id/et_cleancount_content"
+                android:layout_width="@dimen/dp_112"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/et_squatting_content"
+                android:layout_marginTop="@dimen/dp_42"
+                android:layout_toRightOf="@id/tv_cleancountsquatting"
+                android:background="@drawable/shape_rt_rb"
+                android:hint="请输入清洗几次后需复位"
+                android:paddingStart="@dimen/dp_10"
+                android:paddingLeft="@dimen/dp_2"
+                android:inputType="number"
+                android:textColor="@color/colorHint"
+                android:textColorHint="@color/colorHint"
+                android:textSize="@dimen/dp_7" />
+
+            <Button
+                android:id="@+id/btn_cleancount"
+                android:layout_width="@dimen/dp_44"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/btn_squatting_content_udate"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_42"
+                android:layout_toRightOf="@id/et_cleancount_content"
+                android:background="@drawable/shape_other_rounded_rectangle"
+                android:text="@string/update"
+                android:textColor="@color/white"
+                android:textSize="@dimen/dp_8" />
+
+            <TextView
+                android:id="@+id/tv_listeningToilet"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/tv_cleanCount"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_45"
+                android:text="监听厕所蹲位"
+                android:textColor="@color/logo_blue"
+                android:textSize="@dimen/dp_12" />
+
+            <LinearLayout
+                android:id="@+id/ll_toiletcheckBox"
+                android:layout_below="@id/tv_cleancountsquatting"
+                android:layout_toRightOf="@id/tv_listeningToilet"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_42"
+                android:orientation="horizontal">
+
+            </LinearLayout>
+            <Button
+                android:id="@+id/btn_tcheckupdate"
+                android:layout_width="@dimen/dp_44"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/et_cleancount_content"
+                android:layout_marginTop="@dimen/dp_38"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_toRightOf="@id/ll_toiletcheckBox"
+                android:background="@drawable/shape_other_rounded_rectangle"
+                android:text="@string/update"
+                android:textColor="@color/white"
+                android:textSize="@dimen/dp_8" />
+            <TextView
+                android:id="@+id/tv_listeningPeople"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/tv_listeningToilet"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_45"
+                android:text="监听人体传感器"
                 android:textColor="@color/logo_blue"
+                android:textSize="@dimen/dp_12" />
+
+            <LinearLayout
+                android:id="@+id/ll_peoplecheckBox"
+                android:layout_below="@id/btn_tcheckupdate"
+                android:layout_toRightOf="@id/tv_listeningPeople"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_marginTop="@dimen/dp_42"
+                android:orientation="horizontal">
+
+            </LinearLayout>
+            <Button
+                android:id="@+id/btn_pcheckupdate"
+                android:layout_width="@dimen/dp_44"
+                android:layout_height="@dimen/dp_22"
+                android:layout_below="@id/btn_tcheckupdate"
+                android:layout_marginTop="@dimen/dp_38"
+                android:layout_marginLeft="@dimen/dp_20"
+                android:layout_toRightOf="@id/ll_peoplecheckBox"
+                android:background="@drawable/shape_other_rounded_rectangle"
+                android:text="@string/update"
+                android:textColor="@color/white"
                 android:textSize="@dimen/dp_8" />
         </RelativeLayout>
     </ScrollView>

+ 4 - 1
app/src/main/res/values/styles.xml

@@ -7,7 +7,8 @@
         <item name="colorPrimaryDark">@color/logo_blue</item>
         <item name="colorAccent">@color/logo_blue</item>
         <item name="android:typeface">monospace</item>
-        <item name="colorControlNormal">@android:color/white</item>
+        <item name="colorControlNormal">@color/gray</item>
+        <item name="colorControlActivated">@color/logo_blue</item>
     </style>
 
 
@@ -39,4 +40,6 @@
         <!--不设置这个dialog不能横向铺满屏幕,而且还会在最外层自动套一个黑色背景-->
         <item name="android:windowBackground">@color/c_transparent</item>
     </style>
+
+
 </resources>