Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Android Material Tabs
package com.webheavens.manishkprmaterialtabs.adapters;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.webheavens.manishkprmaterialtabs.R;
import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
* Created by Munish on 11/5/15.
public class CommonRecycleAdapter extends RecyclerView.Adapter<CommonRecycleAdapter.ViewHolder> {
private List<String> itemsData;
public CommonRecycleAdapter(List<String> itemsData) {
this.itemsData = itemsData;
public CommonRecycleAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemLayoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_view_common_items, null);
ViewHolder viewHolder = new ViewHolder(itemLayoutView);
return viewHolder;
public void onBindViewHolder(ViewHolder viewHolder, int position) {
public static class ViewHolder extends RecyclerView.ViewHolder {
@Bind( TextView text;
public ViewHolder(View itemLayoutView) {
ButterKnife.bind(this, itemLayoutView);
public int getItemCount() {
return itemsData.size();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.