SHARE
TWEET

Untitled

a guest Jun 25th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package pe.edu.pucp.a20152252.myfirstlogin.features.agenda;
  2.  
  3. import android.support.annotation.NonNull;
  4. import android.support.v7.widget.RecyclerView;
  5. import android.view.LayoutInflater;
  6. import android.view.View;
  7. import android.view.ViewGroup;
  8. import android.widget.TextView;
  9.  
  10. import java.util.List;
  11.  
  12. import pe.edu.pucp.a20152252.myfirstlogin.R;
  13. import pe.edu.pucp.a20152252.myfirstlogin.data.api.out.DiaClaseOutRO;
  14.  
  15. public class AgendaAdapter extends RecyclerView.Adapter<AgendaAdapter.CustomViewHolder>  {
  16.  
  17.     private List<DiaClaseOutRO> dataList;
  18.  
  19.     public AgendaAdapter(List<DiaClaseOutRO> dataList){
  20.         this.dataList = dataList;
  21.     }
  22.  
  23.     @NonNull
  24.     @Override
  25.     public AgendaAdapter.CustomViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
  26.         LayoutInflater layoutInflater = LayoutInflater.from(viewGroup.getContext());
  27.         View view = layoutInflater.inflate(R.layout.fragment_agenda_card, viewGroup, false);
  28.         return new AgendaAdapter.CustomViewHolder(view);
  29.     }
  30.  
  31.     @Override
  32.     public void onBindViewHolder(@NonNull AgendaAdapter.CustomViewHolder holder, int position) {
  33.         holder.textFechaDia.setText(dataList.get(position).getFecha());
  34.     }
  35.  
  36.     @Override
  37.     public int getItemCount() {
  38.         return dataList.size();
  39.     }
  40.  
  41.     class CustomViewHolder extends RecyclerView.ViewHolder {
  42.  
  43.         public final View myView;
  44.  
  45.         TextView textFechaDia;
  46.  
  47.         CustomViewHolder(View itemView) {
  48.             super(itemView);
  49.             myView = itemView;
  50.             textFechaDia = myView.findViewById(R.id.agenda_txt_fecha);
  51.         }
  52.     }
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top