// Path: autoadapter/src/main/java/com/benny/library/autoadapter/listener/DataSetChangedNotifier.java
// public interface DataSetChangedNotifier {
//     void notifyDataSetChanged();
// }
// 
// Path: autoadapter/src/main/java/com/benny/library/autoadapter/viewcreator/IViewCreator.java
// public interface IViewCreator<T> {
//     View view(ViewGroup container);
//     int viewTypeFor(T data, int position, int itemCount);
//     int viewTypeCount();
// }
// 
// Path: autoadapter/src/main/java/com/benny/library/autoadapter/viewholder/DataGetter.java
// public class DataGetter<T> {
//     final public T previous;
//     final public T next;
//     final public T data;
// 
//     public DataGetter(T previous, T data, T next) {
//         this.previous = previous;
//         this.next = next;
//         this.data = data;
//     }
// }
// 
// Path: autoadapter/src/main/java/com/benny/library/autoadapter/viewholder/IViewHolder.java
// public interface IViewHolder<T> {
//     void bind(View view);
//     void onDataChange(DataGetter<T> getter, int position);
// }


import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import com.benny.library.autoadapter.listener.DataSetChangedNotifier;
import com.benny.library.autoadapter.viewcreator.IViewCreator;
import com.benny.library.autoadapter.viewholder.DataGetter;
import com.benny.library.autoadapter.viewholder.IViewHolder;
import java.util.List;
package com.benny.library.autoadapter;




/**
 * Created by benny on 2/26/16.
 */

public class AutoListAdapter<T> extends BaseAdapter {
    private AdapterView.OnItemClickListener itemClickListener;
    private AdapterView.OnItemLongClickListener itemLongClickListener;

    private IViewCreator<T> viewCreator;
    protected IAdapterItemAccessor<T> itemAccessor;

    public AutoListAdapter(IAdapterItemAccessor<T> itemAccessor, IViewCreator<T> viewCreator) {
        this.viewCreator = viewCreator;
        this.itemAccessor = itemAccessor;
        itemAccessor.setDataSetChangedNotifier(new DataSetChangedNotifier() {
            @Override
            public void notifyDataSetChanged() {
                AutoListAdapter.this.notifyDataSetChanged();
            }
        });
    }

// Path: autoadapter/src/main/java/com/benny/library/autoadapter/listener/DataSetChangedNotifier.java
// public interface DataSetChangedNotifier {
//     void notifyDataSetChanged();
// }
// 
// Path: autoadapter/src/main/java/com/benny/library/autoadapter/viewcreator/IViewCreator.java
// public interface IViewCreator<T> {
//     View view(ViewGroup container);
//     int viewTypeFor(T data, int position, int itemCount);
//     int viewTypeCount();
// }
// 
// Path: autoadapter/src/main/java/com/benny/library/autoadapter/viewholder/DataGetter.java
// public class DataGetter<T> {
//     final public T previous;
//     final public T next;
//     final public T data;
// 
//     public DataGetter(T previous, T data, T next) {
//         this.previous = previous;
//         this.next = next;
//         this.data = data;
//     }
// }
// 
// Path: autoadapter/src/main/java/com/benny/library/autoadapter/viewholder/IViewHolder.java
// public interface IViewHolder<T> {
//     void bind(View view);
//     void onDataChange(DataGetter<T> getter, int position);
// }


// Path: autoadapter/src/main/java/com/benny/library/autoadapter/AutoListAdapter.java
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import com.benny.library.autoadapter.listener.DataSetChangedNotifier;
import com.benny.library.autoadapter.viewcreator.IViewCreator;
import com.benny.library.autoadapter.viewholder.DataGetter;
import com.benny.library.autoadapter.viewholder.IViewHolder;
import java.util.List;

package com.benny.library.autoadapter;




/**
 * Created by benny on 2/26/16.
 */

public class AutoListAdapter<T> extends BaseAdapter {
    private AdapterView.OnItemClickListener itemClickListener;
    private AdapterView.OnItemLongClickListener itemLongClickListener;

    private IViewCreator<T> viewCreator;
    protected IAdapterItemAccessor<T> itemAccessor;

    public AutoListAdapter(IAdapterItemAccessor<T> itemAccessor, IViewCreator<T> viewCreator) {
        this.viewCreator = viewCreator;
        this.itemAccessor = itemAccessor;
        itemAccessor.setDataSetChangedNotifier(new DataSetChangedNotifier() {
            @Override
            public void notifyDataSetChanged() {
                AutoListAdapter.this.notifyDataSetChanged();
            }
        });
    }

    public AutoListAdapter(List<T> items, IViewCreator<T> viewCreator) {