- Coffee
- Tea
- Juice
- Coffee
- light roast
- medium roast
- dark roast
- Tea
- Chamomile
- Spearmint
- Darjeeling
- Juice
- Pineapple
- Grapefruit
- Guava
It's simple, right? Except in Java and Android there's a lot of parts.
Here are my notes:
An ExpandableListView is a list that holds lists. The main lists are the headers. They're displayed with some kind of indicator next to them to show that they contain more detail inside.
Parts needed:
- XML
- Layouts
- Main layout - define the main container.
- LinearLayout
- ExpandableListView
- Main header layout - format text/background for categories.
- LinearyLayout
- TextView
- Item header layout - format text/background for items.
- LinearLayout
- TextView
- Java
- Class that extends BaseExpandableListAdapter:
- class DrinkMenuExpandableListAdapter extends BaseExpandableListAdapter
- An Activity or Fragment
- To prepare the lists data.
- To instantiate the class that extends BaseExpandableListAdapter, passing it the data.
- To connect listeners:
- setOnChildClickListener
- setOnGroupClickListener
- setOnGroupExpandedListener
- setOnGroupCollapseListener
- setOnItemClickListener
I'll add the XML code here along with the Java. Will also look at putting it on Github.
No comments:
Post a Comment