// Path: recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerView.java
// public static class ItemViewHolder extends RecyclerView.ViewHolder {
// 
//     public ItemViewHolder(final View itemView) {
//         super(itemView);
//     }
// 
//     public void bind(final int position) {
// 
//     }
// }
// 
// Path: recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerView.java
// public interface ViewHolderCreator<VH extends ViewHolder> {
// 
//     VH create(final ViewGroup parent);
// 
//     void bind(final VH holder, final int position);
// }
// 
// Path: recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerView.java
// public static class SimpleViewHolderCreator implements ViewHolderCreator<ItemViewHolder> {
//     @LayoutRes
//     private int layoutRes;
// 
//     public SimpleViewHolderCreator(@LayoutRes final int layoutRes) {
//         this.layoutRes = layoutRes;
//     }
// 
//     @Override
//     public ItemViewHolder create(final ViewGroup parent) {
//         LayoutInflater inflater = LayoutInflater.from(parent.getContext());
//         View view = inflater.inflate(layoutRes, parent, false);
//         return new ItemViewHolder(view);
//     }
// 
//     @Override
//     public void bind(final ItemViewHolder holder, final int position) {
//         holder.bind(position);
//     }
// }


import android.os.Handler;
import android.util.Log;
import android.view.ViewGroup;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver;
import com.mcxiaoke.next.recycler.AdvancedRecyclerView.ItemViewHolder;
import com.mcxiaoke.next.recycler.AdvancedRecyclerView.ViewHolderCreator;
import com.mcxiaoke.next.recycler.AdvancedRecyclerView.SimpleViewHolderCreator;
import java.util.ArrayList;
import java.util.List;

        @Override
        public void onItemRangeMoved(final int fromPosition, final int toPosition, final int itemCount) {
            super.onItemRangeMoved(fromPosition, toPosition, itemCount);
            Log.v(TAG, "onItemRangeMoved() start=" + fromPosition + " count=" + itemCount);
            notifyItemRangeChanged(fromPosition, itemCount);
        }

        @Override
        public void onItemRangeInserted(final int positionStart, final int itemCount) {
            super.onItemRangeInserted(positionStart, itemCount);
            Log.v(TAG, "onItemRangeInserted() start=" + positionStart + " count=" + itemCount);
            notifyItemRangeInserted(positionStart, itemCount);
        }

        @Override
        public void onItemRangeChanged(final int positionStart, final int itemCount) {
            super.onItemRangeChanged(positionStart, itemCount);
            Log.v(TAG, "onItemRangeChanged() start=" + positionStart + " count=" + itemCount);
            notifyItemRangeChanged(positionStart, itemCount);
        }

        @Override
        public void onChanged() {
            super.onChanged();
            notifyDataSetChanged();
        }
    };

    private ViewHolderCreator<ItemViewHolder> mHeaderCreator =
// Path: recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerView.java
// public static class ItemViewHolder extends RecyclerView.ViewHolder {
// 
//     public ItemViewHolder(final View itemView) {
//         super(itemView);
//     }
// 
//     public void bind(final int position) {
// 
//     }
// }
// 
// Path: recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerView.java
// public interface ViewHolderCreator<VH extends ViewHolder> {
// 
//     VH create(final ViewGroup parent);
// 
//     void bind(final VH holder, final int position);
// }
// 
// Path: recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerView.java
// public static class SimpleViewHolderCreator implements ViewHolderCreator<ItemViewHolder> {
//     @LayoutRes
//     private int layoutRes;
// 
//     public SimpleViewHolderCreator(@LayoutRes final int layoutRes) {
//         this.layoutRes = layoutRes;
//     }
// 
//     @Override
//     public ItemViewHolder create(final ViewGroup parent) {
//         LayoutInflater inflater = LayoutInflater.from(parent.getContext());
//         View view = inflater.inflate(layoutRes, parent, false);
//         return new ItemViewHolder(view);
//     }
// 
//     @Override
//     public void bind(final ItemViewHolder holder, final int position) {
//         holder.bind(position);
//     }
// }


// Path: recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerAdapter.java
import android.os.Handler;
import android.util.Log;
import android.view.ViewGroup;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver;
import com.mcxiaoke.next.recycler.AdvancedRecyclerView.ItemViewHolder;
import com.mcxiaoke.next.recycler.AdvancedRecyclerView.ViewHolderCreator;
import com.mcxiaoke.next.recycler.AdvancedRecyclerView.SimpleViewHolderCreator;
import java.util.ArrayList;
import java.util.List;


        @Override
        public void onItemRangeMoved(final int fromPosition, final int toPosition, final int itemCount) {
            super.onItemRangeMoved(fromPosition, toPosition, itemCount);
            Log.v(TAG, "onItemRangeMoved() start=" + fromPosition + " count=" + itemCount);
            notifyItemRangeChanged(fromPosition, itemCount);
        }

        @Override
        public void onItemRangeInserted(final int positionStart, final int itemCount) {
            super.onItemRangeInserted(positionStart, itemCount);
            Log.v(TAG, "onItemRangeInserted() start=" + positionStart + " count=" + itemCount);
            notifyItemRangeInserted(positionStart, itemCount);
        }

        @Override
        public void onItemRangeChanged(final int positionStart, final int itemCount) {
            super.onItemRangeChanged(positionStart, itemCount);
            Log.v(TAG, "onItemRangeChanged() start=" + positionStart + " count=" + itemCount);
            notifyItemRangeChanged(positionStart, itemCount);
        }

        @Override
        public void onChanged() {
            super.onChanged();
            notifyDataSetChanged();
        }
    };

    private ViewHolderCreator<ItemViewHolder> mHeaderCreator =
            new SimpleViewHolderCreator(DEFAULT_LOADING_HEADER_LAYOUT);