Skip to content

mooqoo/RecyclerView_Sample

Repository files navigation

RecyclerView_Sample

This project explore the basic structure of RecyclerView and demonstrate the ability of LayoutManager. In this demo code, you can select different radio button to see the behavior of the different LayoutManager being used. By click on the item itself, it will display a toast message indicating that the item is pressed.

app layout

This Sample Code includes:

  • add compile 'com.android.support:recyclerview-v7:21.0.0' in build.gradle for backward compatibility
  • create custom data for RecyclerView
  • setup adapter to draw the view with the data
  • explore different LayoutManager's behavior
  • implement onClickListener inside adapter's ViewHolder

LayoutManager

There are three types of LayoutManager:

  • LinearLayoutManager: it shows items in a vertical or horizontal scrolling list
  • GridLayoutManager: it shows items in a grid
  • StaggeredGridLayoutManager: it shows items in a grid

In addition to that, to create a custom layout manager, extend the RecyclerView.LayoutManager class.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages