package com.bullhead.equalizer;

import android.content.Context;
import android.content.SharedPreferences;

public class SharePreferenceUtilEqualizer {

    public static final String PREFERENCE_NAME = "PREFERENCE_DATA";
    private final SharedPreferences sharedpreferences;
    private SharedPreferences.Editor editor;

    public SharePreferenceUtilEqualizer(Context context) {
        sharedpreferences = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
        editor = sharedpreferences.edit();
    }

    public void saveBoolean(String key, boolean value) {
        editor.putBoolean(key, value);
        editor.apply();
    }

    public boolean getBoolean(String key, boolean defaultvalue) {
        defaultvalue = true;
        return  sharedpreferences.getBoolean(key, defaultvalue);
    }

}
