Exemplo n.º 1
0
  private void onSendCommentResponse(boolean successful, Comment result, VolleyError error) {

    if (successful) {
      if (!mCanLoadMoreComments) {
        mCommentAdapter.add(result);
        fixCommentCount();
      } else {
        ToastUtils.show(R.string.broadcast_send_comment_successful, this);
      }
      mBroadcastCommentList.scrollToPosition(mAdapter.getItemCount() - 1);
      mCommentEdit.setText(null);
    } else {
      LogUtils.e(error.toString());
      ToastUtils.show(
          getString(
              R.string.broadcast_send_comment_failed_format, ApiError.getErrorString(error, this)),
          this);
    }

    setSendingComment(false);
  }