@Override public View getGroupView( int groupPosition, boolean isExpanded, View convertView, ViewGroup parentView) { final Lift group = groups.get(groupPosition); convertView = inflater.inflate(R.layout.grouprow, parentView, false); ((TextView) convertView.findViewById(R.id.tvGroup)).setText(group.getLiftName()); ((TextView) convertView.findViewById(R.id.tvCircle)).setText(group.getLiftName().substring(5)); CheckBox checkbox = (CheckBox) convertView.findViewById(R.id.checkbox); checkbox.setChecked(true); checkbox.setOnCheckedChangeListener(new CheckUpdateListener(group)); return convertView; }
// This method used to inflate child rows view @Override public View getChildView( int groupPosition, int childPosition, boolean isLastChild, View view, ViewGroup parentView) { Lift child = (Lift) getChild(groupPosition, childPosition); if (view == null) { LayoutInflater infalInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = infalInflater.inflate(R.layout.childrow, null); } TextView tv = (TextView) view.findViewById(R.id.tvChild); tv.setText(child.getLiftName()); tv.setTag("1"); // TODO Auto-generated method stub return view; }
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { parent.setVisibility(isChecked); save(parent.getLiftName(), isChecked); updateSmartWatch(); }