19 lines
420 B
Kotlin
19 lines
420 B
Kotlin
package com.heeeeka.card.utils
|
|
|
|
import android.content.Context
|
|
import android.widget.Toast
|
|
|
|
|
|
fun Context.toast(message: Int, isLong: Boolean = false) {
|
|
toast(getString(message), isLong)
|
|
}
|
|
|
|
fun Context.toast(message: CharSequence, isLong: Boolean = false) {
|
|
Toast.makeText(
|
|
this, message, if (isLong) {
|
|
Toast.LENGTH_LONG
|
|
} else {
|
|
Toast.LENGTH_SHORT
|
|
}
|
|
).show()
|
|
} |