package com.base.appzxhy

import com.base.appzxhy.utils.AppPreferences
import java.util.Locale

object SpConstObject {


    //是否已经点击start
    var ifAgreePrivacy = false
        get() {
            return AppPreferences.getInstance().getBoolean("ifAgreePrivacy", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("ifAgreePrivacy", value, true)
        }

    //是否已经走过引导页
    var isGuided
        get() = AppPreferences.getInstance().getBoolean("isGuided", false)
        set(value) = AppPreferences.getInstance().putBoolean("isGuided", value)


    var appLanguageSp: String = Locale.getDefault().language
        get() {
            return AppPreferences.getInstance().getString("languageSp", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("languageSp", value, true)
        }

    var appLanguageCountrySp: String = Locale.getDefault().country
        get() {
            return AppPreferences.getInstance().getString("languageCountrySp", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("languageCountrySp", value, true)
        }

    //清理过的文件大小
    var cleanedSize = 0L
        get() {
            return AppPreferences.getInstance().getLong("cleanedSize", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("cleanedSize", value, true)
        }

    //是否已经评价过
    var isScoreRated = false
        get() {
            return AppPreferences.getInstance().getBoolean("isScoreRated", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("isScoreRated", value, true)
        }

    //平均分数
    var scoreRate = 0
        get() {
            return AppPreferences.getInstance().getInt("scoreRate", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("scoreRate", value, true)
        }

    //回到主页的次数
    var mainPageCount = 0L
        get() {
            return AppPreferences.getInstance().getLong("mainPageCount", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("mainPageCount", value, true)
        }

    //fcm token
    var fcmToken = ""
        get() {
            return AppPreferences.getInstance().getString("fcmToken", field)
        }
        set(value) {
            field = value
            AppPreferences.getInstance().put("fcmToken", value, true)
        }

}