package com.example.sae41_2025;

import android.graphics.Color;
import android.widget.CompoundButton;
import android.widget.RelativeLayout;

public class SwitchDifficulteeListener implements CompoundButton.OnCheckedChangeListener {

    private MainActivity activity;

    public SwitchDifficulteeListener(MainActivity activity) {
        this.activity = activity;
    }

    @Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        this.activity.setDifficulte(isChecked);

        if (isChecked) {
            this.activity.getMenuLayout().setBackgroundColor(Color.parseColor("#fff43c3c"));
        } else {
            this.activity.getMenuLayout().setBackgroundColor(Color.parseColor("#fffffbfb"));
        }
    }
}
