private void initExpandTabListener() { viewMiddle.setOnSelectListener( new ViewMiddle.OnSelectListener() { @Override public void getValue(String showText) { onClickType = 0; onRefresh(viewMiddle, showText); } }); viewRight.setOnSelectListener( new ViewRight.OnSelectListener() { @Override public void getValue(String showText) { onClickType = 1; onRefresh(viewRight, showText); } }); }
private void initAllType(JSONArray jsonArray) { allCategorieList = new ArrayList<AllCategory>(); ArrayList<String> groups = new ArrayList<String>(); SparseArray<LinkedList<String>> children = new SparseArray<LinkedList<String>>(); for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); AllCategory allCategory = JSONObject.toJavaObject(jsonObject, AllCategory.class); allCategorieList.add(allCategory); groups.add(allCategory.getTypename()); LinkedList<String> tItem = new LinkedList<String>(); if (allCategory.getListc() != null && allCategory.getListc().size() > 0) { for (int j = 0; j < allCategory.getListc().size(); j++) { tItem.add(allCategory.getListc().get(j).getCatName()); } } children.put(i, tItem); } if (groups != null && groups.size() > 0) { viewMiddle.setAdapter(getActivity(), groups, children); } }