Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maurycyw/StaggeredGridView
A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.
https://github.com/maurycyw/StaggeredGridView
Last synced: 3 months ago
JSON representation
A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.
- Host: GitHub
- URL: https://github.com/maurycyw/StaggeredGridView
- Owner: maurycyw
- Created: 2012-12-12T23:12:15.000Z (about 12 years ago)
- Default Branch: develop
- Last Pushed: 2014-06-17T00:17:48.000Z (over 10 years ago)
- Last Synced: 2024-10-29T19:58:46.240Z (3 months ago)
- Language: Java
- Homepage: https://github.com/maurycyw/StaggeredGridViewDemo
- Size: 789 KB
- Stars: 1,644
- Watchers: 150
- Forks: 664
- Open Issues: 46
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-android-ui - https://github.com/maurycyw/StaggeredGridView
README
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
```
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.