I am in search of implementing fragments with expandable list view . After searching i found a class that implements expandable listview fragment on https://gist.github.com/1316903 . But i have no idea how to use it. Please help me. I tried list fragments ,but i have no idea about using fragments with expandable list view thanks in advance.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Here is what I got in MonoDroid/C#. I had to strip away some code (for confidentiality), but it should be mostly complete.
This implementation can support distinct child-views, where each group contains a specific child-type that is the same throughout that group. However, you can mix child-types within a group, and can even have different group-types (which just changes the group header really; I use the same group-type for both groups, and use the group's position to determine the child-type - so group[0] contains children of ExpandableListChild1 and group[1] of ExpandableListChild2 - as is the intended use).
The child-types here only differ by their background color (for simplicity's sake), however these views can be any view you require, including custom views. Just make a corresponding ExpandListChild subclass for whatever view you need. Also, the base class ExpandListChildAbs can be whatever you need to suit your app. If you only have one child type, a base class isn't necessary, however if there are two or more then you need some sort of base class both children-types can subclass from to support the polymorphism within the BaseExpandableListAdapter method getChild and related methods.
MainLayout
ExpandList_GroupItem
ExpandList_ChildItem1
ExpandList_ChildItem2
Android has a great collection of working code examples in the ApiDemos project. You can get it in eclipse as a New->"Android Sample Project". The ApiDemos has a nice example of an expandable list. It's a very good starting point before using a more complex and advanced example.