{"id":3463,"url":"https://github.com/etsy/AndroidStaggeredGrid","last_synced_at":"2025-08-12T01:31:00.887Z","repository":{"id":12403875,"uuid":"15057216","full_name":"etsy/AndroidStaggeredGrid","owner":"etsy","description":"An Android staggered grid view which supports multiple columns with rows of varying sizes.","archived":false,"fork":false,"pushed_at":"2023-04-09T20:59:34.000Z","size":878,"stargazers_count":4755,"open_issues_count":106,"forks_count":1125,"subscribers_count":298,"default_branch":"master","last_synced_at":"2024-12-04T22:07:19.885Z","etag":null,"topics":["non-sox"],"latest_commit_sha":null,"homepage":"https://github.com/etsy/AndroidStaggeredGrid","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etsy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-12-09T19:43:45.000Z","updated_at":"2024-11-13T10:10:05.000Z","dependencies_parsed_at":"2024-01-02T21:20:25.686Z","dependency_job_id":"86d4204a-268e-46d8-ba7f-f967334c9fdb","html_url":"https://github.com/etsy/AndroidStaggeredGrid","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etsy%2FAndroidStaggeredGrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etsy%2FAndroidStaggeredGrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etsy%2FAndroidStaggeredGrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etsy%2FAndroidStaggeredGrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etsy","download_url":"https://codeload.github.com/etsy/AndroidStaggeredGrid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229303878,"owners_count":18052269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["non-sox"],"created_at":"2024-01-05T20:16:42.230Z","updated_at":"2024-12-13T22:30:38.921Z","avatar_url":"https://github.com/etsy.png","language":"Java","readme":"\nAndroidStaggeredGrid\n=====================\n\n\n##Notice - Deprecated - 09-2015\n\nThis library has been deprecated. We will no longer be shipping any updates or approving community pull requests for this project.\n\nWhile the code will remain for anyone who wishes to use it, we suggest you prefer using Google's own [`RecyclerView `](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html) with their [`StaggeredGridLayoutManager`](https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager.html). We are doing the same internally at Etsy.\n\nThanks to everyone who used the library and submitted code or issues to improve it.\n\n##About\n\nAn Android staggered grid view which supports multiple columns with rows of varying sizes.\n\nThe `StaggeredGridView` was developed due to requirements for the Etsy app not met by any existing Android libraries.\nNamely a stable implementation with the ability to have a different number of columns in landscape \u0026 portrait,\nto sync grid position across orientation changes and support for headers \u0026 footers.\n\n![Staggered Grid Sample Image][1]\n\n##Features\n\n * Configurable column count for portrait and landscape orientations.\n * Sync'd row position across orientation changes.\n * Configurable item margin.\n * Support for headers \u0026 footers.\n * Internal padding that does not affect the header \u0026 footer.\n * Extends [`AbsListView`](http://developer.android.com/reference/android/widget/AbsListView.html) - \"mostly\"\n * Supports [`AbsListView.OnScrollListener`](http://developer.android.com/reference/android/widget/AbsListView.OnScrollListener.html)\n\n##Setup\n\nThe library was built for and tested on Android version 2.3.3(SDK 10) and above. It could be modified to support older versions if required.\n\nThe simplest way to use AndroidStaggeredGrid is to add the library as a gradle aar dependency to your build. See the [CHANGELOG.md](https://github.com/etsy/AndroidStaggeredGrid/blob/master/CHANGELOG.md) for the latest version number.\n\n```\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    compile 'com.etsy.android.grid:library:x.x.x' // see changelog\n}\n```\n\nAlternatively import the `/library` project into your Android Studio project and add it as a dependency in your `build.gradle`.\n\nThe library is currently configured to be built via Gradle only. It has the following dependencies:\n\n * Android Gradle plugin v0.9.2 - `com.android.tools.build:gradle:0.9.2`\n * Android Support Library v19.1 - `com.android.support:support-v4:19.1.+`\n\nStill use Eclipse/building with Ant? You can still use AndroidStaggeredGrid, it's just a few extra steps (left up to the reader).\n\n##Usage\n\n*Please see the `/sample` app for a more detailed code example of how to use the library.*\n\n1. Add the `StaggeredGridView` to the layout you want to show.\n    ```xml\n\n        \u003ccom.etsy.android.grid.StaggeredGridView\n            xmlns:android=\"http://schemas.android.com/apk/res/android\"\n            xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n            android:id=\"@+id/grid_view\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            app:item_margin=\"8dp\"\n            app:column_count=\"@integer/column_count\" /\u003e\n    ```\n2. Configure attributes.\n * `item_margin` - The margin around each grid item (default 0dp).\n * `column_count` - The number of columns displayed. Will override column_count_portrait and column_count_landscape if present (default 0)\n * `column_count_portrait` - The number of columns displayed when the grid is in portrait (default 2).\n * `column_count_landscape` - The number of columns displayed when the grid is in landscape (default 3).\n * `grid_paddingLeft` - Padding to the left of the grid. Does not apply to headers and footers (default 0).\n * `grid_paddingRight` - Padding to the right of the grid. Does not apply to headers and footers (default 0).\n * `grid_paddingTop` - Padding to the top of the grid. Does not apply to headers and footers (default 0).\n * `grid_paddingBottom` - Padding to the bottom of the grid. Does not apply to headers and footers (default 0).\n3. Setup an adapter just like you would with a `GridView`/`ListView`.\n    ```java\n    ListAdapter adapter = ...;\n\n    StaggeredGridView gridView = (StaggeredGridView) findViewById(R.id.grid_view);\n\n    gridView.setAdapter(adapter);\n    ```\n**NOTE:**\nAs column widths change on orientation change, the grid view expects that all children\nmaintain their own width to height ratio. To assist with this the project includes the\n`DynamicHeightImageView` as an example of a view that measures its height based on its width.\n\n##TODO\n\nThe `StaggeredGridView` does not support the following:\n\n * Item selector drawables\n * Item long press event\n * Scroll bars\n * Row dividers\n * Edge effect\n * Fading edge\n * Overscroll\n\n##License\n\n    Copyright (c) 2013 Etsy\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n[1]: http://f.cl.ly/items/2z1B0Y0M0G0O2k1l3J03/Trending.png\n","funding_links":[],"categories":["Libraries","Index `(light-weight pages)`","Java","Index","Uncategorized","Libs","库"],"sub_categories":["GUI","Uncategorized","\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget","[](https://github.com/JStumpp/awesome-android/blob/master/readme.md#gui)GUI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetsy%2FAndroidStaggeredGrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetsy%2FAndroidStaggeredGrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetsy%2FAndroidStaggeredGrid/lists"}