ref #6: Only hide matching powerbar
This commit is contained in:
parent
f2c7c59bb7
commit
6daefd3b3c
@ -258,14 +258,16 @@ class Window(
|
|||||||
val duration = intent.getLongExtra("duration", 15_000)
|
val duration = intent.getLongExtra("duration", 15_000)
|
||||||
Log.d(TAG, "Received broadcast to hide $location powerbar for $duration ms")
|
Log.d(TAG, "Received broadcast to hide $location powerbar for $duration ms")
|
||||||
|
|
||||||
currentHideJob?.cancel()
|
if (location == powerbarLocation) {
|
||||||
currentHideJob = CoroutineScope(Dispatchers.Main).launch {
|
currentHideJob?.cancel()
|
||||||
rootView.visibility = View.INVISIBLE
|
currentHideJob = CoroutineScope(Dispatchers.Main).launch {
|
||||||
withContext(Dispatchers.Default){
|
rootView.visibility = View.INVISIBLE
|
||||||
delay(duration)
|
withContext(Dispatchers.Default) {
|
||||||
|
delay(duration)
|
||||||
|
}
|
||||||
|
rootView.visibility = View.VISIBLE
|
||||||
|
currentHideJob = null
|
||||||
}
|
}
|
||||||
rootView.visibility = View.VISIBLE
|
|
||||||
currentHideJob = null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user