Separated libpupil to standalone repository

Migrated to Kotlin 1.4
This commit is contained in:
tom5079
2020-08-23 20:26:23 +09:00
parent 735dbab695
commit 216914882c
60 changed files with 233 additions and 486 deletions

View File

@@ -51,4 +51,12 @@ fun byteToString(byte: Long, precision : Int = 1) : String {
return "%.${precision}f ${suffix[suffixIndex]}".format(size)
}
}
/*
* Convert android generated ID to requestCode
* to prevent java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
*
* https://stackoverflow.com/questions/38072322/generate-16-bit-unique-ids-in-android-for-startactivityforresult
*/
fun Int.normalizeID() = this.and(0xFFFF)