Feb 1, 2015
May 6, 2015 (Retired)
Source code


The idea of the project is to make construction of simple RecyclerViews as easy as writing one line of code and supplying a data structure. Why spend time implementing multiple classes if you only need a simple RecyclerView? Currently RecyclerViews containing TextViews and ImageViews are supported with default or custom row layouts.

You are very welcome to offer improvements and feature requests.

How to use

  1. Add the library to your project dependencies.

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile ''
  2. Implement DataModel interface to describe your data structure.

  3. Build your RecyclerView:

    List<DataModel> data = getData(); //your data
    RecyclerView view = new RecyclerViewBuilder(this).setData(data).build();
  4. Add RecyclerView to your layout.

You can find an example of usage in the sample module.

Supported customizations

  • setLayoutManager(LayoutManager) - provide your layout manager, LinearLayoutManager with vertical orientation is used by default
  • setRowLayout(@LayoutRes int) - provide your custom row layout, default behaviour is stacking all your Drawable and String fields from the data structure in a horizontal linear view inside a card view
  • setListener(View.OnClickListener) - provide your onClickListener for RecyclerView members
  • setCardMargins(int, int, int, int) - set margins for both default and custom row layouts (default = 5dp)
  • setCardPadding(int, int, int, int) - set padding for the default row layout only (for custom set up in XML) (default = 10dp)
  • setCardCornerRadii(float) - set corner radii for the default row layout (for custom CardViews set up in XML) (default = 10dp)
  • setItemAnimator(RecyclerView.ItemAnimator) - add custom animation for the list items

Supplying your RecyclerView

Now you can also provide your own RecyclerView: either made programmatically or defined in XML:

RecyclerView recyclerView = (RecyclerView) layout.findViewById(;
new RecyclerViewBuilder(this).using(recyclerView).setData(imageData).build();
View layout = getLayoutInflater().inflate(R.layout.activity_main_recycler, null);
new RecyclerViewBuilder(this).using(, layout).setData(imageData).build();

You are not required to catch the returned RecyclerView - it is the same instance as supplied.

Coming soon

  • basic construction of purely textual RecyclerViews
  • setting a custom LayoutManager
  • setting an onClickListener
  • setting a custom layout from layout resources (implemented for textual RecyclerViews)
  • support for images in data structures
  • other customizations (some are already implemented: margins, padding, corner radii, etc.)
  • your requested features


This is what you get just by providing a simple data structure class containing two text fields and one drawable field and using the most basic construction process new RecyclerViewBuilder(this).setData(imageData).build.

<img src="/screenshots/image_recycler.png" width="250")/>

This is a simplistic textual RecyclerView constructed with mere new RecyclerViewBuilder(this).setData(data).setLayoutManager(new GridLayoutManager(this,2)).setRowLayout(

<img src="/screenshots/text_recycler.png" width="250")/>