コード例 #1
0
  public void displaySkill() {

    String userSkills = loggedUser.getSkills();

    if (userSkills != null) {
      if (userSkills.compareTo("") != 0) {
        strongestSkill.setText(userSkills);
      }
      CustomFontView lib = (CustomFontView) findViewById(R.id.strongSkillLbl);
      if (lib != null) {
        if (userSkills.contains(", ")) {
          lib.setText(getResources().getString(R.string.activity_settings_strongest_skill_lbl_p));
        } else {
          lib.setText(getResources().getString(R.string.activity_settings_strongest_skill_lbl));
        }
      }
    }
  }
コード例 #2
0
  /** Use user data in GUI */
  private void useUserData() {
    String photo = loggedUser.getPhotoLarge();
    if (photo == null) {
      photo = loggedUser.getPhoto();
    }

    if (photo != null) {
      // Set views
      if (loggedUser != null) {
        imageLoader.DisplayImage(photo, imageProfilePhoto, R.drawable.default_avatar25, 400);

        class LoadPhotoThread implements Runnable {
          public Activity activity;
          public RelativeLayout layout;
          public String url;

          @Override
          public void run() {
            Bitmap b = imageLoader.getBitmap(url);
            if (b != null) {
              final Bitmap background = ImageLoader.FastBlur(b, 4);
              b.recycle();

              activity.runOnUiThread(
                  new Runnable() {
                    @Override
                    public void run() {
                      if (background != null) {
                        layout.setBackgroundDrawable(new BitmapDrawable(background));
                      }
                    }
                  });
            }
          }
        }
      }

      title.setText(getResources().getString(R.string.settings));
      textNickName.setText(loggedUser.getNickName());
      textEmail.setText(loggedUser.getUsername());

      displayCategory();
      displaySkill();
    }
  }