I have an ExpandableListView backed by an implementation of BaseExpandableListAdapter. The first group in the list functions as a header and is not expandable. I've set isChildSelectable() to return false for this group and everything's functioning normally. However, when the user clicks on this non-expandable group, the UI still highlights the row. This is a confusing and unnecessary visual cue that I'd like to eliminate.
I can't set android:listSelector="@android:color/transparent" on the ExpandableListView itself, because I do want the other list items to be highlighted upon click and expansion.
Is it possible to suppress click highlighting for that first group (only)?
Try to set the individual parent view's OnClickListener to null from getGroupView().
View getGroupView(int groupPosition, boolean isExpanded, View convertView,
ViewGroup parent) {
...
convertView.setOnClickListener(null);
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With