Skip to content

Instantly share code, notes, and snippets.

@BVantur
BVantur / ToastUtils.kt
Last active February 13, 2021 14:55
Deprecated ToastUtils
object ToastUtils {
private const val message = "Toast messages with custom views are not supported anymore. Please use SnackbarUtils or create a regular Toast."
private const val imports = "sp.bvantur.deprecatedtoast.utils"
fun showRegular(activity: Activity, textMessage: String) {
show(activity, textMessage)
}
@Deprecated(
@BVantur
BVantur / replaceWith.kt
Last active February 13, 2021 14:56
Replace regular Toast message with regular Snackbar message
private const val replaceRegular = ReplaceWith(
"SnackbarUtils.showRegular(activity, textMessage)",
"sp.bvantur.deprecatedtoast.utils")
@BVantur
BVantur / message.kt
Last active February 13, 2021 14:56
Deprecated message
const val message = "Toast messages with custom views are not supported anymore.
Please use SnackbarUtils or create a regular Toast."
@BVantur
BVantur / constructor.kt
Last active February 13, 2021 14:59
@deprecated kotlin constructor
<init>(
message: String,
replaceWith: ReplaceWith = ReplaceWith(""),
level: DeprecationLevel = DeprecationLevel.WARNING)
@BVantur
BVantur / SnackbarUtils.kt
Last active February 13, 2021 14:58
SnackbarUtils
object SnackbarUtils {
fun showRegular(activity: Activity, textMessage: String) {
show(activity, textMessage)
}
fun showSuccess(activity: Activity, textMessage: String) {
show(activity, textMessage, Color.GREEN)
}
fun showError(activity: Activity, textMessage: String) {
@BVantur
BVantur / ToastUtils.kt
Last active February 13, 2021 14:59
ToastUtils
object ToastUtils {
fun showRegular(activity: Activity, textMessage: String) {
show(activity, textMessage)
}
fun showSuccess(activity: Activity, textMessage: String) {
show(activity, textMessage, Color.GREEN)
}
fun showError(activity: Activity, textMessage: String) {

Keybase proof

I hereby claim:

  • I am bvantur on github.
  • I am bvantur (https://keybase.io/bvantur) on keybase.
  • I have a public key ASBpnfgFZ4MAn8JQ967uTqQ4DBpMYi-4EYz-5eI0Hv5iFgo

To claim this, I am signing this object: