Created
September 25, 2017 10:41
-
-
Save a-dminator/20713ee3b294cda61461f1e72c99e2fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Drawable.copy(context: Context) = run { | |
when (this) { | |
is BitmapDrawable -> { | |
BitmapDrawable(bitmap) | |
} | |
else -> { | |
null | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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