TimerLiveData

class TimerLiveData<T>(delayMs: Long, computeValue: () -> T) : LiveData<T>

A LiveData which updates its value every delayMs. Override computeValue to provide the new value for each period. Its value will only be updated while there are active observers.

Parameters

T

The type of the LiveData values.

delayMs

The delay between each update of the value.

computeValue

The periodically called function to compute the new value.

Constructors

Link copied to clipboard
fun <T> TimerLiveData(delayMs: Long, computeValue: () -> T)

Inherited properties

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

Inherited 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 fun observe(@NonNull p0: LifecycleOwner, @NonNull p1: Observer<in T>)
Link copied to clipboard
open fun observeForever(@NonNull p0: Observer<in T>)
Link copied to clipboard
open fun postValue(p0: T)
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 fun setValue(p0: T)