mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 10:35:26 +00:00
Fixed current version showing null when magisk is not installed
This commit is contained in:
parent
b2fa5b551e
commit
f332746188
@ -129,9 +129,13 @@ class HomeViewModel(
|
|||||||
else -> MagiskState.UP_TO_DATE
|
else -> MagiskState.UP_TO_DATE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (magiskState.value != MagiskState.NOT_INSTALLED) {
|
||||||
magiskCurrentVersion.value = version
|
magiskCurrentVersion.value = version
|
||||||
.format(Config.magiskVersionString, Config.magiskVersionCode)
|
.format(Config.magiskVersionString, Config.magiskVersionCode)
|
||||||
.let { current.format(it) }
|
.let { current.format(it) }
|
||||||
|
} else {
|
||||||
|
magiskCurrentVersion.value = ""
|
||||||
|
}
|
||||||
magiskLatestVersion.value = version
|
magiskLatestVersion.value = version
|
||||||
.format(Config.remoteMagiskVersionString, Config.remoteMagiskVersionCode)
|
.format(Config.remoteMagiskVersionString, Config.remoteMagiskVersionCode)
|
||||||
.let { latest.format(it) }
|
.let { latest.format(it) }
|
||||||
|
@ -106,6 +106,7 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/current_version"
|
android:id="@+id/current_version"
|
||||||
|
gone="@{state == MagiskState.LOADING || currentVersion.length == 0}"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
Loading…
Reference in New Issue
Block a user