Building List and Grid Layout With RecyclerView in Android using Java

Building List and Grid Layout With RecyclerView in Android using Java

What Is Recycler View?

In this post, We build List and Grid With RecyclerView.

In Older way we were use ListView (Verticle & Horizontal) and GridView. But Material Design as google suggested we have to start Using RecyclerView. Advantage of RecyclerView is we can create list and grid by changing it’s LayoutManager Property.




Let’s understand RecyclerView With Movie List Example then we show movie list in

KeyPoints of RecyclerView

  • RecyclerView Adapter
  • LayoutManager
  • ItemDecoration

 RecyclerView Adapter

RecyclerView Adapter is Similar to BaseAdapter that  Use in ListView Or GridView But RecyclerViewAdapter is more extended Version Of it and more powerfull than BaseAdapter. You can read More Details from RecyclerViewAdapter.

RecyclerView Adapter Sample Given Below



LayoutManager is responsible for measuring and positioning item views within a RecyclerView as well as determining the policy for when to recycle item views that are no longer visible to the user. By changing the LayoutManager a RecyclerView can be used to implement a standard vertically scrolling list, a uniform grid, staggered grids, horizontally scrolling collections and more. Several stock layout managers are provided for general use.

Type of Layoutmanager

  • LinearLayoutManager
  • GridLayoutManager
  • StaggeredGridLayoutManager



It is sub class of layoutManager class and shows items in a vertical or horizontal scrolling list also support reverse layout.

for verticle



shows items in a grid.



StaggeredGridLayout is a of this manager you can set custom width and height to recylerview item



Create Model

for Grid


Grid RecylerView Exmaple


Hope you will enjoy this tutorial Suggestions are well come. fill free and comment for tutorial or prolem with this tutorial

1 thought on “Building List and Grid Layout With RecyclerView in Android using Java

Leave a Comment