示例#1
0
 /** 转入用户信息界面 */
 private void goToUserinfo() {
   if (OAuthInfoManager.getInstance().isLogin(WeiboDetail.this)) {
     if (mStatus != null && mStatus.getUser() != null) {
       Sina.getInstance().goToUserInfo(this, Long.parseLong(mStatus.getUser().getId()));
     }
   }
 }
示例#2
0
  @Override
  public void setViews() {
    titleBack.setVisibility(View.VISIBLE);
    titleName.setVisibility(View.VISIBLE);
    titleHome.setVisibility(View.GONE);
    titleName.setText(R.string.weiboBody);

    if (mStatus != null) {
      User user = mStatus.getUser();
      if (user != null) {
        AsyncImageLoader.getInstance()
            .loadPortrait(
                Long.parseLong(mStatus.getUser().getId()),
                mStatus.getUser().getProfileImageUrl(),
                icon);
        name.setText(user.getScreenName());
        userId = user.getId();
        String selfUserId = OAuthInfoManager.getInstance().getWeiboUserId();
        // 20121112 xujun: for weibo delete
        if (userId.equalsIgnoreCase(selfUserId)) {
          weibodel.setVisibility(View.VISIBLE);
        } else {
          weibodel.setVisibility(View.GONE);
        }
        if (user.isVerified()) {
          v.setVisibility(View.VISIBLE);
        } else {
          v.setVisibility(View.GONE);
        }
      }
      content.setMovementMethod(LinkMovementMethod.getInstance());
      content.setText(TextUtil.formatContent(mStatus.getText(), this));
      time.setText(TimeUtil.getTimeStr(mStatus.getCreatedAt()));
      if (mStatus.getSource() != null) {
        source.setText(getString(R.string.from) + mStatus.getSource().getName());
      }

      // 加载图片
      AsyncImageLoader.getInstance()
          .loadPre(Long.parseLong(mStatus.getId()), mStatus.getBmiddlePic(), pic);
      if (isExitSubStatus) { // 若存在转发、评论的微博
        sub.setVisibility(View.VISIBLE);
        Status subStatus = mStatus.getRetweetedStatus();
        AsyncImageLoader.getInstance()
            .loadPre(Long.parseLong(subStatus.getId()), subStatus.getBmiddlePic(), subPic);
        String sContent = "";
        if (subStatus.getUser() != null) {
          sContent = "@" + subStatus.getUser().getScreenName() + ":" + subStatus.getText();
        } else {
          sContent = subStatus.getText();
        }
        subContent.setMovementMethod(LinkMovementMethod.getInstance());
        subContent.setText(TextUtil.formatContent(sContent, this));
      } else {
        sub.setVisibility(View.GONE);
      }

      // 更新微博及转发微博的转发数、评论数
      new AsyncDataLoader(countCallback).execute();
    }
  }