コード例 #1
0
ファイル: StatusUtil.java プロジェクト: ethankang/YiBo
  public static String getBigImageUrl(Status status) {
    String url = null;
    if (status == null) {
      return url;
    }
    if (status.getRetweetedStatus() != null) {
      status = status.getRetweetedStatus();
    }

    if (GlobalVars.IMAGE_DOWNLOAD_QUALITY == ImageQuality.Low
        || GlobalVars.IMAGE_DOWNLOAD_QUALITY == ImageQuality.Middle) {
      url = status.getMiddlePictureUrl();
    } else if (GlobalVars.IMAGE_DOWNLOAD_QUALITY == ImageQuality.High) {
      url = status.getOriginalPictureUrl();
    } else if (GlobalVars.IMAGE_DOWNLOAD_QUALITY == ImageQuality.Adaptive_Net) {
      switch (GlobalVars.NET_TYPE) {
        case WIFI:
          url = status.getOriginalPictureUrl();
          break;
        case NONE:
        case UNKNOW:
        case MOBILE_GPRS:
        case MOBILE_EDGE:
        case MOBILE_3G:
          url = status.getMiddlePictureUrl();
          break;
      }
    }

    return url;
  }
コード例 #2
0
ファイル: StatusUtil.java プロジェクト: ethankang/YiBo
  public static String extraRichStatus(Context context, Status status) {
    String statusText = status.getUser().getMentionName() + ": " + status.getText();
    String middleUrl = status.getMiddlePictureUrl();
    Status retweet = status.getRetweetedStatus();
    if (retweet != null) {
      String retweetText = retweet.getUser().getMentionName() + ": " + retweet.getText();
      statusText = context.getString(R.string.msg_extra_rich_text, statusText, retweetText);
      middleUrl = retweet.getMiddlePictureUrl();
    }
    if (middleUrl != null) {
      statusText += context.getString(R.string.msg_extra_image, middleUrl);
    }

    return statusText;
  }