Skip to content

Instantly share code, notes, and snippets.

@a-dminator
Created September 25, 2017 10:41
Show Gist options
  • Save a-dminator/20713ee3b294cda61461f1e72c99e2fa to your computer and use it in GitHub Desktop.
Save a-dminator/20713ee3b294cda61461f1e72c99e2fa to your computer and use it in GitHub Desktop.
fun Drawable.copy(context: Context) = run {
when (this) {
is BitmapDrawable -> {
BitmapDrawable(bitmap)
}
else -> {
null
}
}
}
fun move(from: File, to: File) =
from.renameTo(to)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment