Slide 30
Slide 30 text
GENERAL EXTENSIONS
fun ByteArray.convertBytesToBitmap(): Bitmap =
BitmapFactory.decodeByteArray(this, 0, size)
fun Double.celsiusToFahrenheit() : Double = (this * 1.8) + 32
fun String.convertStringToDate(simpleDateFormatPattern: String): Date? {
val simpleDateFormat = SimpleDateFormat(simpleDateFormatPattern, Locale.getDefault())
var value: Date? = null
justTry {
value = simpleDateFormat.parse(this)
}
return value
}