Our Adapter class will extend BaseExpandableListAdapter class.įollowing will be override functions which we will implement from BaseExpandableListAdapter class. ) Create Adapter Class for ExpandableListView We will send List of type FAQ (Kotlin Data Class) to our ExpandableListView Adapter class and it will show these Faq’s and their answers in List. item_faqs_parent.xmlĪdd XML Layout file for ExpandableListView Child Item When ever user will click on any parent item in ListView it will be expanded or collapse, if already expanded □. Our Parent Item for ExpandableListView will have One TextView and One ImageView. Add XML Layout file for ExpandableListView parent Item Add ExpandableListView in XML Layout file ExpandableListView in Android is a View which is vertically scroll-able like normal ListView but it can have child items for each List Item.Ĭhild items in Expandable List View can be collapsed or expanded on clicking.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |