add a function for updating the window background

This commit is contained in:
tibbi 2016-12-14 20:01:13 +01:00
parent e01d7569a9
commit 5277947130
2 changed files with 6 additions and 0 deletions

View file

@ -20,6 +20,7 @@ open class BaseSimpleActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
baseConfig = BaseConfig.newInstance(applicationContext)
updateBackgroundColor()
super.onCreate(savedInstanceState)
}
@ -33,6 +34,10 @@ open class BaseSimpleActivity : AppCompatActivity() {
}
}
fun updateBackgroundColor() {
window.decorView.setBackgroundColor(baseConfig.backgroundColor)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
super.onActivityResult(requestCode, resultCode, resultData)
if (requestCode == OPEN_DOCUMENT_TREE && resultCode == Activity.RESULT_OK && resultData != null) {

View file

@ -44,6 +44,7 @@ class CustomizationActivity : BaseSimpleActivity() {
override fun onOk(dialog: AmbilWarnaDialog, color: Int) {
baseConfig.backgroundColor = color
setupColors()
updateBackgroundColor()
}
}).show()
}