Created
March 14, 2018 10:43
-
-
Save micer/ae156e15b3b0650fb93181429551788e to your computer and use it in GitHub Desktop.
I'll put useful Kotlin Extension Functions here
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
private inline fun <T> TextView.updateOrHide(content: T?, action: TextView.(content: T) -> Unit) { | |
if (content != null) { | |
visibility = View.VISIBLE | |
action(content) | |
} else { | |
visibility = View.GONE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment