SharedPref

open class SharedPref(source)

Utility class for managing SharedPreferences with type-safe getters and setters.

Provides convenience methods for storing and retrieving:

  • Strings
  • Integers
  • Booleans
  • Longs

Uses the default SharedPreferences from PreferenceManager.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val FINISH_ONBOARDING: String = "finish_onboarding"
Link copied to clipboard
val KEY_FIRST_TIME_SESSION: String = "first_time_session"
Link copied to clipboard
val KEY_INSTALL_TS: String = "install_ts"
Link copied to clipboard
val KEY_SOFT_DISABLED: String = "soft_disabled"
Link copied to clipboard
val KEY_SURVEY_HELPFUL_SHOWN: String = "survey_helpful_shown"
Link copied to clipboard
val KEY_SURVEY_INTRUSIVE_SHOWN: String = "survey_intrusive_shown"
Link copied to clipboard

Functions

Link copied to clipboard
open fun getBoolean(key: String, defValue: Boolean): Boolean
Link copied to clipboard
open fun getInt(key: String, defValue: Int): Int
Link copied to clipboard
open fun getLong(key: String, def: Long): Long
Link copied to clipboard
open fun getString(key: String, defaultVal: String): String
Link copied to clipboard
open fun putBoolean(key: String, val: Boolean)
Link copied to clipboard
open fun putInt(key: String, val: Int)
Link copied to clipboard
open fun putLong(key: String, val: Long)
Link copied to clipboard
open fun putString(key: String, val: String)