500px/greedo-layout-for-android
500px/greedo-layout-for-android has 1,619 GitHub stars and 152 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-11 17:22 UTC. Last push 2022-06-21.
Full aspect ratio grid LayoutManager for Android's RecyclerView
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalGreedo Layout for Android
A drop-in custom layout manager for Android RecyclerViews to layout a grid of photos while respecting their aspect ratios.

Setup
Download the latest release via Gradle:
repositories {
maven { url 'https://github.com/500px/greedo-layout-for-android/raw/master/releases/' }
}
dependencies {
compile 'com.fivehundredpx:greedo-layout:1.5.1'
}
Usage
See the sample project for a complete solution on how to use GreedoLayout. Below are the specific steps.
// Create an instance of the GreedoLayoutManager and pass it to the RecyclerView
MyRecyclerAdapter recyclerAdapter = new MyRecyclerAdapter(this);
GreedoLayoutManager layoutManager = new GreedoLayoutManager(recyclerAdapter);
RecyclerView recyclerView = (RecyclerView)findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(recyclerAdapter);
// Set the max row height in pixels
layoutManager.setMaxRowHeight(300);
// If you would like to add spacing between items (Note, MeasUtils is in the sample project)
int spacing = MeasUtils.dpToPx(4, this);
recyclerView.addItemDecoration(new GreedoSpacingItemDecoration(spacing));
And then, in your RecyclerView adapter, or some other class of your choosing, implement SizeCalculatorDelegate. This implementation got passed to the layout manager above.
public class MyRecyclerAdapter extends RecyclerView.Adapter<ViewHolder> implements SizeCalculatorDelegate {
@Override
public double aspectRatioForIndex(int index) {
// Return the aspect ratio of your image at the given index
}
}
License
GreedoLayout is released under the MIT license. See LICENSE for details.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,822 starspublic-apis/public-apis
A collective list of free APIs
498,187 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
452,335 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,355 stars