|
Project Information
Members
Links
|
OverviewThis project provides listview implementation - divided in sections. The header of top section is sticky at the top of the list. It is similar to sectioned list from iOS. You Should checkout the project from mercurial repository and use it as external android library project. You need to understand how library projects are used - it is described in android's documentation here: http://developer.android.com/guide/developing/projects/projects-eclipse.html. For usage see below. Screenshots
UsageExample activity using the list is part of the project here: http://code.google.com/p/android-section-list/source/browse/src/pl/polidea/sectionedlist/SectionListActivity.java. Make sure to specify SectionListViewTheme (or an equivalent) as theme in your activity in manifest (see issue#2 ). SectionListViewIn order to use SectionListView, you can either add the SectionListView object in the code or add it in the .xml layout similar to Layout Example. SectionListView only accepts SectionListAdapter or class derived from it. Be careful - your SectionListView HAVE TO be inside FrameLayout - with (fill_parent, fill_parent) layout parameters. SectionListAdapterThe adapter wraps around any other adapter that provides content. The wrapped adapter should return items of the SectionListItem type. You should extend from this class and write your own implementation of setSectionText and getSectionView in case you want to provide your own view for section header. Each SectionListItem contains section name, all items with the same section name should be placed next to each other, otherwise there will be two different sections created. OnItemClickListenerThe SectionListAdapter supports also wrapped OnItemClickListener. It is enough to register your original onItemClickListener with setOnItemClickListener and then register the adapter as listener in SectionListView. That's all - adapter will recalculate the position so that your original listener's methods are called with the right item position. |