// Path: app/src/main/java/com/wecan/xhin/studio/bean/Simple.java
// public class Simple {
//     public String title;
//     public String content;
// 
//     public Simple(String title, String content) {
//         this.title = title;
//         this.content = content;
//     }
// 
// }
// 
// Path: app/src/main/java/com/wecan/xhin/studio/reactivex/BindingRecyclerView.java
// public class BindingRecyclerView {
// 
//     public static abstract class ListAdapter<T, VH extends ViewHolder> extends RecyclerView.Adapter<VH> {
// 
//         protected final LayoutInflater inflater;
//         protected final ObservableList<T> data;
// 
//         private final AtomicInteger refs = new AtomicInteger();
// 
//         private final ObservableList.OnListChangedCallback<ObservableList<T>> callback =
//                 new ObservableList.OnListChangedCallback<ObservableList<T>>() {
//                     @Override
//                     public void onChanged(ObservableList<T> sender) {
//                         notifyDataSetChanged();
//                     }
// 
//                     @Override
//                     public void onItemRangeChanged(ObservableList<T> sender,
//                                                    int positionStart, int itemCount) {
//                         notifyItemRangeChanged(positionStart, itemCount);
//                     }
// 
//                     @Override
//                     public void onItemRangeInserted(ObservableList<T> sender,
//                                                     int positionStart, int itemCount) {
//                         notifyItemRangeInserted(positionStart, itemCount);
//                     }
// 
//                     @Override
//                     public void onItemRangeMoved(ObservableList<T> sender,
//                                                  int fromPosition, int toPosition, int itemCount) {
//                         for (int i = 0; i < itemCount; i++) {
//                             notifyItemMoved(fromPosition + i, toPosition + i);
//                         }
//                     }
// 
//                     @Override
//                     public void onItemRangeRemoved(ObservableList<T> sender,
//                                                    int positionStart, int itemCount) {
//                         notifyItemRangeRemoved(positionStart, itemCount);
//                     }
//                 };
// 
//         public ListAdapter(Context context, ObservableList<T> data) {
//             this.inflater = LayoutInflater.from(context);
//             this.data = data;
//         }
// 
//         @Override
//         public int getItemCount() {
//             return data.size();
//         }
// 
//         @Override
//         public void onAttachedToRecyclerView(RecyclerView recyclerView) {
//             if (refs.getAndIncrement() == 0) {
//                 data.addOnListChangedCallback(callback);
//             }
//         }
// 
//         @Override
//         public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
//             if (refs.decrementAndGet() == 0) {
//                 data.removeOnListChangedCallback(callback);
//             }
//         }
// 
//     }
// 
//     public static class ViewHolder<V extends ViewDataBinding> extends RecyclerView.ViewHolder {
// 
//         public final V binding;
// 
//         public ViewHolder(LayoutInflater inflater, @LayoutRes int layoutId, ViewGroup parent) {
//             this(DataBindingUtil.<V>inflate(inflater, layoutId, parent, false));
//         }
// 
//         public ViewHolder(V binding) {
//             super(binding.getRoot());
//             this.binding = binding;
//         }
// 
//     }
// 
// }


import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.jakewharton.rxbinding.view.RxView;
import com.jakewharton.rxbinding.view.ViewClickEvent;
import com.wecan.xhin.studio.bean.Simple;
import com.wecan.xhin.studio.databinding.RecyclerItemSimpleBinding;
import com.wecan.xhin.studio.reactivex.BindingRecyclerView;
import java.util.List;
import rx.functions.Action1;
package com.wecan.xhin.studio.adapter;





/**
 * Created by xhinliang on 15-11-23.
 * xhinliang@gmail.com
 */
public class SimpleAdapter extends RecyclerView.Adapter<BindingRecyclerView.ViewHolder> {
    private List<Simple> libraries;
    private LayoutInflater inflater;
    private Listener listener;

// Path: app/src/main/java/com/wecan/xhin/studio/bean/Simple.java
// public class Simple {
//     public String title;
//     public String content;
// 
//     public Simple(String title, String content) {
//         this.title = title;
//         this.content = content;
//     }
// 
// }
// 
// Path: app/src/main/java/com/wecan/xhin/studio/reactivex/BindingRecyclerView.java
// public class BindingRecyclerView {
// 
//     public static abstract class ListAdapter<T, VH extends ViewHolder> extends RecyclerView.Adapter<VH> {
// 
//         protected final LayoutInflater inflater;
//         protected final ObservableList<T> data;
// 
//         private final AtomicInteger refs = new AtomicInteger();
// 
//         private final ObservableList.OnListChangedCallback<ObservableList<T>> callback =
//                 new ObservableList.OnListChangedCallback<ObservableList<T>>() {
//                     @Override
//                     public void onChanged(ObservableList<T> sender) {
//                         notifyDataSetChanged();
//                     }
// 
//                     @Override
//                     public void onItemRangeChanged(ObservableList<T> sender,
//                                                    int positionStart, int itemCount) {
//                         notifyItemRangeChanged(positionStart, itemCount);
//                     }
// 
//                     @Override
//                     public void onItemRangeInserted(ObservableList<T> sender,
//                                                     int positionStart, int itemCount) {
//                         notifyItemRangeInserted(positionStart, itemCount);
//                     }
// 
//                     @Override
//                     public void onItemRangeMoved(ObservableList<T> sender,
//                                                  int fromPosition, int toPosition, int itemCount) {
//                         for (int i = 0; i < itemCount; i++) {
//                             notifyItemMoved(fromPosition + i, toPosition + i);
//                         }
//                     }
// 
//                     @Override
//                     public void onItemRangeRemoved(ObservableList<T> sender,
//                                                    int positionStart, int itemCount) {
//                         notifyItemRangeRemoved(positionStart, itemCount);
//                     }
//                 };
// 
//         public ListAdapter(Context context, ObservableList<T> data) {
//             this.inflater = LayoutInflater.from(context);
//             this.data = data;
//         }
// 
//         @Override
//         public int getItemCount() {
//             return data.size();
//         }
// 
//         @Override
//         public void onAttachedToRecyclerView(RecyclerView recyclerView) {
//             if (refs.getAndIncrement() == 0) {
//                 data.addOnListChangedCallback(callback);
//             }
//         }
// 
//         @Override
//         public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
//             if (refs.decrementAndGet() == 0) {
//                 data.removeOnListChangedCallback(callback);
//             }
//         }
// 
//     }
// 
//     public static class ViewHolder<V extends ViewDataBinding> extends RecyclerView.ViewHolder {
// 
//         public final V binding;
// 
//         public ViewHolder(LayoutInflater inflater, @LayoutRes int layoutId, ViewGroup parent) {
//             this(DataBindingUtil.<V>inflate(inflater, layoutId, parent, false));
//         }
// 
//         public ViewHolder(V binding) {
//             super(binding.getRoot());
//             this.binding = binding;
//         }
// 
//     }
// 
// }


// Path: app/src/main/java/com/wecan/xhin/studio/adapter/SimpleAdapter.java
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.jakewharton.rxbinding.view.RxView;
import com.jakewharton.rxbinding.view.ViewClickEvent;
import com.wecan.xhin.studio.bean.Simple;
import com.wecan.xhin.studio.databinding.RecyclerItemSimpleBinding;
import com.wecan.xhin.studio.reactivex.BindingRecyclerView;
import java.util.List;
import rx.functions.Action1;

package com.wecan.xhin.studio.adapter;





/**
 * Created by xhinliang on 15-11-23.
 * xhinliang@gmail.com
 */
public class SimpleAdapter extends RecyclerView.Adapter<BindingRecyclerView.ViewHolder> {
    private List<Simple> libraries;
    private LayoutInflater inflater;
    private Listener listener;

    public SimpleAdapter(List<Simple> list, LayoutInflater inflater, Listener listener) {