Skip to content

SnapAdapter Usage

Prashant Solanki edited this page Dec 14, 2015 · 4 revisions

SnapAdapter Usage

Usage

  • Create a ViewHolder.

  • Thats All. Now just initiate the SnapAdapter and set it to RecyclerView.

adapter = new SnapAdapter<>(this, //Content
                SimpleProduct.class, //Model Class
                R.layout.item_social_button, // Item Layout Id
                ViewHolderProduct.class); // ViewHolder Class

recyclerView.setAdapter(adapter);

adapter.add(data); // Add recyclerView Items.

TADA! Your RecyclerView is Ready!

Clone this wiki locally