Add remote megaphone.

This commit is contained in:
Cody Henthorne
2022-05-11 14:33:54 -04:00
committed by Alex Hart
parent 820277800b
commit bb963f9210
20 changed files with 1069 additions and 322 deletions

View File

@@ -55,4 +55,14 @@ fun Cursor.isNull(column: String): Boolean {
return CursorUtil.isNull(this, column)
}
inline fun <T> Cursor.readToList(mapper: (Cursor) -> T): List<T> {
val list = mutableListOf<T>()
use {
while (moveToNext()) {
list += mapper(this)
}
}
return list
}
fun Boolean.toInt(): Int = if (this) 1 else 0