All Projects → 500px → Greedo Layout For Android

500px / Greedo Layout For Android

Licence: mit
Full aspect ratio grid LayoutManager for Android's RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Greedo Layout For Android

Svelte Grid
A responsive, draggable and resizable grid layout, for Svelte.
Stars: ✭ 473 (-70.21%)
Mutual labels:  layout, grid
Easygrid
EasyGrid - VanillaJS Responsive Grid
Stars: ✭ 77 (-95.15%)
Mutual labels:  layout, grid
Flex Layout
Provides HTML UI layout for Angular applications; using Flexbox and a Responsive API
Stars: ✭ 5,705 (+259.26%)
Mutual labels:  layout, grid
React Flexview
A powerful React component to abstract over flexbox and create any layout on any browser
Stars: ✭ 276 (-82.62%)
Mutual labels:  layout, grid
Flowlayout
An Android Layout Manager to create a gridview with cells of different sizes inspired by Flow Layout for iOS.
Stars: ✭ 98 (-93.83%)
Mutual labels:  layout, recyclerview
React Native Responsive Grid
Bringing the Web's Responsive Design to React Native
Stars: ✭ 369 (-76.76%)
Mutual labels:  layout, grid
Masonry Layout
An efficient and fast web component that gives you a beautiful masonry layout
Stars: ✭ 43 (-97.29%)
Mutual labels:  layout, grid
GenericRecyclerAdapter
Easiest way to use RecyclerView. Reduce boilerplate code! You don't need to write adapters for listing pages anymore!
Stars: ✭ 53 (-96.66%)
Mutual labels:  android-recyclerview, recyclerview
React Photo Layout Editor
Photo layout editor for react
Stars: ✭ 96 (-93.95%)
Mutual labels:  layout, grid
React Native Flexbox Grid
Responsive Grid for React Native
Stars: ✭ 95 (-94.02%)
Mutual labels:  layout, grid
gymnast
🤸 Configurable grid and layout engine for React
Stars: ✭ 35 (-97.8%)
Mutual labels:  grid, layout
Stack Up.js
Create fixed width, variable height grid layouts.
Stars: ✭ 117 (-92.63%)
Mutual labels:  layout, grid
vue-smart-widget
🗃️Smart widget is a flexible and extensible content container component for Vue2.x / Vue3.x in Next branch.
Stars: ✭ 110 (-93.07%)
Mutual labels:  grid, layout
Waterfall.js
Tired of use creepy hacks or heavy ways to get a Grid based on Pinterest?
Stars: ✭ 458 (-71.16%)
Mutual labels:  layout, grid
Fluid-Grid
Fluid, Responsive and Semantic grid for Sass (SCSS) or LESS CSS. Supports any number of columns. Gutter width is defined as percentage, and grids can be nested too.
Stars: ✭ 17 (-98.93%)
Mutual labels:  grid, layout
Egjs Infinitegrid
A module used to arrange card elements including content infinitely on a grid layout.
Stars: ✭ 751 (-52.71%)
Mutual labels:  layout, grid
CSS-Grid
CSS Grid 레이아웃 모듈 Level 1
Stars: ✭ 21 (-98.68%)
Mutual labels:  grid, layout
grid-layout
grid-layout is a layout engine which implements grid, can use in canvas/node-canvas
Stars: ✭ 43 (-97.29%)
Mutual labels:  grid, layout
Interior
Design system for the modern web.
Stars: ✭ 77 (-95.15%)
Mutual labels:  layout, grid
Muuri
Infinite responsive, sortable, filterable and draggable layouts
Stars: ✭ 9,797 (+516.94%)
Mutual labels:  layout, grid

Greedo Layout for Android

A drop-in custom layout manager for Android RecyclerViews to layout a grid of photos while respecting their aspect ratios.

image

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].