Open IamEgor opened 8 years ago
Interesting, what does your implementation of isHeader
look like?
I just save list.
private List<PeopleListItem> items;
private List<PeopleListItem> items;
public PeopleAdapter(Context context) {
super(context);
items = getSampleItems();
setItems(items);
}
Add method to PeopleAdapter.
public boolean isHeader(int location) {
return items.get(location).isHeader();
}
Save into variable type(Header or not) and add method to PeopleListItem.
public static class PeopleListItem extends ExpandableRecyclerAdapter.ListItem {
public String Text;
private int type;
public PeopleListItem(String group) {
super(TYPE_HEADER);
type = TYPE_HEADER;
Text = group;
}
public PeopleListItem(String first, String last) {
super(TYPE_PERSON);
type = TYPE_PERSON;
Text = first + " " + last;
}
public boolean isHeader() {
return type == TYPE_HEADER;
}
}
It must have something to do with the fact that as the groups are expanded/collapsed, the positions of the headers change. The grid layout doesn't realize that the column spans are changing at those positions. I will need to look into it. I've never tried to use it with grid layout manager.
Greetings!
I'm trying to use this lib with GridLayoutManager. But when I've done this, the result was not as I expected.
When all tabs are expanded thats fine. In other cases it's looked wired. I use this code in my Activity.