content: package com.androidtutorialshub.loginregister.adapters;
  
  import android.support.v7.widget.AppCompatTextView;
  import android.support.v7.widget.RecyclerView;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.androidtutorialshub.loginregister.R;
  import com.androidtutorialshub.loginregister.model.User;
  
  import java.util.List;
  
  /**
   * Created by lalit on 10/10/2016.
   */
  
  public class UsersRecyclerAdapter extends RecyclerView.Adapter<UsersRecyclerAdapter.UserViewHolder> {
  
      private List<User> listUsers;
  
      public UsersRecyclerAdapter(List<User> listUsers) {
          this.listUsers = listUsers;
      }
  
      @Override
      public UserViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          // inflating recycler item view
          View itemView = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.item_user_recycler, parent, false);
  
          return new UserViewHolder(itemView);
      }
  
      @Override
      public void onBindViewHolder(UserViewHolder holder, int position) {
          holder.textViewName.setText(listUsers.get(position).getName());
          holder.textViewEmail.setText(listUsers.get(position).getEmail());
          holder.textViewPassword.setText(listUsers.get(position).getPassword());
      }
  
      @Override
      public int getItemCount() {
          Log.v(UsersRecyclerAdapter.class.getSimpleName(),""+listUsers.size());
          return listUsers.size();
      }
  
  
      /**
       * ViewHolder class
       */
      public class UserViewHolder extends RecyclerView.ViewHolder {
  
          public AppCompatTextView textViewName;
          public AppCompatTextView textViewEmail;
          public AppCompatTextView textViewPassword;
  
          public UserViewHolder(View view) {
              super(view);
              textViewName = (AppCompatTextView) view.findViewById(R.id.textViewName);
              textViewEmail = (AppCompatTextView) view.findViewById(R.id.textViewEmail);
              textViewPassword = (AppCompatTextView) view.findViewById(R.id.textViewPassword);
          }
      }
  
  
  }
  