Gonna do some background so you can picture better what I need to accomplish.

Well the thing is, I'm reading data from a DataBase, this data changes relatively fast, let's say every 30 seconds, I need to scroll the recycler to check the new data and press some buttons, every time I press the button, it changes its color, but 2 things are happening. 

1- I refresh the recycler with a timer every second so, when I'm scrolling it and the refresh comes, it will go all the way to the first item and that can't happen, so I need a way to prevent this.

2- every data that comes from the Database needs some adjustment and for that, I press a button, this button changes it´s color when I press it so I know the action for that button is done but, everytime the timer refreshes the recycler it not only goes to the first item but also turns the buttons to the original color because is re-creating the entire recycler with the data in the database, and that Can Not Happen, when the timer refreshes the recycler, the old items should remain the same and only add the NEW IF there's any new.

well here's my code for the adapter and for the Activity, thanks in advance for the help.

Here's the Adapter

```
    public class ComandaAdapter extends
    RecyclerView.Adapter<ComandaAdapter.ComandaAdapterViewHolder>
    implements View.OnClickListener{

private ArrayList<Comanda> list_comandas;
private Context context;
private View.OnClickListener listener;

public ComandaAdapter(Context con, ArrayList<Comanda> list) {
    this.context = con;
    this.list_comandas = list;
}

@Override
public ComandaAdapterViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

    View itemView = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.row, parent, false);

    return new ComandaAdapterViewHolder(itemView);
}

@Override
public void onBindViewHolder(ComandaAdapterViewHolder holder, int position) {

    Integer anchomanda = Math.round(context.getResources().getDimension(R.dimen.parents_size));

    // Llenar la información de cada item

    Comanda comanda = list_comandas.get(position);

    comanda.setNro_comanda(position+"");

    String cadena = comanda.getOrden();
    Integer tope = cadena.length();

    Boolean tijera_categoria=false;

    Boolean tijera_articulo=true;
    Boolean tijera_contorno=true;
    Boolean tijera_cambio =true;

    Integer indisup;
    Integer indiin =0;
    char apuntador;
    String Buscado ="";
    String Buscado_contorno="";
    String Buscado_categoria="";
    Integer id=0;

        holder.txt_comanda.setText(position+"");

        holder.txt_mesa.setText(comanda.getMesa());

        for (int i = 0; i < tope ; i++) {

            apuntador = cadena.charAt(i);

            if (Buscado.equals("Bebidas")){
                break;
            }
            else
            {
                if (apuntador == '$')
                {
                    break;
                }
                else
                {
                    //CUERPO PRINCIPAL DE EJECUCION

                    if (apuntador == '#' && !tijera_categoria)
                    {
                        if (i==0) {
                            indiin = i + 1;
                        }

                    }

                    if (apuntador == '!' && !tijera_categoria)
                    {
                        tijera_categoria=true;
                        tijera_articulo=false;
                        indisup=i;

                        id=i;

                        Buscado=cadena.substring(indiin,indisup);
                        indiin=indisup+1;

                        Buscado_categoria=Buscado;

                        holder.b[id].setId(id);

                    }

                    if (apuntador == '%' && !tijera_articulo)
                    {
                        indisup=i;
                        tijera_articulo=true;
                        tijera_contorno=false;

                        Buscado=cadena.substring(indiin,indisup);

                        indiin=indisup+1;

                        holder.b[id].setLayoutParams(new LinearLayout.LayoutParams(anchomanda, LinearLayout.LayoutParams.WRAP_CONTENT));
                        holder.b[id].setTextSize((context.getResources().getDimension(R.dimen.txt_size)) / 2);
                        if (Buscado_categoria.equals("Fondos")) {
                            holder.b[id].setBackgroundTintList(context.getResources().getColorStateList(R.color.fondos, null));
                        }
                        if (Buscado_categoria.equals("Entradas")) {
                            holder.b[id].setBackgroundTintList(context.getResources().getColorStateList(R.color.entradas, null));
                        }
                        if (Buscado_categoria.equals("Postres")) {
                            holder.b[id].setBackgroundTintList(context.getResources().getColorStateList(R.color.postres, null));
                        }
                        holder.b[id].setText(Buscado);
                        holder.lyocomanda.addView(holder.b[id]);

                    }

                    if (apuntador == '*' && !tijera_contorno)
                    {
                        indisup=i;
                        tijera_cambio=false;

                        Buscado=cadena.substring(indiin,indisup);
                        indiin=indisup+1;

                        if (!Buscado.equals("")) {
                            Buscado_contorno=Buscado;
                            holder.t[i].setText(Buscado);
                            holder.t[i].setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
                            holder.t[i].setTextSize((context.getResources().getDimension(R.dimen.txt_size)) / 2);
                            holder.l[id].addView(holder.t[i]);
                        }

                    }

                    if (apuntador == '#' && !tijera_cambio)
                    {
                        indisup=i;
                        tijera_contorno=true;
                        tijera_cambio=true;
                        tijera_categoria=false;

                        Buscado=cadena.substring(indiin,indisup);
                        indiin=indisup+1;

                        if (!Buscado_contorno.equals("")) {
                            holder.l[id].setLayoutParams(new LinearLayout.LayoutParams(anchomanda, ViewGroup.LayoutParams.WRAP_CONTENT));
                            holder.l[id].setOrientation(LinearLayout.VERTICAL);
                            holder.l[id].setBackground(context.getDrawable(customborder));
                            holder.lyocomanda.addView(holder.l[id]);
                        }

                    }

                    //FIN CUERPO PRINCIPAL DE EJECUCION

                } //EJECUCION DE DESCARTE DE FINAL DE CADENA
            } //EJECUCION DE DESCARTE DE BEBIDAS

        }

}

@Override
public int getItemCount() {

    return list_comandas.size();
}

public void removeItem(int position) {
    list_comandas.remove(position);
    notifyItemRemoved(position);
}

@Override
public void onClick(View view) {
    if (listener != null)
    {
        listener.onClick(view);
    }
}

public void setOnClickListener(View.OnClickListener listener)
{
    this.listener = listener;
}

public class ComandaAdapterViewHolder extends RecyclerView.ViewHolder {

    TextView txt_comanda, txt_mesa;
    private LinearLayout lyocomanda;

    private Integer cant_platos =500;

    private TextView[] t = new TextView[(cant_platos*8)];
    private LinearLayout[] l = new LinearLayout[cant_platos];
    private Button[] b = new Button[cant_platos];

    public ComandaAdapterViewHolder(View itemView) {
        super(itemView);

        // Inicializamos los controles
        lyocomanda = (LinearLayout) itemView.findViewById(R.id.lyocomanda);

        txt_comanda = (TextView) itemView.findViewById(R.id.txt_comanda);

        txt_mesa = (TextView) itemView.findViewById(R.id.txt_mesa);

            for (int i = 0; i <cant_platos; i++) {

                /////////////////////////////CONFIGURACION DEL BOTON///////////////////////////

                b[i] = new Button(itemView.getContext());
                b[i].setOnClickListener(listener);

                ///////////////////////////CONFIGURACION DEL CONTORNO///////////////////////////

                l[i] = new LinearLayout(itemView.getContext());
                t[i] = new TextView(itemView.getContext());

            }

          }
       }

      }

```

Here´s the Activity

```
public class MainActivity extends AppCompatActivity {

private ComandaAdapter mComandaAdapter;
ArrayList<Comanda> lista_Comanda;
RecyclerView rec_Lista;

public int counter = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    rec_Lista = (RecyclerView) findViewById(R.id.rec_lista);

    new CountDownTimer(10000, 100){

        @Override
        public void onTick(long millisUntilFinished) {

            counter++;

        }

        @Override
        public void onFinish() {
            try{
               loadRetrofitComanda();
                counter = 0;
                start();
            }
            catch (Exception e){
                mostrarMensaje("Error: " + e.getMessage());
            }

        }
    }.start();

}

@Override
protected void onResume() {
    super.onResume();

    loadRetrofitComanda();

}

private void loadRetrofitComanda()
{
    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl("http://192.168.0.20:3000")
            .addConverterFactory(GsonConverterFactory.create())
            .build();

    IRequestComanda request = retrofit.create(IRequestComanda.class);

    Call<ArrayList<Comanda>> call = request.getJSONComandas();

    call.enqueue(new Callback<ArrayList<Comanda>>() {
        @Override
        public void onResponse(Call<ArrayList<Comanda>> call, Response<ArrayList<Comanda>> response) {

            ArrayList<Comanda> lista = response.body();

            lista_Comanda = lista;

            // Refresh recyclerview
           setAdapter();
            configurarOrientacionLayout();
        }

        @Override
        public void onFailure(Call<ArrayList<Comanda>> call, Throwable t) {

            mostrarMensaje("Error: " + t.getMessage());
        }
    });
}

private void mostrarMensaje(String mensaje)
{
    Toast.makeText(getApplicationContext(), mensaje, Toast.LENGTH_SHORT).show();
}

private void setAdapter()
{
    mComandaAdapter = new ComandaAdapter(getApplicationContext(), lista_Comanda);

    mComandaAdapter.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            mostrarMensaje("ejecutar accion");
        }
    });

    rec_Lista.setAdapter(mComandaAdapter);

}

private void configurarOrientacionLayout()
{
    rec_Lista.setLayoutManager(new       L   LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false));
     }
  }

```