コード例 #1
0
ファイル: SettingActivity.java プロジェクト: bingdon/MyLineBu
 private void showLoginOut() {
   UmenAnalyticsUtility.onEvent(context, ConstantS.UMNEG_LOGIN_OUT);
   if (null != WyyApplication.getInfo()) {
     TagUtils.delTag(WyyApplication.getInfo().getId(), context);
   }
   delDataBase();
   clearPreferences();
   startActivity(new Intent(context, LoginActivity.class));
   finshAll();
   finish();
 }
コード例 #2
0
 private void showModifySex() {
   int index = 0;
   try {
     index = Integer.valueOf(WyyApplication.getInfo().getGender());
   } catch (Exception e) {
     // TODO: handle exception
   }
   if (index == 0) {
     index = 1;
   } else {
     index = 0;
   }
   ModifyDialog.modifySex(context, index);
 }
コード例 #3
0
  private void setSex() {
    switch (WyyApplication.getInfo().getGender()) {
      case ConstantS.MAN:
        userSex.setText(R.string.boy);
        break;

      case ConstantS.WOMAN:
        userSex.setText(R.string.gilr);
        break;

      default:
        break;
    }
  }
コード例 #4
0
  private void setSex() {
    switch (WyyApplication.getInfo().getGender()) {
      case ConstantS.MAN:
        Drawable drawable0 = getResources().getDrawable(R.drawable.sex_man);
        drawable0.setBounds(0, 0, drawable0.getMinimumWidth(), drawable0.getMinimumHeight());

        userAge.setCompoundDrawables(drawable0, null, null, null);
        break;

      case ConstantS.WOMAN:
        Drawable drawable = getResources().getDrawable(R.drawable.sex_woman);
        drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());

        userAge.setCompoundDrawables(drawable, null, null, null);

        break;

      default:
        break;
    }
  }
コード例 #5
0
  @Override
  public void initData() {
    // TODO Auto-generated method stub
    if (personalInfo == null) {
      personalInfo = WyyApplication.getInfo();
    }

    if (personalInfo == null) {
      return;
    }

    userName.setText(personalInfo.getUsername());
    userWeima.setText(personalInfo.getIdcode());
    userCareer.setText(personalInfo.getJob());
    userAge.setText(personalInfo.getAge());
    userHeight.setText(personalInfo.getHeight() + "cm");
    userWeight.setText(personalInfo.getWeight() + "kg");
    userState.setText(personalInfo.getBodyindex());
    userBmi.setText("" + PersonUtils.getBmi(personalInfo.getHeight(), personalInfo.getWeight()));
    userRemarks.setText(personalInfo.getSummary());
    LoadImageUtils.loadImage4ImageV(
        userHeadImageView, HealthHttpClient.IMAGE_URL + personalInfo.getHeadimage());
    setSex();
  }
コード例 #6
0
 private void reshInfo() {
   personalInfo = WyyApplication.getInfo();
   initData();
 }
コード例 #7
0
  private void initPersonInfo() {
    info = WyyApplication.getInfo();
    // if (info == null) {
    // info = (PersonalInfo) getArguments().getSerializable("info");
    // }

    if (info == null) {
      WelcomeActivity.getPersonInfo(getActivity());
      info = WyyApplication.getInfo();
    }

    if (info == null) {
      return;
    }

    userName.setText(WyyApplication.getInfo().getUsername() + "");
    userAge.setText(WyyApplication.getInfo().getAge() + "");
    userWeima.setText(WyyApplication.getInfo().getIdcode() + "");
    userCareer.setText(WyyApplication.getInfo().getJob() + "");
    userHeight.setText(WyyApplication.getInfo().getHeight() + "cm");
    userWeight.setText(WyyApplication.getInfo().getWeight() + "kg");
    userState.setText(WyyApplication.getInfo().getBodyindex() + "");
    userBmi.setText(
        ""
            + PersonUtils.getBmi(
                WyyApplication.getInfo().getHeight(), WyyApplication.getInfo().getWeight()));
    userRemarks.setText(WyyApplication.getInfo().getSummary() + "");
    money.setText(WyyApplication.getInfo().getMoney() + "");

    getperBg();

    setSex();

    if (!TextUtils.isEmpty(info.getHeadimage())) {

      if (WyyApplication.getHeaderImaList().size() > 0) {
        for (int i = 0; i < WyyApplication.getHeaderImaList().size(); i++) {
          if (WyyApplication.getHeaderImaList()
              .get(i)
              .getImaname()
              .equals(WyyApplication.getInfo().getUsername())) {
            headBitmap =
                BitmapFactory.decodeFile(WyyApplication.getHeaderImaList().get(i).getImapath());
            userHeadImageView.setImageBitmap(headBitmap);
            return;
          }
        }
      }

      if (null == headBitmap) {
        new Thread(loadImgRunnable).start();
      }
    }
  }