Remove usage of KObservableField

This commit is contained in:
topjohnwu
2020-07-08 06:14:32 -07:00
parent 8ffbffddb3
commit 18dab28c32
27 changed files with 93 additions and 172 deletions
@@ -3,6 +3,7 @@ package com.topjohnwu.magisk.ui.install
import android.content.Intent
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding
import com.topjohnwu.magisk.extensions.value
import com.topjohnwu.magisk.model.events.RequestFileEvent
import com.topjohnwu.magisk.ui.base.BaseUIFragment
import org.koin.androidx.viewmodel.ext.android.viewModel
@@ -4,6 +4,7 @@ import android.net.Uri
import android.text.SpannableString
import android.text.Spanned
import android.widget.Toast
import androidx.databinding.ObservableField
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.core.Info
import com.topjohnwu.magisk.core.download.DownloadService
@@ -12,12 +13,12 @@ import com.topjohnwu.magisk.core.utils.Utils
import com.topjohnwu.magisk.data.repository.StringRepository
import com.topjohnwu.magisk.extensions.addOnPropertyChangedCallback
import com.topjohnwu.magisk.extensions.subscribeK
import com.topjohnwu.magisk.extensions.value
import com.topjohnwu.magisk.model.entity.internal.Configuration
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject
import com.topjohnwu.magisk.model.events.RequestFileEvent
import com.topjohnwu.magisk.model.events.dialog.SecondSlotWarningDialog
import com.topjohnwu.magisk.ui.base.BaseViewModel
import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.superuser.Shell
import io.noties.markwon.Markwon
import org.koin.core.get
@@ -31,11 +32,11 @@ class InstallViewModel(
val isRooted get() = Shell.rootAccess()
val isAB get() = Info.isAB
val step = KObservableField(0)
val method = KObservableField(-1)
val progress = KObservableField(0)
val data = KObservableField<Uri?>(null)
val notes = KObservableField<Spanned>(SpannableString(""))
val step = ObservableField(0)
val method = ObservableField(-1)
val progress = ObservableField(0)
val data = ObservableField<Uri?>(null)
val notes = ObservableField<Spanned>(SpannableString(""))
init {
RemoteFileService.reset()