package de.jg_cody.Teraplex.ui.rooms;

import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class ViewHolderDoubleButton implements IViewHolder{
    String commandL;
    String commandR;
    Button bLeft, bRight;

    public ViewHolderDoubleButton(Button bLeft, Button bRight, String commandL, String commandR) {
        this.bLeft = bLeft;
        this.bRight = bRight;
        this.commandL = commandL;
        this.commandR = commandR;

        bLeft.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(bLeft.getContext(),commandL + " ON",Toast.LENGTH_SHORT).show();
            }
        });
        bRight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(bRight.getContext(),commandR + " OFF",Toast.LENGTH_SHORT).show();
            }
        });


    }
    @Override
    public String getCommand() {
        return commandL;
    }
    public Button getbLeft() {
        return bLeft;
    }
    public Button getbRight(){return bRight;}
    @Override
    public View[] getViews()
    {
        return new View[]{getbLeft(),getbRight()};


    }
}
