Examples of OffPicItem


Examples of iqq.im.bean.content.OffPicItem

          ContentItem.Type type = ContentItem.Type.valueOfRaw(items.getString(0));
          switch (type) {
            case FACE:    addContentItem(new FaceItem(items.toString())); break;
            case FONT:    addContentItem(new FontItem(items.toString())); break;
            case CFACE:   addContentItem(new CFaceItem(items.toString())); break;
            case OFFPIC: addContentItem(new OffPicItem(items.toString())); break;
            default:
          }
        }else if( value instanceof String){
          addContentItem(new TextItem((String) value));
        }else{
View Full Code Here

Examples of iqq.im.bean.content.OffPicItem

  @Override
  protected void onHttpStatusOK(QQHttpResponse response) throws QQException,
      JSONException {
    Pattern p = Pattern.compile(QQConstants.REGXP_JSON_SINGLE_RESULT);
    Matcher m = p.matcher(response.getResponseString());
    OffPicItem pic = new OffPicItem();
    JSONObject obj = null;
   
    if (!m.find()) {
      pic.setSuccess(false);
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
          new QQException(QQErrorCode.UNEXPECTED_RESPONSE, response.getResponseString() ));
    }
   
    String regResult = m.group().replaceAll("[\\r]?[\\n]", " ")
      .replaceAll("[\r]?[\n]", " ");
    obj = new JSONObject(regResult);
   
    int retcode = obj.getInt("retcode");
    if (retcode == 0) {
      pic.setSuccess(obj.getInt("progress") == 100 ? true : false);
      pic.setFileSize(obj.getInt("filesize"));
      pic.setFileName(obj.getString("filename"));
      pic.setFilePath(obj.getString("filepath"));
      notifyActionEvent(QQActionEvent.Type.EVT_OK, pic);
      return;
    }

    // 失败后返回路径
    pic.setFilePath(file.getPath());
    pic.setSuccess(false);
    notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
        new QQException(QQErrorCode.UNEXPECTED_RESPONSE, response.getResponseString() ));
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.