xuxiuxi
2017-03-23 7d99c9d1c045f31d27676f8907c3b779039d41a2
VisitFace/DemoForBsk/app/src/main/java/com/bsk/zhangbo/demoforbsk/ui/fragment/RegisterFragment.java
@@ -5,13 +5,10 @@
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 com.bsk.zhangbo.demoforbsk.base.BaseApplication;
import com.bsk.zhangbo.demoforbsk.base.BaseFragment;
import com.bsk.zhangbo.demoforbsk.service.DictionaryMng;
import com.bsk.zhangbo.demoforbsk.service.VisitorTypeMng;
@@ -22,9 +19,6 @@
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import org.xutils.view.annotation.ContentView;
import org.xutils.x;
import java.util.Calendar;
import java.util.Date;
@@ -39,13 +33,40 @@
//@ContentView(value = R.layout.fragment_register)
public class RegisterFragment extends BaseFragment implements View.OnClickListener{
    private View mViewName,mViewSex,mViewNation,mViewBirthday,mViewVisitorClass,mViewPhone,mViewIdClass,mViewIdNumber,mViewCompayName,mViewRemark;
    private TextView mViewNameTitle,mViewSexTitle,mViewNationTitle,mViewBirthdyTitle, mViewIdentityTypeContent, mViewGenderContent, mViewCountryContent,mViewBirthdyContent,mViewVisitorClassContent,mViewVisitorClassTitle,mViewPhoneTitle,mViewIdClassTitle,mViewIdNumberTitle,mViewCompanyNameTitle,mViewRemarkTitle;
    @ViewInject(value = R.id.register_tv_content, parentId = R.id.register_id_class)
    private TextView mViewIdentityTypeContent;
    private TextView mViewGenderContent;
    private TextView  mViewCountryContent;
    private TextView mViewBirthdyContent;
    private TextView mViewVisitorClassContent;
    private TextView mViewVisitorClassTitle;
    private EditText mViewNameContent,mViewPhoneContent, mViewIdentityContent,mViewCompanyNameContent,mViewRemarkContent;
    private List mSexList;
    private List mVisitorTypeList;
    private List mCredentialsList;
    private LinearLayout mBaseLayout;
    @ViewInject(R.id.register_name)
    private View mViewName;
    @ViewInject(R.id.register_gender)
    private View mViewSex;
    @ViewInject(R.id.register_country)
    private View mViewNation;
    @ViewInject(R.id.register_birthday)
    private View mViewBirthday;
    @ViewInject(R.id.register_visitor_class)
    private View mViewVisitorClass;
    @ViewInject(R.id.register_phone)
    private View mViewPhone;
    @ViewInject(R.id.register_id_class)
    private View mViewIdClass;
    @ViewInject(R.id.register_id_num)
    private View mViewIdNumber;
    @ViewInject(R.id.register_company)
    private View mViewCompayName;
    @ViewInject(R.id.register_remark)
    private View mViewRemark;
    public static RegisterFragment newInstance() {
        return new RegisterFragment();
@@ -59,50 +80,28 @@
    protected void initViews(View view, Bundle savedInstanceState) {
        mBaseLayout = (LinearLayout) view.findViewById(R.id.register_base);
        ViewUtils.inject(this, mBaseLayout);
        mViewName = view.findViewById(R.id.register_name);
        mViewSex = view.findViewById(R.id.register_sex);
        mViewNation = view.findViewById(R.id.register_nation);
        mViewBirthday = view.findViewById(R.id.register_birthday);
        mViewVisitorClass = view.findViewById(R.id.register_visitor_class);
        mViewPhone = view.findViewById(R.id.register_phone);
        mViewIdClass = view.findViewById(R.id.register_id_class);
        mViewIdNumber = view.findViewById(R.id.register_id_num);
        mViewCompayName = view.findViewById(R.id.register_company);
        mViewRemark = view.findViewById(R.id.register_remark);
        mViewNameTitle = (TextView) mViewName.findViewById(R.id.register_et_title);
        mViewSexTitle = (TextView) mViewSex.findViewById(R.id.register_tv_title);
        mViewNationTitle = (TextView) mViewNation.findViewById(R.id.register_tv_title);
        mViewBirthdyTitle = (TextView) mViewBirthday.findViewById(R.id.register_tv_title);
        mViewVisitorClassTitle = (TextView) mViewVisitorClass.findViewById(R.id.register_tv_title);
        mViewPhoneTitle = (TextView) mViewPhone.findViewById(R.id.register_et_title);
        mViewIdClassTitle = (TextView) mViewIdClass.findViewById(R.id.register_tv_title);
        mViewIdNumberTitle = (TextView) mViewIdNumber.findViewById(R.id.register_et_title);
        mViewCompanyNameTitle = (TextView) mViewCompayName.findViewById(R.id.register_et_title);
        mViewRemarkTitle = (TextView) mViewRemark.findViewById(R.id.register_et_title);
        mViewGenderContent = (TextView) mViewSex.findViewById(R.id.register_tv_content);
        mViewCountryContent = (TextView) mViewNation.findViewById(R.id.register_tv_content);
        mViewBirthdyContent= (TextView) mViewBirthday.findViewById(R.id.register_tv_content);
        mViewVisitorClassContent = (TextView) mViewVisitorClass.findViewById(R.id.register_tv_content);
        mViewIdentityTypeContent = (TextView) mViewIdClass.findViewById(R.id.register_tv_content);
       // mViewIdentityTypeContent = (TextView) mViewIdClass.findViewById(R.id.register_tv_content);
        mViewNameContent = (EditText) mViewName.findViewById(R.id.register_et_content);
        mViewPhoneContent = (EditText) mViewPhone.findViewById(R.id.register_et_content);
        mViewIdentityContent = (EditText) mViewIdNumber.findViewById(R.id.register_et_content);
        mViewCompanyNameContent = (EditText) mViewCompayName.findViewById(R.id.register_et_content);
        mViewRemarkContent = (EditText) mViewRemark.findViewById(R.id.register_et_content);
        mViewNameTitle.setText(R.string.title_name);
        mViewSexTitle.setText(R.string.title_sex);
        mViewNationTitle.setText(R.string.title_nation);
        mViewBirthdyTitle.setText(R.string.title_birthday);
        mViewVisitorClassTitle.setText(R.string.title_visitorClass);
        mViewPhoneTitle.setText(R.string.title_phone);
        mViewIdClassTitle.setText(R.string.title_idClass);
        mViewIdNumberTitle.setText(R.string.title_idNumber);
        mViewCompanyNameTitle.setText(R.string.title_companyName);
        mViewRemarkTitle.setText(R.string.title_remark);
        ((TextView) mViewName.findViewById(R.id.register_et_title)).setText(R.string.title_name);
        ((TextView) mViewSex.findViewById(R.id.register_tv_title)).setText(R.string.title_sex);
        ((TextView) mViewNation.findViewById(R.id.register_tv_title)).setText(R.string.title_nation);
        ((TextView) mViewBirthday.findViewById(R.id.register_tv_title)).setText(R.string.title_birthday);
        ((TextView) mViewVisitorClass.findViewById(R.id.register_tv_title)).setText(R.string.title_visitorClass);
        ((TextView) mViewPhone.findViewById(R.id.register_et_title)).setText(R.string.title_phone);
        ((TextView) mViewIdClass.findViewById(R.id.register_tv_title)).setText(R.string.title_idClass);
        ((TextView) mViewIdNumber.findViewById(R.id.register_et_title)).setText(R.string.title_idNumber);
        ((TextView) mViewCompayName.findViewById(R.id.register_et_title)).setText(R.string.title_companyName);
        ((TextView) mViewRemark.findViewById(R.id.register_et_title)).setText(R.string.title_remark);
        Calendar calendar = Calendar.getInstance();
    }
@@ -138,7 +137,7 @@
        mCredentialsList = DictionaryMng.mCredentialsList;
    }
    @OnClick(R.id.register_sex)
    @OnClick(R.id.register_gender)
    public void selectGender(View view) {
        SingleSelectionPopup popup = new SingleSelectionPopup(getActivity(),mSexList,"性别");
        popup.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);
@@ -150,7 +149,7 @@
        });
    }
    @OnClick(R.id.register_nation)
    @OnClick(R.id.register_country)
    public void selectCountry(View view) {
        CountrySelectionPopup countrySelectionPopup = new CountrySelectionPopup(getActivity());
        countrySelectionPopup.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);