mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
fix: reduced the frequency of the optimization prompt dialog and made it possible to disable it
This commit is contained in:
parent
200ce6555b
commit
f147c762d5
3 changed files with 19 additions and 10 deletions
|
|
@ -10,6 +10,7 @@ object Preferences {
|
|||
private const val TOKEN = "token"
|
||||
private const val SALT = "salt"
|
||||
private const val LOW_SECURITY = "low_security"
|
||||
private const val BATTERY_OPTIMIZATION = "battery_optimization"
|
||||
private const val SERVER_ID = "server_id"
|
||||
private const val PLAYBACK_SPEED = "playback_speed"
|
||||
private const val SKIP_SILENCE = "skip_silence"
|
||||
|
|
@ -100,6 +101,16 @@ object Preferences {
|
|||
App.getInstance().preferences.edit().putString(SERVER_ID, serverId).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun askForOptimization(): Boolean? {
|
||||
return App.getInstance().preferences.getBoolean(BATTERY_OPTIMIZATION, true)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun dontAskForOptimization() {
|
||||
App.getInstance().preferences.edit().putBoolean(BATTERY_OPTIMIZATION, false).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getPlaybackSpeed(): Float {
|
||||
return App.getInstance().preferences.getFloat(PLAYBACK_SPEED, 1f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue