| | |
| | | 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 |
| | | |
| | |
| | | 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() |
| | | } |
| | | } |