reset all remembered video positions on toggling the settings item

This commit is contained in:
tibbi 2019-04-01 16:42:53 +02:00
parent d1d2be6483
commit 439d189b00

View file

@ -393,7 +393,14 @@ class Config(context: Context) : BaseConfig(context) {
var rememberLastVideoPosition: Boolean
get() = prefs.getBoolean(REMEMBER_LAST_VIDEO_POSITION, false)
set(rememberLastVideoPosition) = prefs.edit().putBoolean(REMEMBER_LAST_VIDEO_POSITION, rememberLastVideoPosition).apply()
set(rememberLastVideoPosition) {
if (!rememberLastVideoPosition) {
getAllLastVideoPositions().forEach {
prefs.edit().remove(it.key).apply()
}
}
prefs.edit().putBoolean(REMEMBER_LAST_VIDEO_POSITION, rememberLastVideoPosition).apply()
}
var visibleBottomActions: Int
get() = prefs.getInt(VISIBLE_BOTTOM_ACTIONS, DEFAULT_BOTTOM_ACTIONS)