예제 #1
0
 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;
 }
예제 #2
0
 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;
 }