Apply background dim to view instead of window
Setting both blur and dim to window at the same time breaks the blur transition
This commit is contained in:
parent
8f5e920d4e
commit
7b6ff6e6eb
@ -50,11 +50,9 @@ class LauncherActivity : BaseActivity() {
|
|||||||
viewModel.dimBackground.observe(this) { dim ->
|
viewModel.dimBackground.observe(this) { dim ->
|
||||||
window.attributes = window.attributes.also {
|
window.attributes = window.attributes.also {
|
||||||
if (dim) {
|
if (dim) {
|
||||||
it.dimAmount = 0.3f
|
binding.rootView.setBackgroundColor(0x4C000000)
|
||||||
it.flags = it.flags or WindowManager.LayoutParams.FLAG_DIM_BEHIND
|
|
||||||
} else {
|
} else {
|
||||||
it.dimAmount = 0f
|
binding.rootView.setBackgroundColor(0)
|
||||||
it.flags = it.flags and WindowManager.LayoutParams.FLAG_DIM_BEHIND.inv()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user