Ejemplo n.º 1
0
  /**
   * **********************************************
   *
   * @param r 设定文件
   * @return void 返回类型
   * @throws @Title: fastResult @Description: (酒店楼宇接口 返回)
   * @date 2014-11-19 ***********************************************
   */
  @InjectHttpOk(value = {111})
  protected void fastResult(ResponseEntity r) {
    System.out.println(r.getStatus());
    switch (r.getStatus()) {
      case FastHttp.result_ok:
        if (ResultParse.reservationIsResultOK(r, activity)) {
          imgList = Handler_Json.JsonToCollection(r.getContentAsString());
          // InitFocusIndicatorContainer();
          // initGallery();
          ipaAdapter = new ImagePagerAdapter(activity, imgList, indicator_container);

          gallery_hotel.setAdapter(ipaAdapter);
          ipaAdapter.notifyDataSetChanged();
          gallery_hotel.setFocusable(true);
        }
        break;
      case FastHttp.result_net_err:
        Toast.makeText(activity, "网络异常 ,请检查您确保开启无线网络", Toast.LENGTH_SHORT).show();
        break;
    }
  }
Ejemplo n.º 2
0
  /**
   * **********************************************
   *
   * @param r 设定文件
   * @return void 返回类型
   * @throws @Title: result @Description: (推荐房间返回)
   * @date 2014-11-19 ***********************************************
   */
  @InjectHttpOk(1)
  public void result(ResponseEntity r) {
    dismissDialog();
    switch (r.getStatus()) {
      case FastHttp.result_ok:
        ArrayList<HashMap<String, String>> list = null;
        try {
          // if (ResultParse.reservationIsResultOK(r, activity)) {
          String json = Handler_Json.getValue("list", r.getContentAsString()).toString();
          String s = Handler_Json.getValue("pageNo", r.getContentAsString()).toString();
          pageNo = Integer.valueOf(s) + 1;
          if (!"".equals(json)) { // 判断查询数据是否为空 ,
            list = Handler_Json.JsonToCollection(json);
            getList(list);
          } else { // 为空数据 初始化当前页数1 ,展示无数据图片
            // pageNo = 1;
            // dataList.clear();
            Toast.makeText(activity, "无数据", Toast.LENGTH_SHORT).show();
          }
          Ioc.getIoc().getLogger().i(" 完成 刷新");
          // }
        } catch (Exception e) {
          e.printStackTrace();
        }

        break;
      case FastHttp.result_net_err:
        Toast.makeText(activity, "请求错误", Toast.LENGTH_SHORT).show();
        break;
    }
    // 完成 加载更多
    PullToRefreshManager.getInstance().onFooterRefreshComplete();
    // 完成 刷新
    PullToRefreshManager.getInstance().onHeaderRefreshComplete();

    // 关闭顶部的下拉
    PullToRefreshManager.getInstance().headerUnable();
    // 打开顶部的下拉
    PullToRefreshManager.getInstance().headerEnable();
    // 关闭底部的加载
    PullToRefreshManager.getInstance().footerUnable();
    // 打开顶部的加载
    PullToRefreshManager.getInstance().footerEnable();
  }
Ejemplo n.º 3
0
 @InjectHttp
 private void imgListResult(ResponseEntity r) {
   Ioc.getIoc().getLogger().i("图片房间接口返回数据:【" + r + "】");
   switch (r.getStatus()) {
     case FastHttp.result_ok:
       if (ResultParse.isResultOK(r, this)) {
         ArrayList<HashMap<String, String>> list =
             (ArrayList<HashMap<String, String>>)
                 Handler_Json.JsonToCollection(r.getContentAsString());
         spa = new SamplePagerAdapter(this, list, R.layout.activity_img_page_item);
         mViewPager.setAdapter(spa);
       }
       break;
     case FastHttp.result_net_err:
       break;
     default:
       break;
   }
 }