explaingit

etsy/androidstaggeredgrid

4,735JavaAudience · developerComplexity · 2/5LicenseSetup · moderate

TLDR

A deprecated Android library from Etsy that displays a Pinterest-style grid where items can have different heights, with support for variable column counts and scroll-position sync on device rotation.

Mindmap

mindmap
  root((AndroidStaggeredGrid))
    What it does
      Variable-height grid
      Pinterest-style layout
      Scroll state on rotation
    Features
      Configurable columns
      Portrait and landscape
      Header and footer views
      Standard list adapter
    Status
      Deprecated Sept 2015
      Apache 2.0 license
    Migration
      RecyclerView
      StaggeredGridLayoutManager
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Reference the source code to understand how Etsy implemented a variable-height grid layout before RecyclerView existed

USE CASE 2

Study the scroll-position sync logic to learn how to preserve list state across device orientation changes

USE CASE 3

Migrate an existing AndroidStaggeredGrid integration to RecyclerView with StaggeredGridLayoutManager

Tech stack

JavaAndroidGradle

Getting it running

Difficulty · moderate Time to first run · 30min

Deprecated since September 2015, use Android's built-in RecyclerView with StaggeredGridLayoutManager instead.

Free to use, modify, and distribute in personal and commercial projects with no restrictions beyond keeping the copyright notice.

In plain English

AndroidStaggeredGrid is an Android library from Etsy that displays a grid of items where each item can have a different height, similar to the layout style popularized by Pinterest. Unlike a standard Android grid where every cell is the same size, a staggered grid arranges items in columns while letting each row vary in height based on its content. The library was built because the Etsy Android app needed a stable grid implementation with specific features that no existing Android library provided at the time. The main requirements were: configurable column counts for portrait and landscape orientations, the ability to sync the scroll position when the user rotates the phone, and support for header and footer views above and below the grid. To use it, you add the StaggeredGridView component to your layout XML, set options like the number of columns and the spacing between items, and attach a standard Android list adapter. The grid handles the layout from there. The README notes that all item views should maintain their own width-to-height ratio as column widths change on rotation, and includes a sample image view class that does this automatically. The README prominently notes that this library was deprecated in September 2015 and is no longer maintained. The authors recommend using Google's own RecyclerView with its StaggeredGridLayoutManager instead, which provides the same layout style with ongoing support. The Etsy team moved to that solution internally as well. For anyone who still needs to reference the code, it is available under the Apache 2.0 license. It targets Android 2.3.3 and above and uses Gradle for building.

Copy-paste prompts

Prompt 1
Help me understand how Etsy's AndroidStaggeredGrid syncs scroll position when the user rotates the screen, walk me through the relevant code
Prompt 2
Show me how to replace an AndroidStaggeredGrid implementation with RecyclerView and StaggeredGridLayoutManager so my app uses a maintained library
Prompt 3
Help me adapt the StaggeredGridView from etsy/androidstaggeredgrid to add a header view that spans all columns at the top of the grid
Open on GitHub → Explain another repo

← etsy on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.