// Path: library/src/main/java/net/derohimat/baseapp/ui/adapter/viewholder/BaseListViewHolder.java
// public abstract class BaseListViewHolder<Data> {
//     protected Context mContext;
// 
//     public BaseListViewHolder(View itemView) {
//         ButterKnife.bind(this, itemView);
//         Timber.tag(getClass().getSimpleName());
//     }
// 
//     public abstract void bind(Data data);
// }


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import net.derohimat.baseapp.ui.adapter.viewholder.BaseListViewHolder;
import java.util.ArrayList;
import java.util.List;
import timber.log.Timber;
    @Override
    public View getView(int position, View itemView, ViewGroup parent) {
        Holder holder;
        if (itemView == null) {
            itemView = LayoutInflater.from(mContext).inflate(getItemView(), parent, false);
            holder = onCreateViewHolder(itemView);
            itemView.setTag(holder);
        } else {
            holder = (Holder) itemView.getTag();
        }

        holder.bind(mDatas.get(position));

        return itemView;
    }

    protected abstract int getItemView();

    public abstract Holder onCreateViewHolder(View itemView);

    public List<Data> getDatas() {
        return mDatas;
    }

    public void add(Data item) {
        mDatas.add(item);
        notifyDataSetChanged();
    }

    public void add(Data item, int position) {
// Path: library/src/main/java/net/derohimat/baseapp/ui/adapter/viewholder/BaseListViewHolder.java
// public abstract class BaseListViewHolder<Data> {
//     protected Context mContext;
// 
//     public BaseListViewHolder(View itemView) {
//         ButterKnife.bind(this, itemView);
//         Timber.tag(getClass().getSimpleName());
//     }
// 
//     public abstract void bind(Data data);
// }


// Path: library/src/main/java/net/derohimat/baseapp/ui/adapter/BaseListAdapter.java
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import net.derohimat.baseapp.ui.adapter.viewholder.BaseListViewHolder;
import java.util.ArrayList;
import java.util.List;
import timber.log.Timber;

    @Override
    public View getView(int position, View itemView, ViewGroup parent) {
        Holder holder;
        if (itemView == null) {
            itemView = LayoutInflater.from(mContext).inflate(getItemView(), parent, false);
            holder = onCreateViewHolder(itemView);
            itemView.setTag(holder);
        } else {
            holder = (Holder) itemView.getTag();
        }

        holder.bind(mDatas.get(position));

        return itemView;
    }

    protected abstract int getItemView();

    public abstract Holder onCreateViewHolder(View itemView);

    public List<Data> getDatas() {
        return mDatas;
    }

    public void add(Data item) {
        mDatas.add(item);
        notifyDataSetChanged();
    }

    public void add(Data item, int position) {
        mDatas.add(position, item);