viewmodel adjustments

This commit is contained in:
X1nto 2020-07-17 02:08:00 +04:00
parent 147042ca49
commit 723cdd87ef
1 changed files with 2 additions and 1 deletions

View File

@ -67,7 +67,6 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
launch {
fetching.set(true)
Crowdin.forceUpdate(getApplication())
shouldBeDisabled.set(nonrootModeSelected && !microgInstalled.get()!!)
vancedVersion.set(getJsonString("vanced.json", "version", getApplication()))
microgVersion.set(getJsonString("microg.json", "version", getApplication()))
microgInstalled.set(isPackageInstalled("com.mgoogle.android.gms", pm))
@ -80,6 +79,7 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
microgInstalledVersionCode.set(getPkgVerCode(microgInstalled.get()!!, "com.mgoogle.android.gms"))
microgInstallButtonTxt.set(compareInt(microgInstalledVersionCode.get()!!, microgVersionCode.get()!!, getApplication()))
microgInstallButtonIcon.set(compareIntDrawable(microgInstalledVersionCode.get()!!, microgVersionCode.get()!!, getApplication()))
shouldBeDisabled.set(nonrootModeSelected && !microgInstalled.get()!!)
vancedInstallButtonIcon.set(
if (shouldBeDisabled.get()!!) {
null
@ -175,6 +175,7 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
}
init {
expanded.set(false)
fetchData()
}