// Path: app/src/main/java/com/example/app/rxjava/base/gesture/ItemTouchHelperAdapter.java
// public interface ItemTouchHelperAdapter {
// 
//     /**
//      * Called when an item has been dragged far enough to trigger a move. This is called every time
//      * an item is shifted, and <strong>not</strong> at the end of a "drop" event.<br/>
//      * <br/>
//      * Implementations should call {@link RecyclerView.Adapter#notifyItemMoved(int, int)} after
//      * adjusting the underlying data to reflect this move.
//      *
//      * @param fromPosition The start position of the moved item.
//      * @param toPosition   Then resolved position of the moved item.
//      * @return True if the item was moved to the new adapter position.
//      *
//      * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder)
//      * @see RecyclerView.ViewHolder#getAdapterPosition()
//      */
//     boolean onItemMove(int fromPosition, int toPosition);
// 
// 
//     /**
//      * Called when an item has been dismissed by a swipe.<br/>
//      * <br/>
//      * Implementations should call {@link RecyclerView.Adapter#notifyItemRemoved(int)} after
//      * adjusting the underlying data to reflect this removal.
//      *
//      * @param position The position of the item dismissed.
//      *
//      * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder)
//      * @see RecyclerView.ViewHolder#getAdapterPosition()
//      */
//     void onItemDismiss(int position);
// }
// 
// Path: app/src/main/java/com/example/app/rxjava/base/gesture/ItemTouchHelperViewHolder.java
// public interface ItemTouchHelperViewHolder {
// 
//     /**
//      * Called when the {@link ItemTouchHelper} first registers an item as being moved or swiped.
//      * Implementations should update the item view to indicate it's active state.
//      */
//     void onItemSelected();
// 
// 
//     /**
//      * Called when the {@link ItemTouchHelper} has completed the move or swipe, and the active item
//      * state should be cleared.
//      */
//     void onItemClear();
// }


import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.app.rxjava.R;
import com.example.app.rxjava.base.gesture.ItemTouchHelperAdapter;
import com.example.app.rxjava.base.gesture.ItemTouchHelperViewHolder;
import java.util.Collections;
import java.util.List;
        mValues = items;
        mListener = listener;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == TYPE_ITEM1) {
            View view = LayoutInflater.from(parent.getContext()).inflate(
                    R.layout.empty, null);
            return new EmptyViewHolder(view);
        } else if (viewType == TYPE_ITEM0) {
            return createViewHolder(parent);
        }
        return null;
    }

    @Override
    public boolean onItemMove(int fromPosition, int toPosition) {
        Collections.swap(mValues, fromPosition, toPosition);
        notifyItemMoved(fromPosition, toPosition);
        return true;
    }

    @Override
    public void onItemDismiss(int position) {
        mValues.remove(position);
        notifyItemRemoved(position);
    }

    @Override
// Path: app/src/main/java/com/example/app/rxjava/base/gesture/ItemTouchHelperAdapter.java
// public interface ItemTouchHelperAdapter {
// 
//     /**
//      * Called when an item has been dragged far enough to trigger a move. This is called every time
//      * an item is shifted, and <strong>not</strong> at the end of a "drop" event.<br/>
//      * <br/>
//      * Implementations should call {@link RecyclerView.Adapter#notifyItemMoved(int, int)} after
//      * adjusting the underlying data to reflect this move.
//      *
//      * @param fromPosition The start position of the moved item.
//      * @param toPosition   Then resolved position of the moved item.
//      * @return True if the item was moved to the new adapter position.
//      *
//      * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder)
//      * @see RecyclerView.ViewHolder#getAdapterPosition()
//      */
//     boolean onItemMove(int fromPosition, int toPosition);
// 
// 
//     /**
//      * Called when an item has been dismissed by a swipe.<br/>
//      * <br/>
//      * Implementations should call {@link RecyclerView.Adapter#notifyItemRemoved(int)} after
//      * adjusting the underlying data to reflect this removal.
//      *
//      * @param position The position of the item dismissed.
//      *
//      * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder)
//      * @see RecyclerView.ViewHolder#getAdapterPosition()
//      */
//     void onItemDismiss(int position);
// }
// 
// Path: app/src/main/java/com/example/app/rxjava/base/gesture/ItemTouchHelperViewHolder.java
// public interface ItemTouchHelperViewHolder {
// 
//     /**
//      * Called when the {@link ItemTouchHelper} first registers an item as being moved or swiped.
//      * Implementations should update the item view to indicate it's active state.
//      */
//     void onItemSelected();
// 
// 
//     /**
//      * Called when the {@link ItemTouchHelper} has completed the move or swipe, and the active item
//      * state should be cleared.
//      */
//     void onItemClear();
// }


// Path: app/src/main/java/com/example/app/rxjava/base/BaseListAdapter.java
import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.app.rxjava.R;
import com.example.app.rxjava.base.gesture.ItemTouchHelperAdapter;
import com.example.app.rxjava.base.gesture.ItemTouchHelperViewHolder;
import java.util.Collections;
import java.util.List;

        mValues = items;
        mListener = listener;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == TYPE_ITEM1) {
            View view = LayoutInflater.from(parent.getContext()).inflate(
                    R.layout.empty, null);
            return new EmptyViewHolder(view);
        } else if (viewType == TYPE_ITEM0) {
            return createViewHolder(parent);
        }
        return null;
    }

    @Override
    public boolean onItemMove(int fromPosition, int toPosition) {
        Collections.swap(mValues, fromPosition, toPosition);
        notifyItemMoved(fromPosition, toPosition);
        return true;
    }

    @Override
    public void onItemDismiss(int position) {
        mValues.remove(position);
        notifyItemRemoved(position);
    }

    @Override
    public int getItemCount() {