Reduce usage of delegation

This commit is contained in:
topjohnwu
2020-07-15 01:21:57 -07:00
parent ba31c6b625
commit 6c6368fd81
15 changed files with 226 additions and 213 deletions
@@ -13,7 +13,7 @@ import com.topjohnwu.magisk.model.events.SnackbarEvent
import com.topjohnwu.magisk.ui.base.BaseViewModel
import com.topjohnwu.magisk.ui.base.diffListOf
import com.topjohnwu.magisk.ui.base.itemBindingOf
import com.topjohnwu.magisk.utils.observable
import com.topjohnwu.magisk.utils.set
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -41,7 +41,8 @@ class LogViewModel(
// --- magisk log
@get:Bindable
var consoleText by observable(" ", BR.consoleText)
var consoleText= " "
set(value) = set(value, field, { field = it }, BR.consoleText)
override fun refresh() = viewModelScope.launch {
consoleText = repo.fetchMagiskLogs()