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:
parent
d10b70e70d
commit
7bf7b35fbd
1 changed files with 7 additions and 1 deletions
|
@ -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()
|
Loading…
Add table
Add a link
Reference in a new issue