collapseIf

fun View.collapseIf(value: Boolean)

Sets receiver's visibility to View.GONE if value is true; sets it to View.VISIBLE otherwise. Opposite of expandIf; also see hideIf.