LiveDataEvent

class LiveDataEvent<T> : MutableLiveData<T>

Extension of the MutableLiveData acting as single-shot observable event. Once a new data value is set, then the attached observer is notified only once. Note that only one observer is going to be notified of changes.

Important: This is a Public Preview API. It may be changed or removed at any time.

Constructors

Link copied to clipboard
fun LiveDataEvent()

Functions

Link copied to clipboard
open fun changeActiveCounter(p0: Int)
Link copied to clipboard
open fun dispatchingValue(@Nullable p0: LiveData.ObserverWrapper<T>?)
Link copied to clipboard
open fun getValue(): T?
Link copied to clipboard
open fun getVersion(): Int
Link copied to clipboard
open fun hasActiveObservers(): Boolean
Link copied to clipboard
open fun hasObservers(): Boolean
Link copied to clipboard
open override fun observe(owner: LifecycleOwner, observer: Observer<in T>)

Sets a new observer.

Link copied to clipboard
open fun observeForever(@NonNull p0: Observer<in T>)
Link copied to clipboard
open fun onActive()
Link copied to clipboard
open fun onInactive()
Link copied to clipboard
open override fun postValue(value: T)

Posts a task to the main thread to set the given value.

Link copied to clipboard
open fun removeObserver(@NonNull p0: Observer<in T>)
Link copied to clipboard
open fun removeObservers(@NonNull p0: LifecycleOwner)
Link copied to clipboard
open override fun setValue(t: T?)

Sets the value. If there are active observers, the value will be dispatched to them.

Properties

Link copied to clipboard
val mActiveCount: Int
Link copied to clipboard
val mDataLock: Any
Link copied to clipboard
val mPendingData: Any