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