| | |
| | | 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.EditText;
|
| | | import android.widget.ImageView;
|
| | | import android.widget.LinearLayout;
|
| | | import android.widget.TextView;
|
| | | import android.widget.Toast;
|
| | |
|
| | | import com.bsk.zhangbo.demoforbsk.R;
|
| | |
| | | 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.service.VisitorTypeMng;
|
| | | import cn.com.basic.face.listeners.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.widget.BirthdayPickerDialog;
|
| | | import cn.com.basic.face.widget.CountrySelectionDialog;
|
| | | import cn.com.basic.face.widget.RegisterRightFieldLabelView;
|
| | | import cn.com.basic.face.widget.RegisterRightFieldTextView;
|
| | | import cn.com.basic.face.widget.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;
|
| | | import cn.com.basic.face.discern.entity.VisitPersonType;
|
| | |
|
| | | /**
|
| | | * Created by Administrator on 2017/2/20 0020.
|
| | | */
|
| | | public class RegisterFragment extends BaseFragment implements View.OnClickListener{
|
| | |
|
| | | @ViewInject(R.id.register_name)
|
| | |
| | | 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 String[] countryWordData;
|
| | | private List<String> countryWordList;
|
| | | private HashMap<String, List<String>> countryData;
|
| | | 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(),
|
| | | countryWordData,countryWordList,countryData);
|
| | | countrySelectionPopup.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);
|
| | | countrySelectionPopup.addOkButtonClickedListener(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);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | @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);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 选择人物快照
|
| | | * @param view
|
| | | */
|
| | | @OnClick(R.id.fragment_register_choose_photo)
|
| | | public void fragment_register_choose_photo_click(View view) {
|
| | | Toast.makeText(getActivity(), "选择人物快照", Toast.LENGTH_SHORT).show();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 点击上传图片
|
| | | * @param view
|
| | | */
|
| | | @OnClick(R.id.fragment_register_update__photo)
|
| | | public void fragment_register_update__photo_click(View view) {
|
| | | Intent intent = new Intent();
|
| | |
| | | MainActivity.selectPage(0);
|
| | | }
|
| | |
|
| | | public void setVisitorTypeList(List visitorTypeList) {
|
| | | this.mVisitorTypeList = visitorTypeList;
|
| | | }
|
| | |
|
| | | public void setSexList(List sexList) {
|
| | | this.mSexList = sexList;
|
| | | }
|
| | |
|
| | | public void setCredentialsList(List credentialsList) {
|
| | | this.mCredentialsList = credentialsList;
|
| | | }
|
| | |
|
| | | public void setCountryData(String[] countryWordData, List<String> countryWordList, HashMap<String, List<String>> countryData) {
|
| | | this.countryData = countryData;
|
| | | this.countryWordList = countryWordList;
|
| | | this.countryData = countryData;
|
| | | @OnClick(R.id.fragment_register_idcard_photo)
|
| | | public void identityPhoto(View view) {
|
| | | Toast.makeText(getActivity(), "证件快照", Toast.LENGTH_SHORT).show();
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 证件快照
|
| | | * @param view
|
| | | */
|
| | | @OnClick(R.id.fragment_register_idcard_photo)
|
| | | public void identityPhoto(View view) {
|
| | | Toast.makeText(getActivity(), "证件快照", Toast.LENGTH_SHORT).show();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void onClick(View v) {}
|
| | |
|
| | | public void setRegisterInfo(CheckInQueryItem item) {
|
| | | fragment_register_choose_photo.setImageURI(Uri.parse(AppApi.IMAGEURL_BASE + item.getImagePath()));
|
| | | }
|
| | |
|
| | | }
|