1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 13:57:10 +09:00

add Toast ext

This commit is contained in:
Konstantin 2019-03-31 13:15:32 +03:00
parent d10b70e70d
commit 7bf7b35fbd

View file

@ -1,7 +1,13 @@
package com.agileburo.anytype.core_utils
import android.content.Context
import android.widget.Toast
fun <T> MutableList<T>.swap(index1: Int, index2: Int) {
val tmp = this[index1] // 'this' corresponds to the list
this[index1] = this[index2]
this[index2] = tmp
}
}
fun Context.toast(msg: CharSequence) =
Toast.makeText(this, msg, Toast.LENGTH_LONG).show()