Search in sources :

Example 1 with ExpandableLevel0Item

use of eu.davidea.samples.flexibleadapter.items.ExpandableLevel0Item 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;
}
Also used : AnimatorSubItem(eu.davidea.samples.flexibleadapter.items.AnimatorSubItem) SubItem(eu.davidea.samples.flexibleadapter.items.SubItem) ExpandableLevel0Item(eu.davidea.samples.flexibleadapter.items.ExpandableLevel0Item) ExpandableLevel1Item(eu.davidea.samples.flexibleadapter.items.ExpandableLevel1Item)

Aggregations

AnimatorSubItem (eu.davidea.samples.flexibleadapter.items.AnimatorSubItem)1 ExpandableLevel0Item (eu.davidea.samples.flexibleadapter.items.ExpandableLevel0Item)1 ExpandableLevel1Item (eu.davidea.samples.flexibleadapter.items.ExpandableLevel1Item)1 SubItem (eu.davidea.samples.flexibleadapter.items.SubItem)1