use of eu.davidea.samples.flexibleadapter.items.ExpandableLevel1Item in project FlexibleAdapter by davideas.
the class DatabaseService method newExpandableLevelItem.
/*
* Creates a special expandable item which has another level of expandable.
* IMPORTANT: Give different IDs to each child and override getExpansionLevel()!
*/
private ExpandableLevel0Item newExpandableLevelItem(int i) {
//ExpandableLevel0Item is an expandable with Level=0
ExpandableLevel0Item expandableItem = new ExpandableLevel0Item("EI" + i);
expandableItem.setTitle("Expandable Two-Levels " + i);
for (int j = 1; j <= SUB_ITEMS; j++) {
//ExpandableLevel1Item is an expandable as well with Level=1
ExpandableLevel1Item expSubItem = new ExpandableLevel1Item(expandableItem.getId() + "-EL" + j);
expSubItem.setTitle("Expandable Sub Item " + j);
for (int k = 1; k <= 3; k++) {
SubItem subItem = new SubItem(expandableItem.getId() + expSubItem.getId() + "-SB" + k);
subItem.setTitle("Simple Sub Item " + k);
expSubItem.addSubItem(subItem);
}
expandableItem.addSubItem(expSubItem);
}
return expandableItem;
}
Aggregations