@@ -0,0 +1,3139 @@
+package com.example.ismailamrani.comptable.adapters;%0A%0Aimport android.content.Context;%0Aimport android.support.v7.widget.RecyclerView;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.TextView;%0A%0Aimport com.example.ismailamrani.comptable.R;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Created by Mohammed Aouf ZOUAG on 30/04/2016.%0A */%0Apublic class SearchAdapter extends RecyclerView.Adapter%3CSearchAdapter.ViewHolder%3E %7B%0A%0A    private Context mContext;%0A    private List%3CString%3E mItems;%0A%0A    public SearchAdapter(Context context, List%3CString%3E items) %7B%0A        mContext = context;%0A        mItems = new ArrayList%3C%3E(items);%0A    %7D%0A%0A    @Override%0A    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) %7B%0A        View v = LayoutInflater.from(viewGroup.getContext())%0A                .inflate(R.layout.order_row, viewGroup, false);%0A%0A        return new ViewHolder(mContext, v);%0A    %7D%0A%0A    @Override%0A    public void onBindViewHolder(ViewHolder holder, int position) %7B%0A        String item = mItems.get(position);%0A        holder.bind(item);%0A    %7D%0A%0A    @Override%0A    public int getItemCount() %7B%0A        return mItems.size();%0A    %7D%0A%0A    public String removeItem(int position) %7B%0A        final String item = mItems.remove(position);%0A        notifyItemRemoved(position);%0A        return item;%0A    %7D%0A%0A    public void addItem(int position, String item) %7B%0A        mItems.add(position, item);%0A        notifyItemInserted(position);%0A    %7D%0A%0A    public void moveItem(int fromPosition, int toPosition) %7B%0A        final String item = mItems.remove(fromPosition);%0A        mItems.add(toPosition, item);%0A        notifyItemMoved(fromPosition, toPosition);%0A    %7D%0A%0A    public void animateTo(List%3CString%3E items) %7B%0A        applyAndAnimateRemovals(items);%0A        applyAndAnimateAdditions(items);%0A        applyAndAnimateMovedItems(items);%0A    %7D%0A%0A    private void applyAndAnimateRemovals(List%3CString%3E newItems) %7B%0A        for (int i = mItems.size() - 1; i %3E= 0; i--) %7B%0A            final String item = mItems.get(i);%0A            if (!newItems.contains(item))%0A                removeItem(i);%0A        %7D%0A    %7D%0A%0A    private void applyAndAnimateAdditions(List%3CString%3E newItems) %7B%0A        for (int i = 0, count = newItems.size(); i %3C count; i++) %7B%0A            final String item = newItems.get(i);%0A            if (!mItems.contains(item))%0A                addItem(i, item);%0A        %7D%0A    %7D%0A%0A    private void applyAndAnimateMovedItems(List%3CString%3E newItems) %7B%0A        for (int toPosition = newItems.size() - 1; toPosition %3E= 0; toPosition--) %7B%0A            final String item = newItems.get(toPosition);%0A            final int fromPosition = mItems.indexOf(item);%0A%0A            if (fromPosition %3E= 0 && fromPosition != toPosition)%0A                moveItem(fromPosition, toPosition);%0A        %7D%0A    %7D%0A%0A    public class ViewHolder extends RecyclerView.ViewHolder %7B%0A%0A        TextView textLabel;%0A%0A        public ViewHolder(Context context, View v) %7B%0A            super(v);%0A            textLabel = (TextView) v.findViewById(R.id.orderIDLabel);%0A        %7D%0A%0A        public void bind(String item) %7B%0A%0A        %7D%0A    %7D%0A%7D

Create the 'SearchAdapter' class.