package com.jishisongfu.duobibi.util

import android.content.Context

object PrivacyPrefs {

    private const val PREFS = "privacy_prefs"
    private const val KEY_AGREED = "agreed"

    fun agreed(ctx: Context): Boolean =
        ctx.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getBoolean(KEY_AGREED, false)

    fun setAgreed(ctx: Context, value: Boolean) {
        ctx.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
            .edit()
            .putBoolean(KEY_AGREED, value)
            .apply()
    }
}
