Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 21 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '5.5.4' propVersionName = '5.5.5' kotlin_version = '1.3.10' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +8 −8 Original line number Diff line number Diff line Loading @@ -91,18 +91,18 @@ fun Context.isBlackAndWhiteTheme() = baseConfig.textColor == Color.WHITE && base fun Context.getAdjustedPrimaryColor() = if (isBlackAndWhiteTheme()) Color.WHITE else baseConfig.primaryColor fun Context.toast(id: Int, length: Int = Toast.LENGTH_SHORT) { if (isOnMainThread()) { toast(getString(id), length) } else { Handler(Looper.getMainLooper()).post { toast(getString(id), length) } } } fun Context.toast(msg: String, length: Int = Toast.LENGTH_SHORT) { try { if (isOnMainThread()) { Toast.makeText(applicationContext, msg, length).show() } else { Handler(Looper.getMainLooper()).post { Toast.makeText(applicationContext, msg, length).show() } } } catch (e: Exception) { } } Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 21 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '5.5.4' propVersionName = '5.5.5' kotlin_version = '1.3.10' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +8 −8 Original line number Diff line number Diff line Loading @@ -91,18 +91,18 @@ fun Context.isBlackAndWhiteTheme() = baseConfig.textColor == Color.WHITE && base fun Context.getAdjustedPrimaryColor() = if (isBlackAndWhiteTheme()) Color.WHITE else baseConfig.primaryColor fun Context.toast(id: Int, length: Int = Toast.LENGTH_SHORT) { if (isOnMainThread()) { toast(getString(id), length) } else { Handler(Looper.getMainLooper()).post { toast(getString(id), length) } } } fun Context.toast(msg: String, length: Int = Toast.LENGTH_SHORT) { try { if (isOnMainThread()) { Toast.makeText(applicationContext, msg, length).show() } else { Handler(Looper.getMainLooper()).post { Toast.makeText(applicationContext, msg, length).show() } } } catch (e: Exception) { } } Loading