I have listeners for ExpandableListView for group collapsed and expanded:
// There is a text view on group layout, no problem there.
@Override
public void onGroupCollapse(int groupPosition) {
// this callback is triggered, however, once the textView is BOLD by onGroupExpanded, the textView is not set back to normal, seems this line of code does nothing...WHY?
textView.setTypeface(textView.getTypeface(), Typeface.NORMAL);
}
@Override
public void onGroupExpand(int groupPosition) {
// it works fine
textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
}
As you can see above, I have a textView
in group layout, when group is expanded, I bold the textView
, if collapsed, I try to set it back to unbold by Typeface.NORMAL
.
Both callbacks are triggered correctly, however, once the textView
is BOLD by onGroupExpanded(...)
callback, the textView
is not set back to NORMAL when onGroupCollapse(...)
is triggered afterwards. Seems the line of code in onGroupCollapsed(...)
does nothing...WHY?
(Again, onGroupCollapse(...)
is triggered. No problem there!)
textView.setTypeface(null, Typeface.NORMAL);
how does it look? – Arteriole