add notifcaiton support with unmount button
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package sh.sar.isodroid.isodrive
|
||||
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.flow.asSharedFlow
|
||||
|
||||
object MountEventBus {
|
||||
private val _events = MutableSharedFlow<MountEvent>(extraBufferCapacity = 1)
|
||||
val events = _events.asSharedFlow()
|
||||
|
||||
fun emitUnmounted() {
|
||||
_events.tryEmit(MountEvent.Unmounted)
|
||||
}
|
||||
|
||||
fun emitMounted() {
|
||||
_events.tryEmit(MountEvent.Mounted)
|
||||
}
|
||||
}
|
||||
|
||||
sealed class MountEvent {
|
||||
data object Mounted : MountEvent()
|
||||
data object Unmounted : MountEvent()
|
||||
}
|
||||
Reference in New Issue
Block a user