Package-level declarations

Types

Link copied to clipboard
object Keys
Link copied to clipboard

The module for modifying preferences.

Link copied to clipboard
class PreferenceValue<Kt>(context: Context, key: Preferences.Key<Kt>, default: Kt) : Value<Kt>

Functions

Link copied to clipboard
fun <T> collectAsState(key: Preferences.Key<T>, default: T): State<T>

Collects the the value of key as a state.

Link copied to clipboard
suspend fun <T> Context.get(key: Preferences.Key<T>, default: T): T
suspend fun <T> AndroidViewModel.get(key: Preferences.Key<T>, default: T): T

Gets the last value stored at key, or returns default if there are no stored values.

Link copied to clipboard
fun <R> DataStore<Preferences>.getTheFlow(key: Preferences.Key<R>, default: R): Flow<R>
Link copied to clipboard
fun <T> ComponentActivity.observe(key: Preferences.Key<T>, default: T, @WorkerThread callback: suspend (value: T) -> Unit): Job

Observes the values sent to key while the Activity is started. Will pause onPause, and restart after onStart.

Link copied to clipboard
Link copied to clipboard
suspend fun <T> Context.set(key: Preferences.Key<T>, value: T)

Updates the value at key with value.

fun <T> AndroidViewModel.set(key: Preferences.Key<T>, value: T): Job

Updates the value at key with value using the scope of the view model.

Link copied to clipboard
fun <T> Context.setAsync(key: Preferences.Key<T>, value: T): Job

Updates the value at key with value in the IO thread.

Properties

Link copied to clipboard
Link copied to clipboard
const val NEARBY_DISTANCE_DEFAULT: Int = 1000

The default value of the distance to consider as nearby for nearby zones.