diff --git a/shared/src/main/java/com/google/samples/apps/iosched/shared/result/Event.kt b/shared/src/main/java/com/google/samples/apps/iosched/shared/result/Event.kt index 427915348e..685a3d5be9 100644 --- a/shared/src/main/java/com/google/samples/apps/iosched/shared/result/Event.kt +++ b/shared/src/main/java/com/google/samples/apps/iosched/shared/result/Event.kt @@ -21,7 +21,7 @@ import androidx.lifecycle.Observer /** * Used as a wrapper for data that is exposed via a LiveData that represents an event. */ -open class Event(private val content: T) { +open class Event(private val content: T) { var hasBeenHandled = false private set // Allow external read but not write @@ -50,7 +50,7 @@ open class Event(private val content: T) { * * [onEventUnhandledContent] is *only* called if the [Event]'s contents has not been handled. */ -class EventObserver(private val onEventUnhandledContent: (T) -> Unit) : Observer> { +class EventObserver(private val onEventUnhandledContent: (T) -> Unit) : Observer> { override fun onChanged(event: Event?) { event?.getContentIfNotHandled()?.let { value -> onEventUnhandledContent(value)