From db4ef1443dc56bb8c6098b2cc681beadaccfb7d5 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Thu, 6 Feb 2020 15:00:44 +0100 Subject: [PATCH] Removed unnecessary code --- .../topjohnwu/magisk/ui/home/HomeViewModel.kt | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt index e06e63274..0883a1c03 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt @@ -21,7 +21,6 @@ import com.topjohnwu.magisk.model.events.dialog.EnvFixDialog import com.topjohnwu.magisk.model.events.dialog.ManagerInstallDialog import com.topjohnwu.magisk.model.events.dialog.UninstallDialog import com.topjohnwu.magisk.model.navigation.Navigation -import com.topjohnwu.magisk.model.observer.Observer import com.topjohnwu.magisk.ui.base.BaseViewModel import com.topjohnwu.magisk.ui.base.itemBindingOf import com.topjohnwu.magisk.utils.KObservableField @@ -46,22 +45,6 @@ class HomeViewModel( val stateVersionManager = KObservableField("") val stateCodeManager = KObservableField(0) val stateCodeStub = KObservableField(0) - val stateTextMagisk = Observer(stateMagisk) { - when (stateMagisk.value) { - MagiskState.NOT_INSTALLED -> R.string.installed_error.res() - MagiskState.UP_TO_DATE -> R.string.up_to_date.res() - MagiskState.LOADING -> R.string.loading.res() - MagiskState.OBSOLETE -> R.string.obsolete.res() - } - } - val stateTextManager = Observer(stateManager) { - when (stateManager.value) { - MagiskState.NOT_INSTALLED -> R.string.channel_error.res() - MagiskState.UP_TO_DATE -> R.string.up_to_date.res() - MagiskState.LOADING -> R.string.loading.res() - MagiskState.OBSOLETE -> R.string.obsolete.res() - } - } val statePackageManager = packageName val statePackageOriginal = statePackageManager == BuildConfig.APPLICATION_ID @@ -170,12 +153,6 @@ class HomeViewModel( } } - private fun String.clipVersion(other: String = ""): String { - val thisVersion = substringBefore('-') - val otherVersion = other.substringBefore('-') - return if (thisVersion != otherVersion) thisVersion else substringAfter('-') - } - } @Suppress("unused")