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
open class AacMviViewModelDH<STATE, EFFECT, EVENT>(application: Application, private val aacMviDH: AacMviDH<STATE, EFFECT>) : | |
AndroidViewModel(application), ViewModelContract<EVENT> { | |
fun viewStates(): LiveData<STATE> = aacMviDH.stateLiveData | |
fun viewEffects(): LiveData<EFFECT> = aacMviDH.effectLiveData | |
@CallSuper | |
override fun process(viewEvent: EVENT) { | |
Log.d(TAG, "processing viewEvent : $viewEvent") |
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
open class AacMviDH<STATE, EFFECT> { | |
private val _states: MutableLiveData<STATE> = MutableLiveData() | |
val stateLiveData: LiveData<STATE> | |
get() = _states | |
private var _state: STATE? = null | |
var state: STATE | |
get() = _state | |
?: throw UninitializedPropertyAccessException("\"state\" was queried before being initialized") |
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
import android.app.Service | |
import android.content.Intent | |
import android.os.IBinder | |
import android.support.annotation.Nullable | |
import android.support.annotation.WorkerThread | |
import kotlinx.coroutines.* | |
import kotlinx.coroutines.channels.Channel | |
import kotlinx.coroutines.channels.SendChannel | |
import kotlinx.coroutines.channels.actor | |
import kotlin.coroutines.CoroutineContext |
OlderNewer