Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '4.5.19' propVersionName = '4.5.20' kotlin_version = '1.2.60' support_libs = '27.1.1' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +1 −4 Original line number Diff line number Diff line Loading @@ -62,10 +62,7 @@ private fun showToast(activity: Activity, messageId: Int, length: Int) { private fun showToast(activity: Activity, message: String, length: Int) { if (!activity.isActivityDestroyed()) { try { Toast.makeText(activity.applicationContext, message, length).show() } catch (e: Exception) { } activity.applicationContext.toast(message, length) } } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +5 −2 Original line number Diff line number Diff line Loading @@ -90,11 +90,14 @@ 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) { Toast.makeText(this, id, length).show() toast(getString(id), length) } fun Context.toast(msg: String, length: Int = Toast.LENGTH_SHORT) { Toast.makeText(this, msg, length).show() try { Toast.makeText(applicationContext, msg, length).show() } catch (e: Exception) { } } val Context.baseConfig: BaseConfig get() = BaseConfig.newInstance(this) Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '4.5.19' propVersionName = '4.5.20' kotlin_version = '1.2.60' support_libs = '27.1.1' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +1 −4 Original line number Diff line number Diff line Loading @@ -62,10 +62,7 @@ private fun showToast(activity: Activity, messageId: Int, length: Int) { private fun showToast(activity: Activity, message: String, length: Int) { if (!activity.isActivityDestroyed()) { try { Toast.makeText(activity.applicationContext, message, length).show() } catch (e: Exception) { } activity.applicationContext.toast(message, length) } } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +5 −2 Original line number Diff line number Diff line Loading @@ -90,11 +90,14 @@ 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) { Toast.makeText(this, id, length).show() toast(getString(id), length) } fun Context.toast(msg: String, length: Int = Toast.LENGTH_SHORT) { Toast.makeText(this, msg, length).show() try { Toast.makeText(applicationContext, msg, length).show() } catch (e: Exception) { } } val Context.baseConfig: BaseConfig get() = BaseConfig.newInstance(this) Loading