| | |
| | | import android.net.Uri;
|
| | | import android.os.Bundle;
|
| | | import android.provider.MediaStore;
|
| | | import android.view.Gravity;
|
| | | import android.view.View;
|
| | | import android.widget.DatePicker;
|
| | | import android.widget.ImageView;
|
| | | import android.widget.LinearLayout;
|
| | | import android.widget.Toast;
|
| | |
| | | import cn.com.basic.face.discern.query.item.CheckInQueryItem;
|
| | | import cn.com.basic.face.service.DictionaryMng;
|
| | | import cn.com.basic.face.service.RegisterMng;
|
| | | import cn.com.basic.face.util.OkButtonClickedListener;
|
| | | import cn.com.basic.face.util.Constant;
|
| | | import cn.com.basic.face.util.OkClickedListener;
|
| | |
|
| | | import cn.com.basic.face.util.AppApi;
|
| | | import cn.com.basic.face.dialog.BirthdayPickerDialog;
|
| | | import cn.com.basic.face.dialog.CountrySelectionDialog;
|
| | | import cn.com.basic.face.widget.RegisterRightFieldLabelView;
|
| | | import cn.com.basic.face.widget.RegisterRightFieldTextView;
|
| | | import cn.com.basic.face.dialog.SingleSelectionDialog;
|
| | | import cn.com.basic.face.dialog.DateSelectDialog;
|
| | | import cn.com.basic.face.dialog.CountryDialog;
|
| | | import cn.com.basic.face.widget.register.RegisterRightFieldLabelView;
|
| | | import cn.com.basic.face.widget.register.RegisterRightFieldTextView;
|
| | | import cn.com.basic.face.dialog.SelectDialog;
|
| | |
|
| | | import com.facebook.drawee.view.SimpleDraweeView;
|
| | | import com.lidroid.xutils.ViewUtils;
|
| | |
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | |
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | | import cn.com.basic.face.discern.entity.Person;
|
| | |
| | | private ImageView fragment_register_update__photo;
|
| | |
|
| | | private static final int PICK_IMAGE_REQUEST = 1;
|
| | | private List mSexList;
|
| | | private List mVisitorTypeList;
|
| | | private List mCredentialsList;
|
| | | private LinearLayout mBaseLayout;
|
| | | private LinearLayout fragment_register_linear_layout;
|
| | |
|
| | | private static RegisterFragment instance = new RegisterFragment();
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | protected void initViews(View view, Bundle savedInstanceState) {
|
| | | mBaseLayout = (LinearLayout) view.findViewById(R.id.fragment_register_linear_layout);
|
| | | ViewUtils.inject(this, mBaseLayout);
|
| | | fragment_register_linear_layout = (LinearLayout) view.findViewById(R.id.fragment_register_linear_layout);
|
| | | ViewUtils.inject(this, fragment_register_linear_layout);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.fragment_register_save)
|
| | |
| | | RegisterMng.getInstance().add(params);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.register_gender)
|
| | | public void register_gender_click(View view) {
|
| | | SingleSelectionDialog popup = new SingleSelectionDialog(getActivity(),mSexList,"性别");
|
| | | popup.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);
|
| | | popup.addOkButtonClickedListener(new OkButtonClickedListener() {
|
| | | @Override
|
| | | public void onItemSelected(int position, Object o, String item) {
|
| | | register_gender.setValue(item);
|
| | | @OnClick(R.id.register_country)
|
| | | public void register_country_click(View view) {
|
| | | new CountryDialog(fragment_register_linear_layout, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | register_country.setValue(value);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | @OnClick(R.id.register_country)
|
| | | public void register_country_click(View view) {
|
| | | CountrySelectionDialog countrySelectionPopup = new CountrySelectionDialog(getActivity(), new OkButtonClickedListener() {
|
| | | @Override
|
| | | public void onItemSelected(int position, Object o, String item) {
|
| | | register_country.setValue(item);
|
| | | @OnClick(R.id.register_gender)
|
| | | public void register_gender_click(View view) {
|
| | | new SelectDialog(fragment_register_linear_layout, Constant.DialogSelectType.GENDER, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | register_gender.setValue(value);
|
| | | }
|
| | | });
|
| | | countrySelectionPopup.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);
|
| | | }
|
| | |
|
| | | @OnClick(R.id.register_birthday)
|
| | | public void register_birthday_click(View view) {
|
| | | Date date = new Date();
|
| | | BirthdayPickerDialog myDatePickerDialog=new BirthdayPickerDialog(getActivity(),android.R.style.Theme_Holo_Light_Dialog_NoActionBar,
|
| | | new BirthdayPickerDialog.OnDateSetListener(){
|
| | |
|
| | | @Override
|
| | | public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
|
| | | int month=monthOfYear+1;
|
| | | register_birthday.setValue(year+"-"+month+"-"+dayOfMonth);
|
| | | new DateSelectDialog(
|
| | | new OkClickedListener(){
|
| | | public void onSelected(String value) {
|
| | | register_birthday.setValue(value);
|
| | | }
|
| | | },date);
|
| | | myDatePickerDialog.myShow();
|
| | | },new Date());
|
| | | }
|
| | |
|
| | | @OnClick(R.id.register_visitor_class)
|
| | | public void register_visitor_class_click(View view) {
|
| | | SingleSelectionDialog popup1 = new SingleSelectionDialog(getActivity(),mVisitorTypeList,"访客类型");
|
| | | popup1.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);
|
| | | popup1.addOkButtonClickedListener(new OkButtonClickedListener() {
|
| | | @Override
|
| | | public void onItemSelected(int position, Object o, String item) {
|
| | | register_visitor_class.setValue(item);
|
| | | new SelectDialog(fragment_register_linear_layout, Constant.DialogSelectType.VISITOR_TYPE, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | register_visitor_class.setValue(value); |
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | @OnClick(R.id.register_id_class)
|
| | | public void register_id_class_click(View view) {
|
| | | SingleSelectionDialog popup2 = new SingleSelectionDialog(getActivity(),mCredentialsList,"证件类型");
|
| | | popup2.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);
|
| | | popup2.addOkButtonClickedListener(new OkButtonClickedListener() {
|
| | | @Override
|
| | | public void onItemSelected(int position, Object o, String item) {
|
| | | register_id_class.setValue(item);
|
| | | new SelectDialog(fragment_register_linear_layout, Constant.DialogSelectType.ID_TYPE, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | register_id_class.setValue(value);
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | @OnClick(R.id.fragment_register_idcard_photo)
|
| | | public void identityPhoto(View view) {
|
| | | Toast.makeText(getActivity(), "证件快照", Toast.LENGTH_SHORT).show();
|
| | | }
|
| | |
|
| | | public void setVisitorTypeList(List visitorTypeList) {
|
| | | this.mVisitorTypeList = visitorTypeList;
|
| | | }
|
| | |
|
| | | public void setSexList(List sexList) {
|
| | | this.mSexList = sexList;
|
| | | }
|
| | |
|
| | | public void setCredentialsList(List credentialsList) {
|
| | | this.mCredentialsList = credentialsList;
|
| | | }
|
| | |
|
| | | @Override
|