From c7fe31931a26a941ca2adf002e40b47a049a604c Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期四, 27 四月 2017 11:07:57 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurveillanceMng.java | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurveillanceMng.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurveillanceMng.java index 6aaed08..0b849c3 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurveillanceMng.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurveillanceMng.java @@ -66,27 +66,21 @@ } if (newList.size() > 0) { - - List<SurveillanceQueryItem> doubleList = new ArrayList<SurveillanceQueryItem>(); - prevList.addAll(0, newList); - - registerTopAndCheckInBottom(prevList, doubleList); - - SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(doubleList, true); + registerTopAndCheckInBottom(prevList); + SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(prevList); } } }); } - private void registerTopAndCheckInBottom(List<SurveillanceQueryItem> list, List<SurveillanceQueryItem> doubleList) { - doubleList.clear(); + private void registerTopAndCheckInBottom(List<SurveillanceQueryItem> list) { List<SurveillanceQueryItem> registerList = new ArrayList<SurveillanceQueryItem>(); List<SurveillanceQueryItem> checkInList = new ArrayList<SurveillanceQueryItem>(); removeDuplicateCheckIn(list); - int maxRegister = 20; int i1 = 0, j = 0; + int maxRegister = 20; int maxCheckIn = 20; for (SurveillanceQueryItem item : list) { if (item.getRegisterOrCheckIn() == Constant.Surveillance.VISIT_REGISTER_ITEM_TYPE) { @@ -104,6 +98,8 @@ } int max = registerList.size() > checkInList.size() ? registerList.size() : checkInList.size(); + + List tempList = new ArrayList(); int m = 0, n = 0; for (int i = 0; i < max * 2; i++) { @@ -123,9 +119,10 @@ } n++; } - doubleList.add(item); + tempList.add(item); } - + list.clear(); + list.addAll(tempList); } private void removeDuplicateCheckIn(List<SurveillanceQueryItem> list) { -- Gitblit v1.8.0