コード例 #1
0
  private void getUserData() {
    mNewUserBean.userName = mEditName.getText().toString().trim();
    mNewUserBean.truckNum = mEditPlate.getText().toString().trim();
    // 如果用户为车辆用户,则获取相应信息
    if (Constants.Value.YES.equals(PreferencesUtil.is_driver)) {
      mNewUserBean.truckNum = mEditPlate.getText().toString().trim();
      mNewUserBean.truckType = mEditModel.getText().toString().trim();
      try {
        mNewUserBean.truckLength = Double.parseDouble(mEditLength.getText().toString());
        mNewUserBean.truckWeight = Double.parseDouble(mEidtLoad.getText().toString());
      } catch (Exception e) {
        ErrLogUtils.uploadErrLog(this, ErrLogUtils.toString(e));
        finish();
      }
    }

    // // 去掉重复的图片
    // Set<String> set = new HashSet<String>();
    // set.addAll(Bimp.drr);
    //
    // for (String path : set) {
    // path = path.substring(path.lastIndexOf("/") + 1,
    // path.lastIndexOf("."));
    // path = UtilsAndroid.Sdcard.SDPATH_FORMATS + path + ".JPEG";
    // File file = new File(path);
    // System.out.println("ipath:" + path);
    // if (file.exists()) {
    // imgList.add(path);
    // }
    // }
  }
コード例 #2
0
  /** 初始化控件 */
  private void initControls() {
    // mImgBack = findViewById(R.id.activity_edit_info_iv_go_back);
    mImgBack = (ImageView) findViewById(R.id.common_view_title_img);
    mTextTitle = (TextView) findViewById(R.id.common_view_title_text);
    mTextTitle.setText(R.string.data_editor);

    mBtnSave = (Button) findViewById(R.id.activity_edit_info_bt_info_save);

    mSelectModel = (RelativeLayout) findViewById(R.id.activity_edit_info_lay_choose_model);
    mRlSelectLength = (RelativeLayout) findViewById(R.id.activity_edit_info_lay_choose_length);
    mRlSelectLoad = (RelativeLayout) findViewById(R.id.activity_edit_info_lay_choose_load);

    mGridView = (CustomGridView) findViewById(R.id.activity_edit_info_cgv_edit);

    mLlDriverEdit = (LinearLayout) findViewById(R.id.activity_edit_info_lay_driver_edit);

    mEditName = (EditText) findViewById(R.id.activity_edit_info_et_user_name);

    // 性别单选控件
    segmentStatus = (SegmentedRadioGroup) findViewById(R.id.activity_edit_info_segment_sex);

    if (Constants.Value.MAN.equals(mNewUserBean.sex)) {
      ((RadioButton) findViewById(R.id.activity_edit_info_rb_man)).setChecked(true);
    } else {
      ((RadioButton) findViewById(R.id.activity_edit_info_rb_woman)).setChecked(true);
    }

    mEditTel = (TextView) findViewById(R.id.activity_edit_info_et_tel);

    mEditPlate = (EditText) findViewById(R.id.activity_edit_info_et_plate);

    mEditModel = (TextView) findViewById(R.id.activity_edit_info_et_vehicle_model);
    mEditLength = (TextView) findViewById(R.id.activity_edit_info_et_vehicle_length);
    mEidtLoad = (TextView) findViewById(R.id.activity_edit_info_et_vehicle_load);

    // 用户为车辆用户,显示相关信息
    if (Constants.Value.YES.equals(PreferencesUtil.is_driver)) {
      mLlDriverEdit.setVisibility(View.VISIBLE);
    }

    // 初始化GridImage适配器
    adapter = new ImageGridShowAdapter(this, mNewUserBean.imgList, true);
    adapter.setShowEvery(true);
    mGridView.setAdapter(adapter);
  }