Skip to content

Instantly share code, notes, and snippets.

View rubenweerts's full-sized avatar

Ruben Weerts rubenweerts

View GitHub Profile
@rubenweerts
rubenweerts / general_extension_functions.kt
Created October 12, 2017 04:28
Collection of Kotlin extention functions
fun Context.toast(message: CharSequence, duration: Int = Toast.LENGTH_SHORT) = Toast.makeText(this, message, duration).show()
fun List<String>.containsAny(other: List<String>): Boolean {
forEach { left ->
other.forEach { right ->
if (left.equals(right)) {
return true
}
}
}