This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define our singleton Event Bus | |
object SnackBarMessageBus { | |
private val snackBarMessageBUS = MutableLiveData<String>() | |
fun sendMessage(message: String) { | |
if (snackBarMessageBUS.hasActiveObservers()) { | |
snackBarMessageBUS.postValue(message) | |
// We need to re-set the value because we want this to be displayed only once |