forked from Louvorg/ReaderForSelfoss-multiplatform
Theme should automatically change on phone settings change.
This commit is contained in:
@ -35,6 +35,7 @@ class AppSettingsService {
|
||||
private var _fontSize: Int? = null
|
||||
private var _staticBar: Boolean? = null
|
||||
private var _font: String = ""
|
||||
private var _theme: Int? = null
|
||||
|
||||
|
||||
init {
|
||||
@ -318,6 +319,17 @@ class AppSettingsService {
|
||||
return _font
|
||||
}
|
||||
|
||||
private fun refreshCurrentTheme() {
|
||||
_theme = settings.getString(CURRENT_THEME, "-1").toInt()
|
||||
}
|
||||
|
||||
fun getCurrentTheme(): Int {
|
||||
if (_theme == null) {
|
||||
refreshCurrentTheme()
|
||||
}
|
||||
return _theme ?: -1
|
||||
}
|
||||
|
||||
fun refreshApiSettings() {
|
||||
refreshPassword()
|
||||
refreshUsername()
|
||||
@ -346,6 +358,7 @@ class AppSettingsService {
|
||||
refreshFontSize()
|
||||
refreshFont()
|
||||
refreshStaticBarEnabled()
|
||||
refreshCurrentTheme()
|
||||
}
|
||||
|
||||
fun refreshLoginInformation(
|
||||
@ -444,5 +457,7 @@ class AppSettingsService {
|
||||
const val INFINITE_LOADING = "infinite_loading"
|
||||
|
||||
const val ITEMS_CACHING = "items_caching"
|
||||
|
||||
const val CURRENT_THEME = "currentMode"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user