package com.symbol.elearningapp.Utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.widget.Toast;
import com.symbol.elearningapp.R;


public class AppPreference {
    private SharedPreferences sharedPreferences;
    private SharedPreferences.Editor editor;
    private Context context;

    public AppPreference(Context context){
        this.context = context;
        sharedPreferences = context.getSharedPreferences(String.valueOf(R.string.s_pref_file), Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
    }

    public void showToast(String message){
        Toast.makeText(context, message, Toast.LENGTH_LONG).show();
    }

    public void settype(String name){
        editor.putString(String.valueOf(R.string.s_pref_type), name);
        editor.commit();
    }

    public String gettype(){
        return sharedPreferences.getString(String.valueOf(R.string.s_pref_type), "user");
    }

}