add a function for updating the window background
This commit is contained in:
parent
e01d7569a9
commit
5277947130
2 changed files with 6 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -44,6 +44,7 @@ class CustomizationActivity : BaseSimpleActivity() {
|
|||
override fun onOk(dialog: AmbilWarnaDialog, color: Int) {
|
||||
baseConfig.backgroundColor = color
|
||||
setupColors()
|
||||
updateBackgroundColor()
|
||||
}
|
||||
}).show()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue