From 5c9092a67fdafd65932ab2fc6676203dd08d55a5 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 5 Feb 2019 12:17:15 +0000 Subject: [PATCH] Fixed: not returning coroutine job. Increased version to 2.3.1 --- app/build.gradle | 2 +- app/maven-push.gradle | 2 +- .../arch/presentation/base/BasePresenterImpl.kt | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0ed6412..c2fe4d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 19 targetSdkVersion 28 versionCode 6 - versionName "2.3.0" + versionName "2.3.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/maven-push.gradle b/app/maven-push.gradle index 7c7516b..226a663 100644 --- a/app/maven-push.gradle +++ b/app/maven-push.gradle @@ -12,7 +12,7 @@ allprojects { ext."signing.password" = System.getenv('password') } // Artifact settings def _group = 'dk.nodes.arch' -def _version = '2.3.0' +def _version = '2.3.1' def _archivesBaseName = 'base' def _name = 'Nodes Architecture Library' diff --git a/app/src/main/java/dk/nodes/arch/presentation/base/BasePresenterImpl.kt b/app/src/main/java/dk/nodes/arch/presentation/base/BasePresenterImpl.kt index 1feb850..5a2feee 100644 --- a/app/src/main/java/dk/nodes/arch/presentation/base/BasePresenterImpl.kt +++ b/app/src/main/java/dk/nodes/arch/presentation/base/BasePresenterImpl.kt @@ -108,16 +108,16 @@ abstract class BasePresenterImpl : BasePresenter, LifecycleObserver { defaultCoroutineContext = mainThreadSurrogate + job } - fun launchOnUI(block: suspend CoroutineScope.() -> Unit) { - mainScope.launch(context = mainCoroutineContext, block = block) + fun launchOnUI(block: suspend CoroutineScope.() -> Unit): Job { + return mainScope.launch(context = mainCoroutineContext, block = block) } - fun launchOnIO(block: suspend CoroutineScope.() -> Unit) { - ioScope.launch(context = mainCoroutineContext, block = block) + fun launchOnIO(block: suspend CoroutineScope.() -> Unit): Job { + return ioScope.launch(context = mainCoroutineContext, block = block) } - fun launch(block: suspend CoroutineScope.() -> Unit) { - defaultScope.launch(context = defaultCoroutineContext, block = block) + fun launch(block: suspend CoroutineScope.() -> Unit): Job { + return defaultScope.launch(context = defaultCoroutineContext, block = block) } fun asyncOnUI(block: suspend CoroutineScope.() -> T): Deferred {