simplifying base models

new attachments
This commit is contained in:
2021-09-24 10:55:07 +03:00
parent 56fb93d2e4
commit e127501889
68 changed files with 1933 additions and 1559 deletions
@@ -0,0 +1,23 @@
package com.meloda.fast.common
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
object AppSettings {
val keyIsMultilineEnabled = booleanPreferencesKey("isMultilineEnabled")
}
val Context.dataStore: DataStore<Preferences> by preferencesDataStore(
name = "settings",
corruptionHandler = null,
scope = CoroutineScope(Dispatchers.IO + Job())
)