package com.example.mynotepad;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

import com.example.mynotepad.MenuFeatures.Utils;

public class SharedPreferencesClass {
    private SharedPreferences sharedPreferences;
    private SharedPreferences.Editor editor;


    public void changeTheTheme( Activity activity) {
        sharedPreferences = activity.getPreferences(Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
        editor.putString(activity.getString(R.string.saved_high_score_key), Utils.sTheme).apply();
    }

    public void getThemeOnMainActivityCreate(Activity activity){
        SharedPreferences sharedPref = activity.getPreferences(Context.MODE_PRIVATE);
         Utils.sTheme = sharedPref.getString( activity.getString(R.string.saved_high_score_key) , "bright");
    }

}
