Update displayTheme prference only if changed
This commit is contained in:
@@ -33,6 +33,7 @@ class ConfigActivity : AppCompatActivity() {
|
||||
private var oldCAFile = false
|
||||
private var oldLogLevel = ""
|
||||
private var callVolume = BaresipService.callVolume
|
||||
private var oldDisplayTheme = -1
|
||||
private var save = false
|
||||
private var restart = false
|
||||
private var menu: Menu? = null
|
||||
@@ -43,6 +44,7 @@ class ConfigActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
binding = ActivityConfigBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
@@ -100,7 +102,7 @@ class ConfigActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
darkTheme = binding.DarkTheme
|
||||
val oldDisplayTheme = Preferences(applicationContext).displayTheme
|
||||
oldDisplayTheme = Preferences(applicationContext).displayTheme
|
||||
darkTheme.isChecked = oldDisplayTheme == AppCompatDelegate.MODE_NIGHT_YES
|
||||
|
||||
debug = binding.Debug
|
||||
@@ -246,6 +248,7 @@ class ConfigActivity : AppCompatActivity() {
|
||||
AppCompatDelegate.MODE_NIGHT_YES
|
||||
else
|
||||
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
if (oldDisplayTheme != newDisplayTheme)
|
||||
Preferences(applicationContext).displayTheme = newDisplayTheme
|
||||
|
||||
var logLevelString = "2"
|
||||
|
||||
Reference in New Issue
Block a user