public View getGroupView( int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { GroupHolder _GroupHolder; if (convertView == null) { convertView = LayoutInflater.from(m_Context).inflate(R.layout.category_group_list_item, null); _GroupHolder = new GroupHolder(); _GroupHolder.Name = (TextView) convertView.findViewById(R.id.tvCategoryName); _GroupHolder.Count = (TextView) convertView.findViewById(R.id.tvCount); convertView.setTag(_GroupHolder); } else { _GroupHolder = (GroupHolder) convertView.getTag(); } ModelCategory _ModelCategory = (ModelCategory) getGroup(groupPosition); _GroupHolder.Name.setText(_ModelCategory.GetCategoryName()); int _Count = m_BusinessCategory.GetNotHideCountByParentID(_ModelCategory.GetCategoryID()); _GroupHolder.Count.setText(m_Context.getString(R.string.TextViewTextChildrenCategory, _Count)); _ChildCountOfGroup.add(_Count); return convertView; }
public View getChildView( int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { ChildHolder _ChildHolder; if (convertView == null) { convertView = LayoutInflater.from(m_Context).inflate(R.layout.category_children_list_item, null); _ChildHolder = new ChildHolder(); _ChildHolder.Name = (TextView) convertView.findViewById(R.id.tvCategoryName); convertView.setTag(_ChildHolder); } else { _ChildHolder = (ChildHolder) convertView.getTag(); } ModelCategory _ModelCategory = (ModelCategory) getChild(groupPosition, childPosition); _ChildHolder.Name.setText(_ModelCategory.GetCategoryName()); return convertView; }
public int getChildrenCount(int groupPosition) { ModelCategory _ModelCategory = (ModelCategory) getGroup(groupPosition); List _List = m_BusinessCategory.GetNotHideCategoryListByParentID(_ModelCategory.GetCategoryID()); return _List.size(); }
public Object getChild(int groupPosition, int childPosition) { ModelCategory _ModelCategory = (ModelCategory) getGroup(groupPosition); List _List = m_BusinessCategory.GetNotHideCategoryListByParentID(_ModelCategory.GetCategoryID()); return _List.get(childPosition); }