14 lines
312 B
Kotlin
14 lines
312 B
Kotlin
package io.legato.kazusa.utils
|
|
|
|
import android.os.Handler
|
|
import android.os.Looper
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
|
private val mainHandler by lazy { Handler(Looper.getMainLooper()) }
|
|
|
|
fun <T> MutableLiveData<T>.sendValue(value: T) {
|
|
mainHandler.post {
|
|
this@sendValue.value = value
|
|
}
|
|
}
|