// Path: app/src/main/java/com/nilhcem/devoxxfr/data/app/model/Speaker.java
// @Value
// public class Speaker implements Parcelable {
// 
//     public static final Parcelable.Creator<Speaker> CREATOR = new Parcelable.Creator<Speaker>() {
//         public Speaker createFromParcel(Parcel source) {
//             return new Speaker(source);
//         }
// 
//         public Speaker[] newArray(int size) {
//             return new Speaker[size];
//         }
//     };
// 
//     int id;
//     String name;
//     String title;
//     String bio;
//     String website;
//     String twitter;
//     String github;
//     String photo;
// 
//     public Speaker(int id, String name, String title, String bio, String website, String twitter, String github, String photo) {
//         this.id = id;
//         this.name = name;
//         this.title = title;
//         this.bio = bio;
//         this.website = website;
//         this.twitter = twitter;
//         this.github = github;
//         this.photo = photo;
//     }
// 
//     protected Speaker(Parcel in) {
//         id = in.readInt();
//         name = in.readString();
//         title = in.readString();
//         bio = in.readString();
//         website = in.readString();
//         twitter = in.readString();
//         github = in.readString();
//         photo = in.readString();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(id);
//         dest.writeString(name);
//         dest.writeString(title);
//         dest.writeString(bio);
//         dest.writeString(website);
//         dest.writeString(twitter);
//         dest.writeString(github);
//         dest.writeString(photo);
//     }
// }


import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
import com.nilhcem.devoxxfr.data.app.model.Speaker;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.List;
package com.nilhcem.devoxxfr.ui.speakers.list;




public class SpeakersListAdapter extends RecyclerView.Adapter<SpeakersListEntry> {

    private final List<Speaker> speakers = new ArrayList<>();
    private final Picasso picasso;
    private final SpeakersListView view;

    public SpeakersListAdapter(Picasso picasso, SpeakersListView view) {
        this.picasso = picasso;
        this.view = view;
    }

    @Override
    public SpeakersListEntry onCreateViewHolder(ViewGroup parent, int viewType) {
        return new SpeakersListEntry(parent, picasso);
    }

    @Override
    public void onBindViewHolder(SpeakersListEntry holder, int position) {
        holder.bindSpeaker(speakers.get(position));
        holder.itemView.setOnClickListener(v -> view.showSpeakerDetails(speakers.get(position)));
    }

    @Override
    public int getItemCount() {
        return speakers.size();
    }

// Path: app/src/main/java/com/nilhcem/devoxxfr/data/app/model/Speaker.java
// @Value
// public class Speaker implements Parcelable {
// 
//     public static final Parcelable.Creator<Speaker> CREATOR = new Parcelable.Creator<Speaker>() {
//         public Speaker createFromParcel(Parcel source) {
//             return new Speaker(source);
//         }
// 
//         public Speaker[] newArray(int size) {
//             return new Speaker[size];
//         }
//     };
// 
//     int id;
//     String name;
//     String title;
//     String bio;
//     String website;
//     String twitter;
//     String github;
//     String photo;
// 
//     public Speaker(int id, String name, String title, String bio, String website, String twitter, String github, String photo) {
//         this.id = id;
//         this.name = name;
//         this.title = title;
//         this.bio = bio;
//         this.website = website;
//         this.twitter = twitter;
//         this.github = github;
//         this.photo = photo;
//     }
// 
//     protected Speaker(Parcel in) {
//         id = in.readInt();
//         name = in.readString();
//         title = in.readString();
//         bio = in.readString();
//         website = in.readString();
//         twitter = in.readString();
//         github = in.readString();
//         photo = in.readString();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(id);
//         dest.writeString(name);
//         dest.writeString(title);
//         dest.writeString(bio);
//         dest.writeString(website);
//         dest.writeString(twitter);
//         dest.writeString(github);
//         dest.writeString(photo);
//     }
// }


// Path: app/src/main/java/com/nilhcem/devoxxfr/ui/speakers/list/SpeakersListAdapter.java
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
import com.nilhcem.devoxxfr.data.app.model.Speaker;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import java.util.List;

package com.nilhcem.devoxxfr.ui.speakers.list;




public class SpeakersListAdapter extends RecyclerView.Adapter<SpeakersListEntry> {

    private final List<Speaker> speakers = new ArrayList<>();
    private final Picasso picasso;
    private final SpeakersListView view;

    public SpeakersListAdapter(Picasso picasso, SpeakersListView view) {
        this.picasso = picasso;
        this.view = view;
    }

    @Override
    public SpeakersListEntry onCreateViewHolder(ViewGroup parent, int viewType) {
        return new SpeakersListEntry(parent, picasso);
    }

    @Override
    public void onBindViewHolder(SpeakersListEntry holder, int position) {
        holder.bindSpeaker(speakers.get(position));
        holder.itemView.setOnClickListener(v -> view.showSpeakerDetails(speakers.get(position)));
    }

    @Override
    public int getItemCount() {
        return speakers.size();
    }

    public void setSpeakers(List<Speaker> speakers) {