I've made a custom BaseExpandableListAdapter. I'm trying to display a seekbar on some (not all) group views. To do this, I'm inflating a custom layout with a seekbar in it wich I hide/unhide depending on the group. The problem is that these group views WITH VISIBLE seekbar doesn't expand. The ones with HIDDEN seekbar do expand. All group views have children.
This is my getGroupView
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = inflater.inflate(com.voy.sima.R.layout.itemcomplejo, parent, false);
}
Complejo entry = (Complejo)getGroup(groupPosition);
SeekBar sbDesarrollo = (SeekBar) convertView.findViewById(R.id.sbDesarrollo);
sbDesarrollo.setVisibility(View.INVISIBLE);
if(entry.getId() == 2) {
sbDesarrollo.setVisibility(View.VISIBLE);
}
}
What am I missing? I'm sure it's something silly but it's driving me crazy.
I've figured it out. Adding sbDesarrollo.setFocusable(false); did the trick.
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = inflater.inflate(com.voy.sima.R.layout.itemcomplejo, parent, false);
}
Complejo entry = (Complejo)getGroup(groupPosition);
SeekBar sbDesarrollo = (SeekBar) convertView.findViewById(R.id.sbDesarrollo);
sbDesarrollo.setVisibility(View.INVISIBLE);
if(entry.getId() == 2) {
sbDesarrollo.setVisibility(View.VISIBLE);
sbDesarrollo.setFocusable(false);
}
}