Beispiel #1
0
  @Override
  public void findviewWithId() {
    // TODO Auto-generated method stub
    lvShop = (XListView) findViewById(R.id.lv_shop);
    lvShop.setPullLoadEnable(false);
    lvShop.setPullRefreshEnable(true);

    et_shopsearch = (EditText) findViewById(R.id.et_shopsearch);
    btn_search = (ImageButton) findViewById(R.id.btn_search);
  }
Beispiel #2
0
  @Override
  public void initListener() {
    lvShop.setXListViewListener(
        new IXListViewListener() {
          @Override
          public void onRefresh() {
            getAllShop();
          }

          @Override
          public void onLoadMore() {
            XListViewUtil.endload(lvShop);
          }
        });

    btn_search.setOnClickListener(this);

    et_shopsearch.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
            // TODO Auto-generated method stub

          }

          @Override
          public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
            // TODO Auto-generated method stub

          }

          @Override
          public void afterTextChanged(Editable arg0) {
            String school_name = et_shopsearch.getText().toString().trim();
            if (TextUtils.isEmpty(school_name)) {
              if (!TextUtils.isEmpty(allshopreturnstr)) {
                fillShopData(allshopreturnstr);
              }
            }
          }
        });
  }
Beispiel #3
0
 private void fillShopData(String resultJson) {
   ArrayList<ShopBean> shopList =
       gson.fromJson(resultJson, new TypeToken<List<ShopBean>>() {}.getType());
   System.out.println(shopList.size());
   lvShop.setAdapter(new ShopAdapter(activity, shopList));
 }