Last active
September 27, 2018 10:19
-
-
Save josinSbazin/7a5295600fc524259d627b7d0e3b7d44 to your computer and use it in GitHub Desktop.
Extension For Android
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
inline fun <V: View> V.isVisibleAndActionOrGone(condition: Boolean, body: (V) -> Unit) { | |
if (condition) { | |
this.visibility = View.VISIBLE | |
body(this) | |
} else { | |
this.visibility = View.GONE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment