Пример #1
0
  /**
   * 1. this message has repost's message 2. this message is an original message
   *
   * <p>if this message has repost's message,try to include its content, if total word number above
   * 140,discard current msg content
   */
  private ItemBean repost() throws WeiboException {

    String content = ((EditText) findViewById(R.id.status_new_content)).getText().toString();

    if (msg.getRetweeted_status() != null) {
      String msgContent = "//@" + msg.getUser().getScreen_name() + ": " + msg.getText();
      String total = content + msgContent;
      if (total.length() < 140) {
        content = total;
      }
    }

    RepostNewMsgDao dao = new RepostNewMsgDao(token, msg.getId());

    boolean comment = true;
    boolean oriComment = enableCommentOri.isChecked();

    if (comment && oriComment) {
      dao.setIs_comment(RepostNewMsgDao.ENABLE_COMMENT_ALL);
    } else if (comment) {
      dao.setIs_comment(RepostNewMsgDao.ENABLE_COMMENT);
    } else if (oriComment) {
      dao.setIs_comment(RepostNewMsgDao.ENABLE_ORI_COMMENT);
    }

    dao.setStatus(content);

    return dao.sendNewMsg();
  }
Пример #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getActionBar().setTitle(R.string.comments);
    getActionBar().setSubtitle(GlobalContext.getInstance().getCurrentAccountName());

    token = getIntent().getStringExtra("token");
    if (TextUtils.isEmpty(token)) token = GlobalContext.getInstance().getSpecialToken();

    msg = (MessageBean) getIntent().getSerializableExtra("msg");
    if (msg == null) {
      commentDraftBean = (CommentDraftBean) getIntent().getSerializableExtra("draft");
      msg = commentDraftBean.getMessageBean();
      getEditTextView().setText(commentDraftBean.getContent());
    }

    getEditTextView().setHint("@" + msg.getUser().getScreen_name() + ":" + msg.getText());
  }