Beispiel #1
0
  @Override
  public void onSuccess(JSONObject v, Response response) {

    mActivity.closeLoadingLayer();
    mNextPageNum++;
    //		final int ret = v.optInt("error");
    //		if(ret != 0 )
    //		{
    //			String msg =  v.optString("data");
    //			UiUtils.makeToast(mActivity, ToolUtil.isEmpty(msg) ? getString(R.string.parser_error_msg):
    // msg);
    //			return;
    //		}
    //
    //		JSONObject data = v.optJSONObject("data");
    //		if(null == data)
    //		{
    //			UiUtils.makeToast(mActivity, getString(R.string.parser_error_msg));
    //			return;
    //		}

    JSONArray feeds = v.optJSONArray("lookbooks");
    if (null != feeds) {
      for (int i = 0; i < feeds.length(); i++) {
        HomeFloorModel model = new HomeFloorModel();
        model.parseLook(feeds.optJSONObject(i));
        mHomeFloors.add(model);
      }
    }
    mAdapter.setData(mHomeFloors);
    mAdapter.notifyDataSetChanged();
  }
Beispiel #2
0
  private void requestPage(int page) {
    mAjax = ServiceConfig.getAjax(braConfig.URL_GET_LOOK);
    if (null == mAjax) return;

    //        mAjax.setData("page", page);
    mActivity.showLoadingLayer();

    mAjax.setOnSuccessListener(this);
    mAjax.setOnErrorListener(mActivity);
    mAjax.send();
  }