|
|
|
@ -10,6 +10,7 @@ private var toast: Toast? = null |
|
|
|
|
|
|
|
|
|
fun Context.toastOnUi(message: Int) { |
|
|
|
|
runOnUI { |
|
|
|
|
kotlin.runCatching { |
|
|
|
|
if (toast == null) { |
|
|
|
|
toast = Toast.makeText(this, message, Toast.LENGTH_SHORT) |
|
|
|
|
} else { |
|
|
|
@ -18,10 +19,12 @@ fun Context.toastOnUi(message: Int) { |
|
|
|
|
} |
|
|
|
|
toast?.show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun Context.toastOnUi(message: CharSequence?) { |
|
|
|
|
runOnUI { |
|
|
|
|
kotlin.runCatching { |
|
|
|
|
if (toast == null) { |
|
|
|
|
toast = Toast.makeText(this, message, Toast.LENGTH_SHORT) |
|
|
|
|
} else { |
|
|
|
@ -30,10 +33,12 @@ fun Context.toastOnUi(message: CharSequence?) { |
|
|
|
|
} |
|
|
|
|
toast?.show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun Context.longToastOnUi(message: Int) { |
|
|
|
|
runOnUI { |
|
|
|
|
kotlin.runCatching { |
|
|
|
|
if (toast == null) { |
|
|
|
|
toast = Toast.makeText(this, message, Toast.LENGTH_LONG) |
|
|
|
|
} else { |
|
|
|
@ -42,10 +47,12 @@ fun Context.longToastOnUi(message: Int) { |
|
|
|
|
} |
|
|
|
|
toast?.show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun Context.longToastOnUi(message: CharSequence?) { |
|
|
|
|
runOnUI { |
|
|
|
|
kotlin.runCatching { |
|
|
|
|
if (toast == null) { |
|
|
|
|
toast = Toast.makeText(this, message, Toast.LENGTH_LONG) |
|
|
|
|
} else { |
|
|
|
@ -54,6 +61,7 @@ fun Context.longToastOnUi(message: CharSequence?) { |
|
|
|
|
} |
|
|
|
|
toast?.show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|