cloudroam
2025-04-10 5fc9567cfa6b6beee4f52a9f835f304865d693e1
app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt
@@ -9,6 +9,7 @@
    private const val KEY_PHONE = "user_phone"
    private const val KEY_FIRST_INSTALL = "first_install"
    private const val LAST_LOGIN_PHONE = "last_login_phone"
    private const val PREF_LAST_CHECK_TIME_PREFIX = "last_check_time_"
    private lateinit var preferences: SharedPreferences
@@ -55,4 +56,12 @@
    fun getLastLoginPhone(): String {
        return preferences.getString(LAST_LOGIN_PHONE, "") ?: ""
    }
    fun getLastCheckTime(categoryId: Int): Long {
        return preferences.getLong(PREF_LAST_CHECK_TIME_PREFIX + categoryId, 0)
    }
    fun setLastCheckTime(categoryId: Int, time: Long) {
        preferences.edit().putLong(PREF_LAST_CHECK_TIME_PREFIX + categoryId, time).apply()
    }