// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java
// @ToString
// public class Artist implements Serializable {
//     static final long serialVersionUID = 4653212L;
// 
//     @SerializedName("displayName")
//     private final String displayName;
// 
//     @SerializedName("id")
//     private final String id;
// 
//     @SerializedName("identifier")
//     private final List<Identifier> identifier;
// 
//     @SerializedName("onTourUntil")
//     private final String onTourUntil;
// 
//     @SerializedName("uri")
//     private final String uri;
// 
//     public Artist(String displayName, String id, List<Identifier> identifier, String onTourUntil,
//             String uri) {
//         this.displayName = displayName;
//         this.id = id;
//         this.identifier = identifier;
//         this.onTourUntil = onTourUntil;
//         this.uri = uri;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public List<Identifier> getIdentifier() {
//         return identifier;
//     }
// 
//     public String getOnTourUntil() {
//         return onTourUntil;
//     }
// 
//     public String getUri() {
//         return uri;
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/ui/delegates/ArtistDelegate.java
// public class ArtistDelegate implements AdapterDelegate<List<Artist>> {
//     public static final int TYPE = 48984;
// 
//     SerializedSubject<Artist, Artist> artistClicks = new SerializedSubject<>(
//             PublishSubject.<Artist> create());
// 
//     @Override
//     public int getItemViewType() {
//         return TYPE;
//     }
// 
//     @Override
//     public boolean isForViewType(@NonNull List<Artist> items, int position) {
//         return (0 != position || items.size() != 0);
//     }
// 
//     @NonNull
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent) {
//         return new ArtistViewHolder(LayoutInflater.from(parent.getContext()).inflate(
//                 R.layout.element_artist, parent, false));
//     }
// 
//     @Override
//     public void onBindViewHolder(@NonNull List<Artist> items, int position,
//             @NonNull RecyclerView.ViewHolder holder) {
//         ArtistViewHolder artistViewHolder = (ArtistViewHolder)holder;
//         final Artist artist = items.get(position);
//         artistViewHolder.name.setText(artist.getDisplayName());
//         artistViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 artistClicks.onNext(artist);
//             }
//         });
//     }
// 
//     public Observable<Artist> getArtistClicks() {
//         return artistClicks.asObservable();
//     }
// 
//     static class ArtistViewHolder extends RecyclerView.ViewHolder {
//         @Bind(R.id.artist_name_txv)
//         TextView name;
// 
//         public ArtistViewHolder(View itemView) {
//             super(itemView);
//             ButterKnife.bind(this, itemView);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/ui/delegates/EmptyDelegate.java
// public class EmptyDelegate<T> implements AdapterDelegate<List<T>> {
//     private static final int TYPE = 1916;
// 
//     @Override
//     public int getItemViewType() {
//         return TYPE;
//     }
// 
//     @Override
//     public boolean isForViewType(@NonNull List<T> items, int i) {
//         return i == 0 && items.size() == 0;
//     }
// 
//     @NonNull
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup) {
//         return new EmptyViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(
//                 R.layout.element_empty, viewGroup, false));
//     }
// 
//     @Override
//     public void onBindViewHolder(@NonNull List<T> recordAndReports, int i,
//             @NonNull RecyclerView.ViewHolder viewHolder) {
//         EmptyViewHolder holder = (EmptyViewHolder)viewHolder;
//     }
// 
//     private class EmptyViewHolder extends RecyclerView.ViewHolder {
//         public EmptyViewHolder(View view) {
//             super(view);
//         }
//     }
// }


import java.util.ArrayList;
import java.util.List;
import rx.Observable;
import rx.functions.Action1;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
import com.hannesdorfmann.adapterdelegates.AdapterDelegatesManager;
import com.pacoworks.dereference.model.Artist;
import com.pacoworks.dereference.ui.delegates.ArtistDelegate;
import com.pacoworks.dereference.ui.delegates.EmptyDelegate;
/*
 * Copyright (c) pakoito 2015
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.pacoworks.dereference.ui.adapters;





public class ArtistListAdapter extends RecyclerView.Adapter {
    private final List<Artist> elementsMap = new ArrayList<>();

    private final AdapterDelegatesManager<List<Artist>> delegatesManager = new AdapterDelegatesManager<>();

    private final ArtistDelegate artistDelegate;

    public ArtistListAdapter() {
        artistDelegate = new ArtistDelegate();
        delegatesManager.addDelegate(artistDelegate);
// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java
// @ToString
// public class Artist implements Serializable {
//     static final long serialVersionUID = 4653212L;
// 
//     @SerializedName("displayName")
//     private final String displayName;
// 
//     @SerializedName("id")
//     private final String id;
// 
//     @SerializedName("identifier")
//     private final List<Identifier> identifier;
// 
//     @SerializedName("onTourUntil")
//     private final String onTourUntil;
// 
//     @SerializedName("uri")
//     private final String uri;
// 
//     public Artist(String displayName, String id, List<Identifier> identifier, String onTourUntil,
//             String uri) {
//         this.displayName = displayName;
//         this.id = id;
//         this.identifier = identifier;
//         this.onTourUntil = onTourUntil;
//         this.uri = uri;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public List<Identifier> getIdentifier() {
//         return identifier;
//     }
// 
//     public String getOnTourUntil() {
//         return onTourUntil;
//     }
// 
//     public String getUri() {
//         return uri;
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/ui/delegates/ArtistDelegate.java
// public class ArtistDelegate implements AdapterDelegate<List<Artist>> {
//     public static final int TYPE = 48984;
// 
//     SerializedSubject<Artist, Artist> artistClicks = new SerializedSubject<>(
//             PublishSubject.<Artist> create());
// 
//     @Override
//     public int getItemViewType() {
//         return TYPE;
//     }
// 
//     @Override
//     public boolean isForViewType(@NonNull List<Artist> items, int position) {
//         return (0 != position || items.size() != 0);
//     }
// 
//     @NonNull
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent) {
//         return new ArtistViewHolder(LayoutInflater.from(parent.getContext()).inflate(
//                 R.layout.element_artist, parent, false));
//     }
// 
//     @Override
//     public void onBindViewHolder(@NonNull List<Artist> items, int position,
//             @NonNull RecyclerView.ViewHolder holder) {
//         ArtistViewHolder artistViewHolder = (ArtistViewHolder)holder;
//         final Artist artist = items.get(position);
//         artistViewHolder.name.setText(artist.getDisplayName());
//         artistViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 artistClicks.onNext(artist);
//             }
//         });
//     }
// 
//     public Observable<Artist> getArtistClicks() {
//         return artistClicks.asObservable();
//     }
// 
//     static class ArtistViewHolder extends RecyclerView.ViewHolder {
//         @Bind(R.id.artist_name_txv)
//         TextView name;
// 
//         public ArtistViewHolder(View itemView) {
//             super(itemView);
//             ButterKnife.bind(this, itemView);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/ui/delegates/EmptyDelegate.java
// public class EmptyDelegate<T> implements AdapterDelegate<List<T>> {
//     private static final int TYPE = 1916;
// 
//     @Override
//     public int getItemViewType() {
//         return TYPE;
//     }
// 
//     @Override
//     public boolean isForViewType(@NonNull List<T> items, int i) {
//         return i == 0 && items.size() == 0;
//     }
// 
//     @NonNull
//     @Override
//     public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup) {
//         return new EmptyViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(
//                 R.layout.element_empty, viewGroup, false));
//     }
// 
//     @Override
//     public void onBindViewHolder(@NonNull List<T> recordAndReports, int i,
//             @NonNull RecyclerView.ViewHolder viewHolder) {
//         EmptyViewHolder holder = (EmptyViewHolder)viewHolder;
//     }
// 
//     private class EmptyViewHolder extends RecyclerView.ViewHolder {
//         public EmptyViewHolder(View view) {
//             super(view);
//         }
//     }
// }


// Path: app/src/main/java/com/pacoworks/dereference/ui/adapters/ArtistListAdapter.java
import java.util.ArrayList;
import java.util.List;
import rx.Observable;
import rx.functions.Action1;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
import com.hannesdorfmann.adapterdelegates.AdapterDelegatesManager;
import com.pacoworks.dereference.model.Artist;
import com.pacoworks.dereference.ui.delegates.ArtistDelegate;
import com.pacoworks.dereference.ui.delegates.EmptyDelegate;

/*
 * Copyright (c) pakoito 2015
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.pacoworks.dereference.ui.adapters;





public class ArtistListAdapter extends RecyclerView.Adapter {
    private final List<Artist> elementsMap = new ArrayList<>();

    private final AdapterDelegatesManager<List<Artist>> delegatesManager = new AdapterDelegatesManager<>();

    private final ArtistDelegate artistDelegate;

    public ArtistListAdapter() {
        artistDelegate = new ArtistDelegate();
        delegatesManager.addDelegate(artistDelegate);
        delegatesManager.addDelegate(new EmptyDelegate<Artist>());