Package-level declarations
Functions
Link copied to clipboard
fun preferencesDataStore( name: String, corruptionHandler: ReplaceFileCorruptionHandler<Preferences>? = null, produceMigrations: (Context) -> List<DataMigration<Preferences>> = { listOf() }, scope: CoroutineScope = CoroutineScope(Dispatchers.IO + SupervisorJob())): ReadOnlyProperty<Context, DataStore<Preferences>>
Creates a property delegate for a single process DataStore. This should only be called once in a file (at the top level), and all usages of the DataStore should use a reference the same Instance. The receiver type for the property delegate must be an instance of Context.
Link copied to clipboard
Generate the File object for Preferences DataStore based on the provided context and name. The file is in the this.applicationContext.filesDir + "datastore/" subdirectory with name. This is public to allow for testing and backwards compatibility (e.g. if moving from the preferencesDataStore
delegate or context.createDataStore to PreferencesDataStoreFactory).
Link copied to clipboard
fun SharedPreferencesMigration(produceSharedPreferences: () -> SharedPreferences, keysToMigrate: Set<String> = MIGRATE_ALL_KEYS): SharedPreferencesMigration<Preferences>
fun SharedPreferencesMigration( context: Context, sharedPreferencesName: String, keysToMigrate: Set<String> = MIGRATE_ALL_KEYS): SharedPreferencesMigration<Preferences>
Creates a SharedPreferencesMigration for DataStore