From e8e7cd500840dcd0180b7b65a5b2f95a5bb14da8 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 11 Jul 2020 03:22:17 -0700 Subject: [PATCH] Simply redirect isConnected ObservableField --- app/build.gradle.kts | 4 ++-- .../main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt | 4 +--- build.gradle.kts | 2 +- buildSrc/src/main/java/BuildSource.kt | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7589d2b67..6380c98e5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -77,8 +77,8 @@ dependencies { implementation("com.github.topjohnwu:jtar:1.0.0") implementation("com.jakewharton.timber:timber:4.7.1") - implementation("org.jetbrains.kotlin:kotlin-stdlib:${Deps.vKotlin}") - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Deps.vKotlin}") + implementation(kotlin("stdlib")) + implementation(kotlin("stdlib-jdk7")) val vBAdapt = "4.0.0" val bindingAdapter = "me.tatarka.bindingcollectionadapter2:bindingcollectionadapter" diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt index f82629d74..1cba2089f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt @@ -15,10 +15,8 @@ import androidx.navigation.NavDirections import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.base.BaseActivity -import com.topjohnwu.magisk.extensions.value import com.topjohnwu.magisk.model.events.* import com.topjohnwu.magisk.model.navigation.NavigationWrapper -import com.topjohnwu.magisk.model.observer.Observer import kotlinx.coroutines.Job import org.koin.core.KoinComponent @@ -34,7 +32,7 @@ abstract class BaseViewModel( val loaded @Bindable get() = state == State.LOADED val loadingFailed @Bindable get() = state == State.LOADING_FAILED - val isConnected = Observer(Info.isConnected) { Info.isConnected.value } + val isConnected get() = Info.isConnected val viewEvents: LiveData get() = _viewEvents val insets = ObservableField(Insets.NONE) diff --git a/build.gradle.kts b/build.gradle.kts index fc37df7d0..723186ddc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ buildscript { dependencies { classpath("com.android.tools.build:gradle:4.0.0") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Deps.vKotlin}") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72") classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${Deps.vNav}") // NOTE: Do not place your application dependencies here; they belong diff --git a/buildSrc/src/main/java/BuildSource.kt b/buildSrc/src/main/java/BuildSource.kt index c68292028..fd197caf8 100644 --- a/buildSrc/src/main/java/BuildSource.kt +++ b/buildSrc/src/main/java/BuildSource.kt @@ -6,7 +6,6 @@ import java.io.File import java.util.* object Deps { - const val vKotlin = "1.3.72" const val vNav = "2.3.0" }