| | |
| | | @Override |
| | | public void onRefresh() { |
| | | page = 1; |
| | | getGoodsList(); |
| | | getCateGorySecond(); |
| | | getGoodsList(); |
| | | } |
| | | }); |
| | | |
| | |
| | | if (secondList.size() > 0) |
| | | secondList.clear(); |
| | | secondList.addAll(list); |
| | | gv_category_top.setAdapter(new RecommendTopCategoryAdapter(lv_second_category.getContext(), secondList, firstCategory.getName())); |
| | | gv_category_top.setFocusable(true); |
| | | gv_category_top.setFocusableInTouchMode(true); |
| | | gv_category_top.requestFocus(); |
| | | gv_category_top.requestFocusFromTouch(); |
| | | if (gv_category_top.getAdapter() == null) { |
| | | gv_category_top.setAdapter(new RecommendTopCategoryAdapter(lv_second_category.getContext(), secondList, firstCategory.getName())); |
| | | gv_category_top.setFocusable(true); |
| | | gv_category_top.setFocusableInTouchMode(true); |
| | | gv_category_top.requestFocus(); |
| | | gv_category_top.requestFocusFromTouch(); |
| | | } else { |
| | | ((RecommendTopCategoryAdapter) gv_category_top.getAdapter()).notifyDataSetChanged(); |
| | | } |
| | | if (secondList == null || secondList.size() == 0) { //当数据为0的时候 隐藏九宫格分类 |
| | | gv_category_top.setVisibility(View.GONE); |
| | | } else { |
| | |
| | | jsonObject.optJSONObject("data").optJSONArray("picList").toString(), |
| | | new TypeToken<List<HomeBanner>>() { |
| | | }.getType()); |
| | | // JSONArray array = jsonObject.optJSONObject("data").optJSONArray("picList"); |
| | | // for (int i = 0; i < array.length(); i++) { |
| | | // HomeBanner info = list2.get(i); |
| | | // info.setParams(jsonObject.optJSONObject("data").optJSONArray("picList").getJSONObject(i).optJSONObject("params")); |
| | | // } |
| | | if (mBanners != null && mBanners.size() > 0) { |
| | | mBanners.clear(); |
| | | } |