| | |
| | | import android.graphics.BitmapFactory; |
| | | import android.graphics.Color; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | |
| | | import android.widget.TextView; |
| | | |
| | | import com.basic.security.R; |
| | | import com.basic.security.base.BaseApplication; |
| | | import com.basic.security.base.BaseFragment; |
| | | import com.basic.security.manager.impl.cblite.BaseSettingManager; |
| | | import com.basic.security.manager.impl.cblite.IdentityManager; |
| | | import com.basic.security.manager.impl.cblite.PersonManager; |
| | | import com.basic.security.manager.impl.sqlite.SlBaseSettingManager; |
| | | import com.basic.security.utils.FaceId; |
| | | import com.basic.security.utils.ToastUtil; |
| | | import com.couchbase.lite.Blob; |
| | | import com.basic.security.manager.BaseSettingManager; |
| | | import com.basic.security.manager.IdentityManager; |
| | | import com.basic.security.manager.PersonManager; |
| | | import com.basic.security.model.ModelAdapter; |
| | | import com.basic.security.utils.ToastUtil; |
| | | |
| | | import org.androidannotations.annotations.Click; |
| | | import org.androidannotations.annotations.EFragment; |
| | |
| | | import org.androidannotations.annotations.ViewById; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public Button person_manage_btn_sure; |
| | | @ViewById |
| | | public RelativeLayout face_list; |
| | | |
| | | private List<ModelAdapter> personList = new ArrayList<>(); |
| | | private FaceListGridViewAdapter faceListGridViewAdapter; |
| | | public String isRegister = "未注册"; |
| | | |
| | | Map<String, ModelAdapter> checkedIdentityMap = new HashMap<>(); |
| | | Map<String, ModelAdapter> checkedIdentityMapBackup = new HashMap<>(); |
| | | float downY = 0; |
| | | float moveY = 0; |
| | | private List<ModelAdapter> personList = new ArrayList<>(); |
| | | private FaceListGridViewAdapter faceListGridViewAdapter; |
| | | private int clickTemp = -1; |
| | | |
| | | // @Click |
| | | // @Click |
| | | public void not_sign_up() { |
| | | findPersonList("未注册", new HashMap<>()); |
| | | } |
| | |
| | | @Click |
| | | public void show_camera() { |
| | | // 判断是否为通行模式,是的话不允许注册 |
| | | if (SlBaseSettingManager.isPassMode()) { |
| | | if (BaseSettingManager.isPassMode()) { |
| | | ToastUtil.show("通行模式不允许注册"); |
| | | } else { |
| | | if (BaseSettingManager.isAdminAuthSignUpModeNeedIdCard() |
| | |
| | | // personList.get(1).getBlob("camera_image_feature")); |
| | | // System.out.println("faceList score =" + score); |
| | | } |
| | | |
| | | float downY = 0; |
| | | float moveY = 0; |
| | | |
| | | // 下拉进入自助注册页面 |
| | | @SuppressLint("ClickableViewAccessibility") |
| | |
| | | if (personList.size() != 0) { // 有人员信息时默认选中第一个 |
| | | setDefaultAndSelectedPerson(0); |
| | | } else { |
| | | ((PersonManageFragment) mainActivity().fragment_person_manage).personChanged(null, false); |
| | | mainActivity().fragment_person_manage.personChanged(null, false); |
| | | } |
| | | face_list_show_image.setOnItemClickListener(new AdapterView.OnItemClickListener() { |
| | | @Override |
| | |
| | | */ |
| | | private void setDefaultAndSelectedPerson(int position) { |
| | | if (position < 0) { |
| | | ((PersonManageFragment) mainActivity().fragment_person_manage).personChanged(null); |
| | | mainActivity().fragment_person_manage.personChanged(null); |
| | | } else { |
| | | ((PersonManageFragment) mainActivity().fragment_person_manage).personChanged(personList.get(position)); |
| | | mainActivity().fragment_person_manage.personChanged(personList.get(position)); |
| | | isNeedIDCard(position); |
| | | } |
| | | faceListGridViewAdapter.setSelection(position); |
| | |
| | | |
| | | private void isNeedIDCard(int position) { |
| | | if ("未验证身份证".equals(personList.get(position).getString("verify_status"))) { |
| | | ((PersonManageFragment) mainActivity().fragment_person_manage).setNeedVerifyIDCard(true); |
| | | mainActivity().fragment_person_manage.setNeedVerifyIDCard(true); |
| | | } else { |
| | | ((PersonManageFragment) mainActivity().fragment_person_manage).setNeedVerifyIDCard(false); |
| | | mainActivity().fragment_person_manage.setNeedVerifyIDCard(false); |
| | | } |
| | | } |
| | | |
| | |
| | | if (selectedPerson != null) { |
| | | personList.remove(selectedPerson); |
| | | } |
| | | ((PersonManageFragment) mainActivity().fragment_person_manage).selectedPersonDocument = selectedPersonDocument; |
| | | mainActivity().fragment_person_manage.selectedPersonDocument = selectedPersonDocument; |
| | | personList.add(0, selectedPersonDocument); |
| | | } |
| | | } |
| | |
| | | //加载子布局 |
| | | convertView = LayoutInflater.from(getContext()).inflate(R.layout.face_view, null); |
| | | viewHolder = new ViewHolder(); |
| | | viewHolder.imageView = (ImageView) convertView.findViewById(R.id.face); |
| | | viewHolder.imageView_checked = (RelativeLayout) convertView.findViewById(R.id.face_checked); |
| | | viewHolder.imageView = convertView.findViewById(R.id.face); |
| | | viewHolder.imageView_checked = convertView.findViewById(R.id.face_checked); |
| | | convertView.setTag(viewHolder); |
| | | } else { |
| | | viewHolder = (ViewHolder) convertView.getTag(); |
| | |
| | | //加载子布局 |
| | | view = LayoutInflater.from(getContext()).inflate(R.layout.item_identity_list, null); |
| | | viewHolder = new ViewHolder(); |
| | | viewHolder.checkBox = (CheckBox) view.findViewById(R.id.item_ck); |
| | | viewHolder.checkBox = view.findViewById(R.id.item_ck); |
| | | view.setTag(viewHolder); |
| | | } else { |
| | | view = convertView; |