mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-12 09:37:03 +01:00
added android client
This commit is contained in:
1 parent
8b95cf7a05
commit
6db6909824
73 files changed
+9234
-106
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package io.narl.protonstream.settings
|
||||
|
||||
import android.content.Context
|
||||
|
||||
class SettingsStore(context: Context) {
|
||||
private val preferences = context.getSharedPreferences(NAME, Context.MODE_PRIVATE)
|
||||
|
||||
var wifiOnly: Boolean
|
||||
get() = preferences.getBoolean(KEY_WIFI_ONLY, true)
|
||||
set(value) { preferences.edit().putBoolean(KEY_WIFI_ONLY, value).apply() }
|
||||
|
||||
var backgroundAudio: Boolean
|
||||
get() = preferences.getBoolean(KEY_BACKGROUND_AUDIO, true)
|
||||
set(value) { preferences.edit().putBoolean(KEY_BACKGROUND_AUDIO, value).apply() }
|
||||
|
||||
private companion object {
|
||||
const val NAME = "proton_stream_settings"
|
||||
const val KEY_WIFI_ONLY = "wifi_only"
|
||||
const val KEY_BACKGROUND_AUDIO = "background_audio"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user