[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=beworker&url=https://github.com/beworker/pinned-section-listview&title=pinned-section-listview&language=java&tags=github&category=software)
Introduction
============
Easy to use ListView with pinned sections for Android 2.1 and higher. Pinned section is a header view which sticks to the top
of the list until at least one item of that section is visible.
![Alt text](screen1.png)
![Alt text](screen2.png)
![Alt text](screen3.png)
Features
========
This list properly implements many features which are missing from other implementations. These are
* Fast scroll
* Headers and footers
* Clickable pinned sections
Besides this it doesn't create any unnecessary views, layouts etc. It's really lean.
Watch [this video][1] to see `PinnedSectionListView` in action.
Usage
=====
1. Replace standard `ListView` with `com.hb.views.PinnedSectionListView` in your `layout.xml` file.
```xml
<com.hb.views.PinnedSectionListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
```
2. Extend your `ListAdapter` in a way that it implements `PinnedSectionListAdapter` interface, in addition to
what it already implements. Basically you need to add a single `isItemViewTypePinned(int viewType)`
method. This method must return `true` for all view types which have to be pinned.
```java
// Our adapter class implements 'PinnedSectionListAdapter' interface
class MyPinnedSectionListAdapter extends BaseAdapter
implements PinnedSectionListAdapter {
...
// We implement this method to return 'true' for all view types we want to pin
@Override
public boolean isItemViewTypePinned(int viewType) {
return viewType == <type to be pinned>;
}
}
```
That's all. You are done! A working example can also be found in `example` folder.
Used by
=======
Let us know if you use this library in your application and we will mention it here.
[Grocery Sum][2]
License
=======
Copyright 2013-2014 Sergej Shafarenka, halfbit.de
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[1]: http://www.youtube.com/watch?v=mI3DpuoIIhQ
[2]: https://play.google.com/store/apps/details?id=org.codechimp.grocerysum
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
pinned-section-listview-master.zip (31个子文件)
pinned-section-listview-master
screen2.png 22KB
screen3.png 22KB
library
project.properties 584B
src
com
hb
views
PinnedSectionListView.java 18KB
AndroidManifest.xml 360B
res
.gitignore 14B
assets
.gitignore 14B
.gitignore 7B
proguard-project.txt 781B
build.gradle 410B
example
project.properties 602B
src
com
hb
examples
PinnedSectionListActivity.java 10KB
AndroidManifest.xml 880B
res
drawable-hdpi
ic_launcher.png 6KB
values-v11
styles.xml 323B
menu
main.xml 964B
drawable-mdpi
ic_launcher.png 3KB
layout
activity_main.xml 329B
drawable-xxhdpi
ic_launcher.png 11KB
drawable-xhdpi
ic_launcher.png 7KB
values
colors.xml 361B
strings.xml 440B
styles.xml 679B
values-v14
styles.xml 380B
assets
.gitignore 14B
libs
android-support-v4.jar 384KB
proguard-project.txt 781B
ic_launcher-web.png 44KB
README.md 3KB
.gitignore 48B
screen1.png 23KB
共 31 条
- 1
资源评论
- zyz66782018-12-08我的也要实现这个功能,不过不是用安卓,是用js,能分享一下思路吗?
- qq_359481932017-10-13没下载成果
- 驛路梨花醉美2018-03-02感谢楼主分享
LeBron_Six
- 粉丝: 802
- 资源: 208
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功