StaggeredGridView
=======
## Introduction
This is a modified version of Android's experimental StaggeredGridView. The StaggeredGridView allows the user to create a GridView with uneven rows similar to how Pinterest looks. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.
## Setup
To use StaggeredGridView in your projects, simply add this project to your workspace then add it as a library project to your current project.
## Usage
StaggeredGridView can be added as a custom view to any layout.
Attributes supported (same behavior as GridView):
* numColumns : determines the amount of columns to be drawn
* drawSelectorOnTop : determine if selector should be drawn on top
```xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:staggered="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mainLayout">
<com.origamilabs.library.views.StaggeredGridView
android:id="@+id/staggeredGridView1"
staggered:numColumns="2"
staggered:drawSelectorOnTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
```
The StaggeredGridView includes its own interface's OnItemClickListener, and OnItemLongClickListener since StaggeredGridView does not extend an AdapterView. Behavior is the same.
```java
onItemClick(StaggeredGridView parent, View view, int position, long id);
onItemLongClick(StaggeredGridView parent, View view, int position, long id);
```
## Tests
No tests have been written however I have tested this View manually with 2.2.2+ devices. Please report any issues.
## TODO:
* implement more custom attributes to mirror GridView's attributes
* develop tests
* hideSelector()
* support multiple choice mode
* currently restoring position can result in the views to be slightly offset when user flings to the top. This is corrected by checking the offsets when position 0 is reached. Would like to dig deeper into the issue.
yxkfw
- 粉丝: 82
- 资源: 2万+
最新资源
- 【岗位说明】生产副总经理岗位职责说明书.doc
- 【岗位说明】生产部岗位说明书(14个岗位).doc
- 【岗位说明】瓦抽专工岗位说明书.doc
- 【岗位说明】瓦抽队长岗位说明书.doc
- 【岗位说明】生产工人岗位职责.doc
- 【岗位说明】一致门窗厂员工奖惩制度.doc
- 【岗位说明】橡胶密封件企业岗位职责说明书.doc
- 【岗位说明】照明公司岗位职责.doc
- 【岗位说明】职位说明书机械工程师.doc
- 【岗位说明】职位说明书范本大全14个生产职位.doc
- 【岗位说明】门窗厂岗位职责02.docx
- 新能源汽车电机控制器功能规范:包括:功能列表;系统架构can;软件架构;硬件架构;EMC方案主要包括高压滤波器方案、结构布局和屏蔽方案、控制板方案、模块方案;系统接口;系统运行模式;系统功能结构;系统
- 内核级后门RootKit技术总揽pdf版最新版本
- 【岗位说明】风控部门职责及风险首席官岗位说明书.docx
- 【岗位说明】风险管理岗职位要求.doc
- 【岗位说明】风险控制岗位职责02.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈