xuxiuxi
2017-05-02 c4a62d7bd683d94ae246bac811be47f93e38b5ef
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/SurveillanceMng.java
@@ -30,6 +30,15 @@
        if (!BaseApplication.deviceAvailable) {
            return;
        }
        List attendanceList = new ArrayList();
        for (int i = 0; i < 10; i++) {
            SurveillanceQueryItem item = new SurveillanceQueryItem();
            item.setInOrOutCamera(CommonVariables.Camera.IN);
            item.setUsername("zhangsan");
            item.setStatus("签到");
            attendanceList.add(item);
        }
        SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_attendance_list_view().show(attendanceList);
    }
    public void addBitmap(final List<SurveillanceQueryItem> bitmapList, byte[] byteArray, int len, String cameraInOrOut) {
@@ -44,9 +53,12 @@
        x.http().post(params, new BaseCommonCallBack() {
            public void success() {
                List<SurveillanceQueryItem> items = getList(SurveillanceQueryItem.class);
                List prevList = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().getPrevList();
                List prevVisitorList = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visitor_list_view().getPrevList();
                List prevAttendanceList = SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_attendance_list_view().getPrevList();
                List newList = new ArrayList();
                List newVisitorList = new ArrayList();
                List newAttendanceList = new ArrayList();
                for (int i = 0; items != null && i < items.size(); i++) {
                    SurveillanceQueryItem item = items.get(i);
@@ -54,7 +66,7 @@
                    if (type == CommonVariables.Surveillance.VISIT_REGISTER_ITEM_TYPE
                            || type == CommonVariables.Surveillance.VISIT_CHECK_IN_ITEM_TYPE
                            ) {
                        newList.add(0, item);
                        newVisitorList.add(0, item);
                        if (i < bitmapList.size()) {
                            SurveillanceQueryItem surveillanceQueryItem = bitmapList.get(i);
                            item.setBitmap(surveillanceQueryItem.getBitmap());
@@ -63,12 +75,23 @@
                            item.setHeight(surveillanceQueryItem.getHeight());
                        }
                    }
                    if (type ==  CommonVariables.Surveillance.VISIT_ATTENDANCE_ITEM_TYPE) {
                        newAttendanceList.add(item);
                    }
                }
                if (newList.size() > 0) {
                    prevList.addAll(0, newList);
                    registerTopAndCheckInBottom(prevList);
                    SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visit_list_view().show(prevList);
                if (newVisitorList.size() > 0) {
                    prevVisitorList.addAll(0, newVisitorList);
                    registerTopAndCheckInBottom(prevVisitorList);
                    SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visitor_list_view().show(prevVisitorList);
                }
                if (newAttendanceList.size() > 0) {
                    prevAttendanceList.addAll(0, newAttendanceList);
                    if (prevAttendanceList.size() > 20) {
                        prevAttendanceList = prevAttendanceList.subList(0, 20);
                    }
                    SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_attendance_list_view().show(prevAttendanceList);
                }
            }