diff --git a/UtilsLibrary/build.gradle b/UtilsLibrary/build.gradle index 0ab6c7c..2ffd8a8 100644 --- a/UtilsLibrary/build.gradle +++ b/UtilsLibrary/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 15 targetSdkVersion 28 versionCode 1 - versionName "1.3.4" + versionName "1.3.5" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/UtilsLibrary/src/main/java/com/aryanmo/utils/utils/Utils.kt b/UtilsLibrary/src/main/java/com/aryanmo/utils/utils/Utils.kt index a2713f7..4b63b31 100644 --- a/UtilsLibrary/src/main/java/com/aryanmo/utils/utils/Utils.kt +++ b/UtilsLibrary/src/main/java/com/aryanmo/utils/utils/Utils.kt @@ -128,15 +128,15 @@ fun Activity.delayOnUiThread(duration: Int) { } fun Activity.delayOnUiThread(duration: Int, runnable: () -> Unit) { + Thread(Runnable { + try { + Thread.sleep(duration.toLong()) + } catch (e: InterruptedException) { + e.printStackTrace() + } + }).start() this.runOnUiThread { - Thread(Runnable { - try { - Thread.sleep(duration.toLong()) - } catch (e: InterruptedException) { - e.printStackTrace() - } - runnable() - }).start() + runnable() } }